• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IAutoWikiBrowser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IAutoWikiBrowser的典型用法代码示例。如果您正苦于以下问题:C# IAutoWikiBrowser类的具体用法?C# IAutoWikiBrowser怎么用?C# IAutoWikiBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IAutoWikiBrowser类属于命名空间,在下文中一共展示了IAutoWikiBrowser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ServerControl

        /// <summary>
        /// Constructor/initialisation, called from IAWBPlugin.Initialise
        /// </summary>
        /// <param name="AWBForm"></param>
        internal ServerControl(IAutoWikiBrowser sender)
        {
            InitializeComponent();

            // Store reference to AWB main form:
            AWBForm = sender;

            // Set up our UI objects:
            StatusText.Visible = false;
            StatusText.Margin = new Padding(10, 0, 10, 0);
            StatusText.BorderSides = ToolStripStatusLabelBorderSides.Left | ToolStripStatusLabelBorderSides.Right;
            StatusText.BorderStyle = Border3DStyle.Etched;
            //AWBForm.StatusStrip.ShowItemToolTips = true; // naughty hack in case somebody turns this off in the designer
            EnabledMenuItem.CheckOnClick = true;
            TabPageMenuItem.CheckOnClick = true;

            // Event handlers:
            AboutMenuItem.Click += AboutMenuItemClicked;
            EnabledMenuItem.CheckedChanged += PluginEnabled_CheckedChange;
            TabPageMenuItem.CheckedChanged += TabPageMenuItem_CheckedChange;
            ConfigMenuItem.Click += ShowSettings;
            HideButton.Click += HideButton_Click;
            SettingsButton.Click += ShowSettings;

            // Add our UI objects to the AWB main form:
            AWBForm.StatusStrip.Items.Insert(2, StatusText);
            EnabledMenuItem.DropDownItems.Add(ConfigMenuItem);
            EnabledMenuItem.DropDownItems.Add(TabPageMenuItem);
            AWBForm.PluginsToolStripMenuItem.DropDownItems.Add(EnabledMenuItem);
            AWBForm.HelpToolStripMenuItem.DropDownItems.Add(AboutMenuItem);
            AWBForm.HelpToolStripMenuItem.DropDownItems.Add(AboutMenuItem);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:36,代码来源:ServerControl.cs


示例2: ProcessArticle

        public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs)
        {
            //If menu item is not checked, then return
            if (!PluginEnabled || Settings.Images.Count == 0)
            {
                eventargs.Skip = false;
                return eventargs.ArticleText;
            }

            eventargs.EditSummary = "";
            string text = eventargs.ArticleText;

            foreach (KeyValuePair<string, string> p in Settings.Images)
            {
                bool noChange;

                if (p.Value.Length == 0)
                {
                    text = Parsers.RemoveImage(p.Key, text, Settings.Comment, "", out noChange);
                    if (!noChange) eventargs.EditSummary += ", removed " + Variables.Namespaces[6] + p.Key;
                }
                else
                {
                    text = Parsers.ReplaceImage(p.Key, p.Value, text, out noChange);
                    if (!noChange) eventargs.EditSummary += ", replaced: " + Variables.Namespaces[6]
                         + p.Key + FindandReplace.Arrow + Variables.Namespaces[6] + p.Value;
                }
                if (!noChange) text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", "");
            }

            eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip;

            return text;
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:34,代码来源:IfdCore.cs


示例3: LoadNewPlugin

        public static void LoadNewPlugin(IAutoWikiBrowser awb)
        {
            OpenFileDialog pluginOpen = new OpenFileDialog();
            if (string.IsNullOrEmpty(LastPluginLoadedLocation))
                LoadLastPluginLoadedLocation();

            pluginOpen.InitialDirectory = string.IsNullOrEmpty(LastPluginLoadedLocation) ? Application.StartupPath : LastPluginLoadedLocation;
            
            pluginOpen.DefaultExt = "dll";
            pluginOpen.Filter = "DLL files|*.dll";
            pluginOpen.CheckFileExists = pluginOpen.Multiselect = /*pluginOpen.AutoUpgradeEnabled =*/ true;

            pluginOpen.ShowDialog();
            
            if (!string.IsNullOrEmpty(pluginOpen.FileName))
            {
                string newPath = Path.GetDirectoryName(pluginOpen.FileName);
                if (LastPluginLoadedLocation != newPath)
                {
                    LastPluginLoadedLocation = newPath;
                    SaveLastPluginLoadedLocation();
                }
            }

            Plugin.LoadPlugins(awb, pluginOpen.FileNames, true);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:26,代码来源:PluginManager.cs


示例4: ProcessArticle

        public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs)
        {
            //If menu item is not checked, then return
            if (!PluginEnabled)
            {
                eventargs.Skip = false;
                return eventargs.ArticleText;
            }

            // Warn if plugin is running, but no fronds have been enabled. A common newbie situation.
            if (Settings.EnabledFilenames.Count == 0)
            {
                DialogResult result = MessageBox.Show(
                    "It looks like you forget to select some fronds to use. You might like to choose some (\"Okay\"), or disable the plugin for now (\"Cancel\").",
                    "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
                if (result == DialogResult.OK)
                {
                    ConfigMenuItem.PerformClick();
                }
                else
                {
                    EnabledMenuItem.Checked = Settings.Enabled = PluginEnabled = false;
                }
                return eventargs.ArticleText;
            }

            string text = eventargs.ArticleText;
            foreach (Frond f in Replacements)
            {
                text = f.Preform(text);
            }
            return text;
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:33,代码来源:Fronds.cs


示例5: ArgumentNullException

        void IAWBPlugin.Initialise(IAutoWikiBrowser sender)
        {
            if (sender == null)
                throw new ArgumentNullException("sender");

            // Delegate UI-setup to our user control object:
            ServerUserControl = new ServerControl(sender);

            // Set up the TabPage and attach the user control to it:
            ServerPluginTabPage.UseVisualStyleBackColor = true;
            ServerPluginTabPage.Controls.Add(ServerUserControl);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:12,代码来源:ServerCore.cs


示例6: Initialise

        public void Initialise(IAutoWikiBrowser sender)
        {
            if (sender == null)
                throw new ArgumentNullException("sender");
            AWB = sender;

            // Menuitem should be checked when Fronds plugin is active and unchecked when not, and default to not!
            EnabledMenuItem.CheckOnClick = true;
            PluginEnabled = Settings.Enabled;

            ConfigMenuItem.Click += ShowSettings;
            EnabledMenuItem.CheckedChanged += PluginEnabledCheckedChange;
            AboutMenuItem.Click += AboutMenuItemClicked;
            PluginAboutMenuItem.Click += AboutMenuItemClicked;

            EnabledMenuItem.DropDownItems.AddRange(new[] {ConfigMenuItem, PluginAboutMenuItem});
            AWB.PluginsToolStripMenuItem.DropDownItems.Add(EnabledMenuItem);
            AWB.HelpToolStripMenuItem.DropDownItems.Add(AboutMenuItem);

            string newVersion = Tools.GetHTML(BaseURL + "version.txt").Replace(".", "");
            if (Int16.Parse(newVersion) > Int16.Parse(CurrentVersion.Replace(".", "")))
            {
                DialogResult result = MessageBox.Show(
                    "A newer version of Fronds is available. Downloading it is advisable, as it may contain important bugfixes.\r\n\r\nLoad update page now?",
                    "New version", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (result == DialogResult.Yes)
                {
                    Tools.OpenURLInBrowser("http://en.wikipedia.org/wiki/WP:FRONDS/U");
                }
            }

            XmlDocument xd = new XmlDocument();
            xd.LoadXml(Tools.GetHTML(BaseURL + "index.xml"));

            if (xd["fronds"] == null)
                return;

            foreach (XmlNode xn in xd["fronds"].GetElementsByTagName("frond"))
            {
                if (xn.ChildNodes.Count != 2)
                    continue;

                PossibleFilenames.Add(xn.ChildNodes[0].InnerText);
                PossibleFronds.Add(xn.ChildNodes[1].InnerText + " (" + xn.ChildNodes[0].InnerText + ")");
            }

            //TODO:We should probably load enabled Fronds when the plugin is enabled... (Probably in LoadSettings)
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:48,代码来源:Fronds.cs


示例7: Initialise

        public void Initialise(IAutoWikiBrowser sender)
        {
            AWB = sender;
            AWB.LogControl.LogAdded += LogControl_LogAdded;
            AWB.AddMainFormClosingEventHandler(UploadFinishedArticlesToServer);
            AWB.AddArticleRedirectedEventHandler(ArticleRedirected);

            PluginMenuItem.DropDownItems.Add(PluginUploadMenuItem);
            PluginMenuItem.DropDownItems.Add(PluginReAddArticlesMenuItem);
            PluginUploadMenuItem.Click += pluginUploadMenuItem_Click;

            PluginReAddArticlesMenuItem.Click += pluginReAddArticlesMenuItem_Click;
            sender.PluginsToolStripMenuItem.DropDownItems.Add(PluginMenuItem);

            AboutMenuItem.Click += aboutMenuItem_Click;
            sender.HelpToolStripMenuItem.DropDownItems.Add(AboutMenuItem);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:17,代码来源:TypoScanAWBPlugin.cs


示例8: Initialise

        public void Initialise(IAutoWikiBrowser sender)
        {
            AWB = sender;
            AWB.LogControl.LogAdded += new WikiFunctions.Logging.LogControl.LogAddedToControl(LogControl_LogAdded);
            AWB.AddMainFormClosingEventHandler(new FormClosingEventHandler(UploadFinishedArticlesToServer));
            AWB.AddArticleRedirectedEventHandler(new ArticleRedirected(ArticleRedirected));

            pluginMenuItem.DropDownItems.Add(pluginUploadMenuItem);
            pluginMenuItem.DropDownItems.Add(pluginReAddArticlesMenuItem);
            pluginUploadMenuItem.Click += new EventHandler(pluginUploadMenuItem_Click);

            pluginReAddArticlesMenuItem.Click += new EventHandler(pluginReAddArticlesMenuItem_Click);
            sender.PluginsToolStripMenuItem.DropDownItems.Add(pluginMenuItem);

            aboutMenuItem.Click += new EventHandler(aboutMenuItem_Click);
            sender.HelpToolStripMenuItem.DropDownItems.Add(aboutMenuItem);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:17,代码来源:TypoScanAWBPlugin.cs


示例9: Initialise

        public void Initialise(IAutoWikiBrowser sender)
        {
            if (sender == null)
                throw new ArgumentNullException("sender");

            AWB = sender;

            // Menuitem should be checked when IFD plugin is active and unchecked when not, and default to not!
            pluginenabledMenuItem.CheckOnClick = true;
            PluginEnabled = Settings.Enabled;

            pluginconfigMenuItem.Click += ShowSettings;
            pluginenabledMenuItem.CheckedChanged += PluginEnabledCheckedChange;
            aboutMenuItem.Click += AboutMenuItemClicked;
            pluginenabledMenuItem.DropDownItems.Add(pluginconfigMenuItem);

            sender.PluginsToolStripMenuItem.DropDownItems.Add(pluginenabledMenuItem);
            sender.HelpToolStripMenuItem.DropDownItems.Add(aboutMenuItem);
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:19,代码来源:IfdCore.cs


示例10: Initialise

        public void Initialise(IAutoWikiBrowser sender)
        {
            if (sender == null)
                throw new ArgumentNullException("sender");
            AWB = sender;

            // Menuitem should be checked when Fronds plugin is active and unchecked when not, and default to not!
            EnabledMenuItem.CheckOnClick = true;
            PluginEnabled = Settings.Enabled;

            ConfigMenuItem.Click += ShowSettings;
            EnabledMenuItem.CheckedChanged += PluginEnabledCheckedChange;
            AboutMenuItem.Click += AboutMenuItemClicked;
            PluginAboutMenuItem.Click += AboutMenuItemClicked;

            EnabledMenuItem.DropDownItems.AddRange(new[] {ConfigMenuItem, PluginAboutMenuItem});
            AWB.PluginsToolStripMenuItem.DropDownItems.Add(EnabledMenuItem);
            AWB.HelpToolStripMenuItem.DropDownItems.Add(AboutMenuItem);
        }
开发者ID:svick,项目名称:AWB,代码行数:19,代码来源:Fronds.cs


示例11: LoadPlugins

            internal static void LoadPlugins(IAutoWikiBrowser awb, string[] Plugins, bool afterStartup)
            {
                try
                {
                    foreach (string Plugin in Plugins)
                    {
                        if (Plugin.EndsWith("DotNetWikiBot.dll") || Plugin.EndsWith("Diff.dll"))
                            continue;

                        Assembly asm = null;
                        try
                        {
                            asm = Assembly.LoadFile(Plugin);
                        }
                        catch { }

                        if (asm != null)
                        {
                            Type[] types = asm.GetTypes();

                            foreach (Type t in types)
                            {
                                if (t.GetInterface("IAWBPlugin") != null)
                                {
                                    IAWBPlugin plugin = (IAWBPlugin)Activator.CreateInstance(t);
                                    Items.Add(plugin.Name, plugin);
                                    if (plugin.Name == "Kingbotk Plugin" && t.Assembly.GetName().Version.Major < 2)
                                        MessageBox.Show("You are using an out of date version of the Kingbotk Plugin. Please upgrade.",
                                            "Kingbotk Plugin", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                                    InitialisePlugin(plugin, awb);

                                    if (afterStartup) UsageStats.AddedPlugin(plugin);
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Problem loading plugins");
                }
            }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:43,代码来源:PluginManager.cs


示例12: AWBLogListenerUploadFailed

 private void AWBLogListenerUploadFailed(Exception ex, string sender, AWBLogListener logListener,
     IAutoWikiBrowser AWB)
 {
     logListener.WriteLine("Error: " + ex.Message, sender);
     ((IMyTraceListener)logListener).SkippedArticle(sender, "Error");
     //AWB.AddLogItem(false, logListener);
 }
开发者ID:svick,项目名称:AWB,代码行数:7,代码来源:LogUploader.cs


示例13: DoAWBLogListener

 private static bool DoAWBLogListener(bool doIt, IAutoWikiBrowser awb)
 {
     return (doIt && awb != null);
 }
开发者ID:svick,项目名称:AWB,代码行数:4,代码来源:LogUploader.cs


示例14: ProcessArticle

 public string ProcessArticle(IAutoWikiBrowser sender, ProcessArticleEventArgs eventargs)
 {
     return eventargs.ArticleText;
 }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:4,代码来源:TypoScanAWBPlugin.cs


示例15: Initialise

		public void Initialise(IAutoWikiBrowser sender)
		{
			// Store AWB object reference:
			AWBForm = sender;

			// Initialise our settings object:
			PluginSettings = new PluginSettingsControl();


			// Set up our UI objects:
            var _with2 = AWBForm.BotModeCheckbox;
			_with2.EnabledChanged += AWBBotModeCheckboxEnabledChangedHandler;
			_with2.CheckedChanged += AWBBotModeCheckboxCheckedChangeHandler;
            AWBForm.StatusStrip.Items.Insert(2, StatusText);
			StatusText.Margin = new Padding(50, 0, 50, 0);
			StatusText.BorderSides = ToolStripStatusLabelBorderSides.Left | ToolStripStatusLabelBorderSides.Right;
			StatusText.BorderStyle = Border3DStyle.Etched;
            AWBForm.HelpToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]{
				new ToolStripSeparator(),
				PluginSettings.MenuHelp,
				PluginSettings.MenuAbout
			});

			// UI - addhandlers for Start/Stop/Diff/Preview/Save/Ignore buttons/form closing:
			AWBForm.Form.FormClosing += AWBClosingEventHandler;

			// Handle over events from AWB:
			AWBForm.StopButton.Click += StopButtonClickEventHandler;
			AWBForm.TheSession.StateChanged += EditorStatusChanged;
			AWBForm.TheSession.Aborted += EditorAborted;

			// Track Manual Assessment checkbox:
			PluginSettings.ManuallyAssessCheckBox.CheckedChanged += ManuallyAssessCheckBox_CheckChanged;

			// Tabs:
			KingbotkPluginTab.UseVisualStyleBackColor = true;
			KingbotkPluginTab.Controls.Add(PluginSettings);

			// Show/hide tabs menu:
            MenuShowSettingsTabs.CheckOnClick = true;
            MenuShowSettingsTabs.Checked = true;
		    MenuShowSettingsTabs.Click += MenuShowHide_Click;
			AWBForm.ToolStripMenuGeneral.DropDownItems.Add(MenuShowSettingsTabs);

			// Add-Generic-Template menu:
		    AddGenericTemplateMenuItem.Click += AddGenericTemplateMenuItem_Click;
			AWBForm.PluginsToolStripMenuItem.DropDownItems.Add(AddGenericTemplateMenuItem);

			// Create plugins:
			Plugins.Add("Albums", new WPAlbums());
			Plugins.Add("Australia", new WPAustralia());
			Plugins.Add("India", new WPIndia());
			Plugins.Add("MilHist", new WPMilitaryHistory());
			Plugins.Add("Songs", new WPSongs());
			Plugins.Add("WPNovels", new WPNovels());
			Plugins.Add("Biography", new WPBiography());
			// hopefully if add WPBio last it will ensure that the template gets added to the *top* of pages

			// Initialise plugins:
			foreach (KeyValuePair<string, PluginBase> plugin in Plugins) {
				plugin.Value.Initialise();
			}

			// Add our menu items last:
			AWBForm.PluginsToolStripMenuItem.DropDownItems.Add(PluginSettings.PluginToolStripMenuItem);

			// Reset statusbar text:
			DefaultStatusText();
		}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:69,代码来源:PluginManager.cs


示例16: InitialisePlugin

 /// <summary>
 /// Passes a reference of the main form to the plugin for initialisation
 /// </summary>
 /// <param name="plugin">IAWBPlugin to initialise</param>
 /// <param name="awb">IAutoWikiBrowser instance of AWB</param>
 private static void InitialisePlugin(IAWBPlugin plugin, IAutoWikiBrowser awb)
 {
     plugin.Initialise(awb);
 }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:9,代码来源:PluginManager.cs


示例17: LoadPluginsStartup

            /// <summary>
            /// Loads the plugin at startup, and updates the splash screen
            /// </summary>
            /// <param name="awb">IAutoWikiBrowser instance of AWB</param>
            /// <param name="splash">Splash Screen instance</param>
            internal static void LoadPluginsStartup(IAutoWikiBrowser awb, Splash splash)
            {
                splash.SetProgress(75);
                string path = Application.StartupPath;
                string[] pluginFiles = Directory.GetFiles(path, "*.DLL");

                LoadPlugins(awb, pluginFiles, false);
                splash.SetProgress(89);
            }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:14,代码来源:PluginManager.cs


示例18: ProcessArticle

        public string ProcessArticle(IAutoWikiBrowser sender, ProcessArticleEventArgs eventargs)
        {
            if (!Enabled) return eventargs.ArticleText;

            string ArticleText = eventargs.ArticleText;
            RefNames.Clear();

            ArticleText = r4.Replace(ArticleText, R4Evaluator);
            ArticleText = r1.Replace(ArticleText, "");
            ArticleText = r2.Replace(ArticleText, "");
            ArticleText = r3.Replace(ArticleText, "");

            if (RefNames.Count > 0)
                foreach (string name in RefNames)
                {
                    ArticleText = Regex.Replace(ArticleText, @"< ?ref\b[^>]*?name ?= ?""?" + name + "[\" ]? ?/ ?>", "");
                }

            if (ArticleText == eventargs.ArticleText)
            {
                eventargs.Skip = Skip;
            }
            else
            {
                if (RemoveEmptiedSections && (Variables.LangCode == LangCodeEnum.en ||
                    Variables.LangCode == LangCodeEnum.de || Variables.LangCode == LangCodeEnum.ru))
                    ArticleText = RemoveSection(ArticleText);
            }

            return ArticleText;
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:31,代码来源:DelinkerCore.cs


示例19: ProcessArticle

        public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs)
        {
            //If menu item is not checked, then return
            if (!PluginEnabled || Settings.Images.Count == 0)
            {
                eventargs.Skip = false;
                return eventargs.ArticleText;
            }

            string text = eventargs.ArticleText;

            string removed = "", replaced = "";

            foreach (KeyValuePair<string, string> p in Settings.Images)
            {
                bool noChange;

                if (p.Value.Length == 0)
                {
                    text = Parsers.RemoveImage(p.Key, text, Settings.Comment, "", out noChange);
                    if (!noChange)
                    {
                        if (!string.IsNullOrEmpty(removed))
                        {
                            removed += ", ";
                        }

                        removed += Variables.Namespaces[Namespace.File] + p.Key;
                    }
                }
                else
                {
                    text = Parsers.ReplaceImage(p.Key, p.Value, text, out noChange);
                    if (!noChange)
                    {
                        if (!string.IsNullOrEmpty(replaced))
                        {
                            replaced += ", ";
                        }

                        replaced += Variables.Namespaces[Namespace.File]
                         + p.Key + FindandReplace.Arrow + Variables.Namespaces[Namespace.File] + p.Value;
                    }
                }
                if (!noChange)
                {
                    text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", "");
                }
            }

            string editSummary = "";
            if (Settings.AppendToEditSummary)
            {
                if (!string.IsNullOrEmpty(replaced))
                    editSummary = "replaced: " + replaced.Trim();

                if (!string.IsNullOrEmpty(removed))
                {
                    if (!string.IsNullOrEmpty(editSummary))
                        editSummary += ", ";

                    editSummary += "removed: " + removed.Trim();
                }
            }
            eventargs.EditSummary = editSummary;
            eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip;

            return text;
        }
开发者ID:svick,项目名称:AWB,代码行数:69,代码来源:IfdCore.cs


示例20: LoadPlugins

            /// <summary>
            /// Loads all the plugins from the directory where AWB resides
            /// </summary>
            /// <param name="awb">IAutoWikiBrowser instance of AWB</param>
            /// <param name="Plugins">Array of Plugin Names</param>
            /// <param name="afterStartup">Whether the plugin(s) are being loaded post-startup</param>
            internal static void LoadPlugins(IAutoWikiBrowser awb, string[] Plugins, bool afterStartup)
            {
                try
                {
                    foreach (string Plugin in Plugins)
                    {
                        if (Plugin.EndsWith("DotNetWikiBot.dll") || Plugin.EndsWith("Diff.dll")
                            || Plugin.EndsWith("WikiFunctions.dll"))
                            continue;

                        Assembly asm = null;
                        try
                        {
                            asm = Assembly.LoadFile(Plugin);
                        }
                        catch { }

                        if (asm != null)
                        {
                            try
                            {
                                foreach (Type t in asm.GetTypes())
                                {
                                    if (t.GetInterface("IAWBPlugin") != null)
                                    {
                                        IAWBPlugin plugin = (IAWBPlugin)Activator.CreateInstance(t);
                                        InitialisePlugin(plugin, awb);
                                        Items.Add(plugin.Name, plugin);

                                        if (afterStartup) UsageStats.AddedPlugin(plugin);
                                    }
                                    else if (t.GetInterface("IListMakerPlugin") != null)
                                    {
                                        IListMakerPlugin plugin = (IListMakerPlugin)Activator.CreateInstance(t);
                                        WikiFunctions.Controls.Lists.ListMaker.AddProvider(plugin);

                                        if (afterStartup) UsageStats.AddedPlugin(plugin);
                                    }
                                }
                            }
                            catch (MissingFieldException) { PluginObsolete(Plugin); }
                            catch (MissingMemberException) { PluginObsolete(Plugin); }
                            catch (Exception ex) { ErrorHandler.Handle(ex); }
                        }
                    }
                }
                catch (Exception ex)
                {
#if debug
                    ErrorHandler.Handle(ex);
#else
                    MessageBox.Show(ex.Message, "Problem loading plugins");
#endif
                }

            }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:62,代码来源:PluginManager.cs



注:本文中的IAutoWikiBrowser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IAvatarService类代码示例发布时间:2022-05-24
下一篇:
C# IAuthorizationState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap