예제 #1
0
        public override void Init(PluginEnvironment env)
        {
            LoggingManager.SendMessage("RBFPlugin - Setup started");
            RBFSettings.Instance = this;

            // adding stuff to the menu
            ToolStripItem openRBFLib = new ToolStripMenuItem("Open RBF-Library") {Name = "openRBFLib"};
            openRBFLib.Click += OpenRBFLibClick;
            ToolStripItem options = new ToolStripMenuItem("Options") {Name = "options"};
            options.Click += OptionsClick;
            ToolStripItem search = new ToolStripMenuItem("RBF-Search") {Name = "RBFSearch"};
            search.Click += SearchClick;
            ToolStripItem openDictionaryCrawler = new ToolStripMenuItem("Open Dictionary Builder")
                                                      {Name = "dictCrawler"};
            openDictionaryCrawler.Click += OpenDictionaryCrawlerClick;
            ToolStripItem openLibraryCrawler = new ToolStripMenuItem("Open Library Builder") {Name = "libraryCrawler"};
            openLibraryCrawler.Click += OpenLibraryCrawlerClick;
            env.PluginSubMenu.Add(openRBFLib);
            env.PluginSubMenu.Add(openDictionaryCrawler);
            env.PluginSubMenu.Add(openLibraryCrawler);
            env.PluginSubMenu.Add(options);
            env.PluginSubMenu.Add(search);

            RBFLibrary.Init();
            RBFDictionary.Init();
            LoggingManager.SendMessage("RBFPlugin - Setup finished");
        }
예제 #2
0
        /// <exception cref="InvalidOperationException">Could not find embedded resource</exception>
        public override void Init(PluginEnvironment env)
        {
            LoggingManager.SendMessage("ScarEditorPlugin - Init started");

            IHighlightingDefinition luaHighlighting;
            using (Stream s = typeof(ScarEditorControl).Assembly.GetManifestResourceStream("ScarPlugin.LUAHighlighting.xshd"))
            {
                if (s == null)
                    throw new InvalidOperationException("Could not find embedded resource for LUA-syntax Highlighting");
                using (XmlReader xr = new XmlTextReader(s))
                {
                    luaHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.
                        HighlightingLoader.Load(xr, HighlightingManager.Instance);
                }
            }
            HighlightingManager.Instance.RegisterHighlighting("LUA Highlighting", new[] { ".scar", ".lua" }, luaHighlighting);

            LoggingManager.SendMessage("ScarEditorPlugin - Init finished");
        }