示例#1
0
        public IExecutionHandler GetDefaultExecutionHandler(ExecutionCommand command)
        {
            if (executionHandlers == null)
            {
                executionHandlers = new List <ExtensionNode> ();
                AddinManager.AddExtensionNodeHandler("/MonoDevelop/Core/ExecutionHandlers", OnExtensionChange);
            }

            foreach (TypeExtensionNode codon in executionHandlers)
            {
                IExecutionHandler handler = (IExecutionHandler)codon.GetInstance(typeof(IExecutionHandler));
                if (handler.CanExecute(command))
                {
                    return(handler);
                }
            }
            return(null);
        }
示例#2
0
 static DebuggingService()
 {
     executionHandlerFactory           = new DebugExecutionHandlerFactory();
     TextFileService.LineCountChanged += OnLineCountChanged;
     IdeApp.Initialized += delegate {
         IdeApp.Workspace.StoringUserPreferences  += OnStoreUserPrefs;
         IdeApp.Workspace.LoadingUserPreferences  += OnLoadUserPrefs;
         IdeApp.Workspace.LastWorkspaceItemClosed += OnSolutionClosed;
         busyDialog = new BusyEvaluatorDialog();
     };
     AddinManager.AddExtensionNodeHandler(FactoriesPath, delegate {
         // Regresh the engine list
         engines = null;
     });
     AddinManager.AddExtensionNodeHandler(EvaluatorsPath, delegate {
         // Regresh the engine list
         evaluators = null;
     });
 }
        public static FileTemplateCondition CreateCondition(XmlElement element)
        {
            if (conditions == null)
            {
                conditions = new List <FileTemplateConditionTypeCodon> ();
                AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/FileTemplateConditionTypes", OnExtensionChanged);
            }

            foreach (FileTemplateConditionTypeCodon condition in conditions)
            {
                if (condition.ElementName == element.Name)
                {
                    FileTemplateCondition t = (FileTemplateCondition)condition.CreateInstance(typeof(FileTemplateCondition));
                    t.Load(element);
                    return(t);
                }
            }
            throw new InvalidOperationException("Unknown file template condition type: " + element.Name);
        }
        static PolicyService()
        {
            AddinManager.AddExtensionNodeHandler(TYPE_EXT_POINT, HandlePolicyTypeUpdated);
            AddinManager.AddExtensionNodeHandler(SET_EXT_POINT, HandlePolicySetUpdated);
            MonoDevelop.Core.Runtime.ShuttingDown += delegate {
                SaveDefaultPolicies();
            };
            LoadDefaultPolicies();
            defaultPolicyBag.ReadOnly = true;

            PolicySet pset = GetPolicySet("Invariant");

            pset.PolicyChanged += HandleInvariantPolicySetChanged;
            foreach (var pol in pset.Policies)
            {
                invariantPolicies.InternalSet(pol.Key.PolicyType, pol.Key.Scope, pol.Value);
            }
            invariantPolicies.ReadOnly = true;
        }
示例#5
0
        public static FileDescriptionTemplate CreateTemplate(XmlElement element, FilePath baseDirectory)
        {
            if (templates == null)
            {
                templates = new List <FileTemplateTypeCodon> ();
                AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/FileTemplateTypes", OnExtensionChanged);
            }

            foreach (FileTemplateTypeCodon template in templates)
            {
                if (template.ElementName == element.Name)
                {
                    FileDescriptionTemplate t = (FileDescriptionTemplate)template.CreateInstance(typeof(FileDescriptionTemplate));
                    t.Load(element, baseDirectory);
                    return(t);
                }
            }
            throw new InvalidOperationException("Unknown file template type: " + element.Name);
        }
示例#6
0
        public MainWindow()
        {
            // Build our window
            CreateWindow();

            // Initialize interface things
            window_shell.AddAccelGroup(PintaCore.Actions.AccelGroup);
            dialog_handlers = new ActionHandlers();

            PintaCore.Chrome.InitializeProgessDialog(new ProgressDialog());
            PintaCore.Initialize();

            // Initialize extensions
            AddinManager.Initialize();
            AddinManager.Registry.Update();

            //Look out for any changes in extensions
            AddinManager.AddExtensionNodeHandler(typeof(IExtension), OnExtensionChanged);

            // Try to set the default tool to the PaintBrush
            PintaCore.Tools.SetCurrentTool(Catalog.GetString("Paintbrush"));

            // Load the user's previous settings
            LoadUserSettings();

            // Give the canvas focus
            PintaCore.Chrome.Canvas.GrabFocus();

            // We support drag and drop for URIs
            window_shell.AddDragDropSupport(new Gtk.TargetEntry("text/uri-list", 0, 100));

            // Handle a few main window specific actions
            PintaCore.Actions.File.BeforeQuit += delegate { SaveUserSettings(); };

            window_shell.DeleteEvent      += MainWindow_DeleteEvent;
            window_shell.DragDataReceived += MainWindow_DragDataReceived;

            // TODO: These need to be [re]moved when we redo zoom support
            PintaCore.Actions.View.ZoomToWindow.Activated    += new EventHandler(ZoomToWindow_Activated);
            PintaCore.Actions.View.ZoomToSelection.Activated += new EventHandler(ZoomToSelection_Activated);
            PintaCore.Workspace.ActiveDocumentChanged        += ActiveDocumentChanged;
        }
        public VisualizationDisplayWidget()
        {
            Stetic.BinContainer.Attach(this);

            BuildHeaderExtension();

            this.visualizationList.Model = this.visualizationStore;

            CellRendererText text = new CellRendererText();

            this.visualizationList.PackStart(text, true);
            this.visualizationList.SetCellDataFunc(text, VisualizationCellDataFunc);

            this.glWidget = new GLWidget();
            this.glWidget.DoubleBuffered = true;
            this.glWidget.Render        += this.OnRender;
            this.glWidget.SizeAllocated += this.OnGlSizeAllocated;
            this.glWidget.Show();

            this.Add(this.glWidget);
            this.Show();

            this.playerData        = new BansheePlayerData(ServiceManager.PlayerEngine.ActiveEngine);
            this.playerData.Active = false;

            this.glWidget.Realized += delegate {
                if (!this.loopRunning)
                {
                    this.loopRunning  = true;
                    this.RenderThread = new Thread(this.RenderLoop);
                    this.RenderThread.Start();
                }

                this.ConnectVisualization();
            };

            this.glWidget.Unrealized += delegate {
                this.DisposeRenderer();
            };

            AddinManager.AddExtensionNodeHandler("/Banshee/OpenVP/Visualization", this.OnVisualizationChanged);
        }
        static SyntaxHighlightingService()
        {
            languageBundles.Add(userThemeBundle);
            languageBundles.Add(extensionBundle);
            languageBundles.Add(builtInBundle);

            LoadStylesAndModes(typeof(SyntaxHighlightingService).Assembly);
            var textEditorAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name.StartsWith("MonoDevelop.SourceEditor", StringComparison.Ordinal));

            if (textEditorAssembly != null)
            {
                LoadStylesAndModes(textEditorAssembly);
            }
            else
            {
                LoggingService.LogError("Can't lookup Mono.TextEditor assembly. Default styles won't be loaded.");
            }

            bool success = true;

            if (!Directory.Exists(LanguageBundlePath))
            {
                try {
                    Directory.CreateDirectory(LanguageBundlePath);
                } catch (Exception e) {
                    success = false;
                    LoggingService.LogError("Can't create syntax mode directory", e);
                }
            }
            if (success)
            {
                foreach (string file in Directory.GetFiles(LanguageBundlePath))
                {
                    if (file.EndsWith(".sublime-package", StringComparison.OrdinalIgnoreCase) || file.EndsWith(".tmbundle", StringComparison.OrdinalIgnoreCase))
                    {
                        LoadStyleOrMode(userThemeBundle, file);
                    }
                }
            }
            PrepareMatches();
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/Editor/Bundles", OnSyntaxModeExtensionChanged);
        }
示例#9
0
        public void DelayedInitialize()
        {
            lock (sync) {
                if (initialized || ServiceManager.HardwareManager == null)
                {
                    return;
                }

                sources             = new Dictionary <string, DapSource> ();
                supported_dap_types = new List <TypeExtensionNode> ();

                AddinManager.AddExtensionNodeHandler("/Banshee/Dap/DeviceClass", OnExtensionChanged);

                ServiceManager.HardwareManager.DeviceAdded   += OnHardwareDeviceAdded;
                ServiceManager.HardwareManager.DeviceRemoved += OnHardwareDeviceRemoved;
                ServiceManager.HardwareManager.DeviceCommand += OnDeviceCommand;
                ServiceManager.SourceManager.SourceRemoved   += OnSourceRemoved;
                initialized = true;
            }
        }
示例#10
0
 static CodeTemplateService()
 {
     try {
         Templates = LoadTemplates();
         AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/CodeTemplates", delegate(object sender, ExtensionNodeEventArgs args) {
             var codon = (CodeTemplateCodon)args.ExtensionNode;
             switch (args.Change)
             {
             case ExtensionChange.Add:
                 using (XmlReader reader = codon.Open()) {
                     LoadTemplates(reader).ForEach(t => templates.Add(t));
                 }
                 break;
             }
         });
     }  catch(Exception e)
     {
         LoggingService.LogError("CodeTemplateService: Exception while loading templates.", e);
     }
 }
        static SyntaxModeService()
        {
//			Console.WriteLine ("SETUP SMS");
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/SourceEditor2/CustomModes", delegate(object sender, ExtensionNodeEventArgs args)
            {
                SyntaxModeCodon syntaxModeCodon = (SyntaxModeCodon)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
//					Console.WriteLine ("INstall:" + syntaxModeCodon.MimeTypes);
                    Mono.TextEditor.Highlighting.SyntaxModeService.InstallSyntaxMode(syntaxModeCodon.MimeTypes, new SyntaxModeProvider(d =>
                    {
                        var result      = syntaxModeCodon.SyntaxMode;
                        result.Document = d;
                        return(result);
                    }));
                    break;
                }
            });
        }
示例#12
0
        static AmbienceService()
        {
            // may not have been initialized in testing environment.
            if (AddinManager.IsInitialized)
            {
                AddinManager.AddExtensionNodeHandler("/MonoDevelop/TypeSystem/Ambiences", delegate(object sender, ExtensionNodeEventArgs args) {
                    var ambience = args.ExtensionNode as MimeTypeExtensionNode;
                    switch (args.Change)
                    {
                    case ExtensionChange.Add:
                        ambiences[ambience.MimeType] = (Ambience)ambience.CreateInstance();
                        break;

                    case ExtensionChange.Remove:
                        ambiences.Remove(ambience.MimeType);
                        break;
                    }
                });
            }
        }
示例#13
0
        static Ambience()
        {
            // may not have been initialized in testing environment.
            if (AddinManager.IsInitialized)
            {
                AddinManager.AddExtensionNodeHandler("/MonoDevelop/TypeSystem/AmbienceTooltipProviders", delegate(object sender, ExtensionNodeEventArgs args) {
                    var node = args.ExtensionNode as MimeTypeExtensionNode;
                    switch (args.Change)
                    {
                    case ExtensionChange.Add:
                        tooltipProviders.Add((AmbienceTooltipProvider)node.CreateInstance());
                        break;

                    case ExtensionChange.Remove:
                        tooltipProviders.Remove((AmbienceTooltipProvider)node.CreateInstance());
                        break;
                    }
                });
            }
        }
        static RefactoringService()
        {
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Refactoring/Refactorings", delegate(object sender, ExtensionNodeEventArgs args) {
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    refactorings.Add((RefactoringOperation)args.ExtensionObject);
                    break;

                case ExtensionChange.Remove:
                    refactorings.Remove((RefactoringOperation)args.ExtensionObject);
                    break;
                }
            });

            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Refactoring/ASTProvider", delegate(object sender, ExtensionNodeEventArgs args) {
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    astProviders.Add((INRefactoryASTProvider)args.ExtensionObject);
                    break;

                case ExtensionChange.Remove:
                    astProviders.Remove((INRefactoryASTProvider)args.ExtensionObject);
                    break;
                }
            });

            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Refactoring/CodeGenerators", delegate(object sender, ExtensionNodeEventArgs args) {
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    codeGenerators.Add((ICodeGenerator)args.ExtensionObject);
                    break;

                case ExtensionChange.Remove:
                    codeGenerators.Remove((ICodeGenerator)args.ExtensionObject);
                    break;
                }
            });
        }
示例#15
0
        static ImageService()
        {
            iconFactory.AddDefault();
            IconId.IconNameRequestHandler = delegate(string stockId) {
                EnsureStockIconIsLoaded(stockId);
            };

            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Core/StockIcons", delegate(object sender, ExtensionNodeEventArgs args) {
                StockIconCodon iconCodon = (StockIconCodon)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    if (!iconStock.ContainsKey(iconCodon.StockId))
                    {
                        iconStock[iconCodon.StockId] = new List <StockIconCodon> ();
                    }
                    iconStock[iconCodon.StockId].Add(iconCodon);
                    if (iconCodon.Addin == AddinManager.CurrentAddin)
                    {
                        EnsureStockIconIsLoaded(iconCodon.StockId);
                    }
                    break;
                }
            });

            for (int i = 0; i < iconSizes.Length; i++)
            {
                int w, h;
                if (!Gtk.Icon.SizeLookup((Gtk.IconSize)i, out w, out h))
                {
                    w = h = -1;
                }
                iconSizes[i].Width  = w;
                iconSizes[i].Height = h;
            }
            if (Platform.IsWindows)
            {
                iconSizes[(int)Gtk.IconSize.Menu].Width  = 16;
                iconSizes[(int)Gtk.IconSize.Menu].Height = 16;
            }
        }
示例#16
0
        static CodeAnalysis()
        {
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Refactoring/Inspectors", delegate(object sender, ExtensionNodeEventArgs args) {
                InspectorAddinNode node = (InspectorAddinNode)args.ExtensionNode;
                if (node.MimeType != "text/x-csharp")
                {
                    return;
                }
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    inspectorNodes.Add(node);
                    ((CSharpInspector)node.Inspector).Attach(node, visitor);
                    break;
                }
            });

            NamingInspector inspector = new NamingInspector();

            inspector.Attach(null, visitor);
        }
示例#17
0
        public void InitializeAsync()
        {
            // Populate the initial actions.
            ReloadActions(universe);

            // Hook up ItemSource notifications
            AddinManager.AddExtensionNodeHandler("/Do/ItemSource", OnPluginChanged);
            AddinManager.AddExtensionNodeHandler("/Do/DynamicItemSource", OnPluginChanged);

            // Notify subscribers that the universe has been loaded.
            Services.Application.RunOnMainThread(() => {
                BuildCompleted = true;
                if (initialized != null)
                {
                    initialized(this, EventArgs.Empty);
                }
            });

            // Start the update thread.
            update_thread.Start();
        }
示例#18
0
 static DebuggingService()
 {
     executionHandlerFactory             = new DebugExecutionHandlerFactory();
     TextEditorService.LineCountChanged += OnLineCountChanged;
     IdeApp.Initialized += delegate {
         IdeApp.Workspace.StoringUserPreferences  += OnStoreUserPrefs;
         IdeApp.Workspace.LoadingUserPreferences  += OnLoadUserPrefs;
         IdeApp.Workspace.LastWorkspaceItemClosed += OnSolutionClosed;
         busyDialog = new BusyEvaluatorDialog();
         busyDialog.TransientFor      = MessageService.RootWindow;
         busyDialog.DestroyWithParent = true;
     };
     AddinManager.AddExtensionNodeHandler(FactoriesPath, delegate {
         // Refresh the engines list
         engines = null;
     });
     AddinManager.AddExtensionNodeHandler(EvaluatorsPath, delegate {
         // Refresh the evaluators list
         evaluators = null;
     });
 }
        static CustomToolService()
        {
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/CustomTools", delegate(object sender, ExtensionNodeEventArgs args)
            {
                var node = (CustomToolExtensionNode)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    if (nodes.ContainsKey(node.Name))
                    {
                        LoggingService.LogError("Duplicate custom tool name '{0}'", node.Name);
                    }
                    else
                    {
                        nodes.Add(node.Name, node);
                    }
                    break;

                case ExtensionChange.Remove:
                    nodes.Remove(node.Name);
                    break;
                }
            });
            IdeApp.Workspace.FileChangedInProject += delegate(object sender, ProjectFileEventArgs args)
            {
                foreach (ProjectFileEventInfo e in args)
                {
                    Update(e.ProjectFile, false);
                }
            };
            IdeApp.Workspace.FilePropertyChangedInProject += delegate(object sender, ProjectFileEventArgs args)
            {
                foreach (ProjectFileEventInfo e in args)
                {
                    Update(e.ProjectFile, false);
                }
            };
            //FIXME: handle the rename
            //MonoDevelop.Ide.Gui.IdeApp.Workspace.FileRenamedInProject
        }
示例#20
0
        public MainWindow(string[] args) : base(Gtk.WindowType.Toplevel)
        {
            this.DeleteEvent += delegate {
                OnQuitActivated(this, EventArgs.Empty);
            };

            this.Build();

            notebook.Remove(notebook.GetNthPage(0));

            visualizers      = new Dictionary <MenuItem, IVisualizer> ();
            popup_assemblies = new Menu();
            popup_types      = new Menu();
            popup_methods    = new Menu();

            AddinManager.AddinLoadError += OnLoadError;

            AddinManager.Initialize(".");
            AddinManager.Registry.Update(null);
            AddinManager.AddExtensionNodeHandler("/Monoxide/Assembly", OnAssemblyExtensionChanged);
            AddinManager.AddExtensionNodeHandler("/Monoxide/Type", OnTypeExtensionChanged);
            AddinManager.AddExtensionNodeHandler("/Monoxide/Method", OnMethodExtensionChanged);

            popup_assemblies.ShowAll();
            popup_types.ShowAll();
            popup_methods.ShowAll();

            tree_store = new TreeStore(typeof(string), typeof(object));

            treeview.Model        = tree_store;
            treeview.EnableSearch = false;
            treeview.AppendColumn("Object", new CellRendererText(), "text", 0);
            treeview.Selection.Changed += OnSelectionChanged;
            OnSelectionChanged(null, EventArgs.Empty);

            if (args.Length > 0)
            {
                Load(args);
            }
        }
        static VersionControlService()
        {
            IdeApp.Initialized += delegate {
                try {
                    overlay_modified    = Xwt.Drawing.Image.FromResource("modified-overlay-16.png");
                    overlay_removed     = Xwt.Drawing.Image.FromResource("removed-overlay-16.png");
                    overlay_renamed     = Xwt.Drawing.Image.FromResource("renamed-overlay-16.png");
                    overlay_conflicted  = Xwt.Drawing.Image.FromResource("conflict-overlay-16.png");
                    overlay_added       = Xwt.Drawing.Image.FromResource("added-overlay-16.png");
                    overlay_controled   = Xwt.Drawing.Image.FromResource("versioned-overlay-16.png");
                    overlay_unversioned = Xwt.Drawing.Image.FromResource("unversioned-overlay-16.png");
                    overlay_protected   = Xwt.Drawing.Image.FromResource("lock-required-overlay-16.png");
                    overlay_unlocked    = Xwt.Drawing.Image.FromResource("unlocked-overlay-16.png");
                    overlay_locked      = Xwt.Drawing.Image.FromResource("locked-overlay-16.png");
                    overlay_ignored     = Xwt.Drawing.Image.FromResource("ignored-overlay-16.png");

                    icon_modified   = ImageService.GetIcon("vc-file-modified", Gtk.IconSize.Menu);
                    icon_removed    = ImageService.GetIcon("vc-file-removed", Gtk.IconSize.Menu);
                    icon_conflicted = ImageService.GetIcon("vc-file-conflicted", Gtk.IconSize.Menu);
                    icon_added      = ImageService.GetIcon("vc-file-added", Gtk.IconSize.Menu);
                    icon_controled  = Xwt.Drawing.Image.FromResource("versioned-overlay-16.png");
                } catch (Exception e) {
                    LoggingService.LogError("Error while loading icons.", e);
                }

                IdeApp.Workspace.SolutionLoaded += (sender, e) => SessionSolutionDisabled |= IsSolutionDisabled(e.Solution);

                IdeApp.Workspace.FileAddedToProject += OnFileAdded;
                //IdeApp.Workspace.FileChangedInProject += OnFileChanged;
                //IdeApp.Workspace.FileRemovedFromProject += OnFileRemoved;
                //IdeApp.Workspace.FileRenamedInProject += OnFileRenamed;

                IdeApp.Workspace.ItemAddedToSolution += OnEntryAdded;
                IdeApp.Exiting += delegate {
                    DelayedSaveComments(null);
                };
            };

            AddinManager.AddExtensionNodeHandler("/MonoDevelop/VersionControl/VersionControlSystems", OnExtensionChanged);
        }
示例#22
0
        static FontService()
        {
            fontProperties = PropertyService.Get("FontProperties", new Properties());

            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/Fonts", delegate(object sender, ExtensionNodeEventArgs args) {
                var codon = (FontDescriptionCodon)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    fontDescriptions.Add(codon);
                    break;

                case ExtensionChange.Remove:
                    fontDescriptions.Remove(codon);
                    if (loadedFonts.ContainsKey(codon.Name))
                    {
                        loadedFonts.Remove(codon.Name);
                    }
                    break;
                }
            });
        }
        static VersionControlService()
        {
            IdeApp.Initialized += delegate {
                try {
                    overlay_modified    = Gdk.Pixbuf.LoadFromResource("overlay_modified.png");
                    overlay_removed     = Gdk.Pixbuf.LoadFromResource("overlay_removed.png");
                    overlay_conflicted  = Gdk.Pixbuf.LoadFromResource("overlay_conflicted.png");
                    overlay_added       = Gdk.Pixbuf.LoadFromResource("overlay_added.png");
                    overlay_controled   = Gdk.Pixbuf.LoadFromResource("overlay_controled.png");
                    overlay_unversioned = Gdk.Pixbuf.LoadFromResource("overlay_unversioned.png");
                    overlay_protected   = Gdk.Pixbuf.LoadFromResource("overlay_lock_required.png");
                    overlay_unlocked    = Gdk.Pixbuf.LoadFromResource("overlay_unlocked.png");
                    overlay_locked      = Gdk.Pixbuf.LoadFromResource("overlay_locked.png");
                    //			overlay_normal = Gdk.Pixbuf.LoadFromResource("overlay_normal.png");

                    icon_modified   = ImageService.GetPixbuf("gtk-edit", Gtk.IconSize.Menu);
                    icon_removed    = ImageService.GetPixbuf(Gtk.Stock.Remove, Gtk.IconSize.Menu);
                    icon_conflicted = ImageService.GetPixbuf(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
                    icon_added      = ImageService.GetPixbuf(Gtk.Stock.Add, Gtk.IconSize.Menu);
                    icon_controled  = Gdk.Pixbuf.LoadFromResource("overlay_controled.png");
                } catch (Exception e) {
                    LoggingService.LogError("Error while loading icons.", e);
                }

                IdeApp.Workspace.SolutionLoaded += (sender, e) => SessionSolutionDisabled |= IsSolutionDisabled(e.Solution);

                IdeApp.Workspace.FileAddedToProject += OnFileAdded;
                //IdeApp.Workspace.FileChangedInProject += OnFileChanged;
                //IdeApp.Workspace.FileRemovedFromProject += OnFileRemoved;
                //IdeApp.Workspace.FileRenamedInProject += OnFileRenamed;

                IdeApp.Workspace.ItemAddedToSolution += OnEntryAdded;
                IdeApp.Exiting += delegate {
                    DelayedSaveComments(null);
                };
            };

            AddinManager.AddExtensionNodeHandler("/MonoDevelop/VersionControl/VersionControlSystems", OnExtensionChanged);
        }
示例#24
0
        static ImageService()
        {
            iconFactory.AddDefault();

            AddinManager.AddExtensionNodeHandler(IconsExtensionPath, delegate(object sender, ExtensionNodeEventArgs args) {
                StockIconCodon iconCodon = (StockIconCodon)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    if (!iconStock.ContainsKey(iconCodon.StockId))
                    {
                        iconStock [iconCodon.StockId] = new List <StockIconCodon> ();

                        foreach (var imageId in iconCodon.GetImageIds())
                        {
                            imageIdToStockId[imageId] = iconCodon.StockId;
                        }
                    }
                    iconStock[iconCodon.StockId].Add(iconCodon);
                    break;
                }
            });

            for (int i = 0; i < iconSizes.Length; i++)
            {
                int w, h;
                if (!Gtk.Icon.SizeLookup((Gtk.IconSize)i, out w, out h))
                {
                    w = h = -1;
                }
                iconSizes[i].Width  = w;
                iconSizes[i].Height = h;
            }
            if (Platform.IsWindows)
            {
                iconSizes[(int)Gtk.IconSize.Menu].Width  = 16;
                iconSizes[(int)Gtk.IconSize.Menu].Height = 16;
            }
        }
示例#25
0
        static BraceMatcherTextEditorExtension()
        {
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/BraceMatcher", delegate(object sender, ExtensionNodeEventArgs args) {
                var node = (MimeTypeExtensionNode)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    var matcher      = (AbstractBraceMatcher)node.CreateInstance();
                    matcher.MimeType = node.MimeType;
                    braceMatcher.Add(matcher);
                    break;

                case ExtensionChange.Remove:
                    var toRemove = braceMatcher.FirstOrDefault(m => m.MimeType == node.MimeType);
                    if (toRemove != null)
                    {
                        braceMatcher.Remove(toRemove);
                    }
                    break;
                }
            });
            braceMatcher.Add(new DefaultBraceMatcher());
        }
示例#26
0
            static MimeTypeNodes()
            {
                if (AddinManager.IsInitialized)
                {
                    AddinManager.AddExtensionNodeHandler("/MonoDevelop/Core/MimeTypes", delegate(object sender, ExtensionNodeEventArgs args) {
                        var newList      = new List <MimeTypeNode> (mimeTypeNodes);
                        var mimeTypeNode = (MimeTypeNode)args.ExtensionNode;
                        switch (args.Change)
                        {
                        case ExtensionChange.Add:
                            // initialize child nodes.
                            mimeTypeNode.ChildNodes.GetEnumerator();
                            newList.Add(mimeTypeNode);
                            break;

                        case ExtensionChange.Remove:
                            newList.Remove(mimeTypeNode);
                            break;
                        }
                        mimeTypeNodes = newList;
                    });
                }
            }
示例#27
0
        public CSPluginManager()
        {
            _csPlugins      = new Dictionary <string, ICSPlugin>();
            Commands        = new List <Tuple <string, string, string, bool> >();
            ConsoleCommands = new Dictionary <string, string>();

            AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolved;

            if (!AddinManager.IsInitialized)
            {
                AddinManager.Initialize(".", "./addins");
                AddinManager.AddExtensionNodeHandler(typeof(ICSPlugin), OnExtensionChanged);
            }

            setupService = new SetupService(AddinManager.Registry);

            if (!setupService.Repositories.ContainsRepository(AddinRepoUrl))
            {
                setupService.Repositories.RegisterRepository(new ConsoleProgressStatus(false), AddinRepoUrl, false);
            }

            setupService.Repositories.UpdateAllRepositories(new ConsoleProgressStatus(false));
        }
        static void IntitializeTrackedProjectHandling()
        {
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/TypeSystem/OutputTracking", delegate(object sender, ExtensionNodeEventArgs args) {
                var node = (TypeSystemOutputTrackingNode)args.ExtensionNode;
                switch (args.Change)
                {
                case ExtensionChange.Add:
                    AddOutputTrackingNode(node);
                    break;

                case ExtensionChange.Remove:
                    outputTrackedProjects.Remove(node);
                    break;
                }
            });
            if (IdeApp.ProjectOperations != null)
            {
                IdeApp.ProjectOperations.EndBuild += HandleEndBuild;
            }
            if (IdeApp.Workspace != null)
            {
                IdeApp.Workspace.ActiveConfigurationChanged += HandleActiveConfigurationChanged;
            }
        }
示例#29
0
 static GettingStarted()
 {
     AddinManager.AddExtensionNodeHandler(GettingStartedProvidersExtensionPoint, new ExtensionNodeEventHandler(OnExtensionChanged));
 }
示例#30
0
 static AbstractUnitTestTextEditorExtension()
 {
     AddinManager.AddExtensionNodeHandler(TestMarkersPath, HandleExtensionNodeEventHandler);
 }