コード例 #1
0
		public void Init()
		{
			string addinXml = "<AddIn name     = 'Xml Editor'\r\n" +
       								"author      = ''\r\n" +
       								"copyright   = 'prj:///doc/copyright.txt'\r\n" +
       								"description = ''\r\n" +
       								"addInManagerHidden = 'preinstalled'>\r\n" +
								"</AddIn>";

			using (StringReader reader = new StringReader(addinXml)) {
				var addInTree = MockRepository.GenerateStrictMock<IAddInTree>();
				AddIn addin = AddIn.Load(addInTree, reader);
				
				AddInTreeNode addinTreeNode = new AddInTreeNode();

				Properties properties1 = new Properties();
				properties1.Set<string>("id", ".xml");
				properties1.Set<string>("namespaceUri", "http://example.com");
				
				Properties properties2 = new Properties();
				properties2.Set<string>("id", ".xsl");
				properties2.Set<string>("namespaceUri", "http://example.com/xsl");
				properties2.Set<string>("namespacePrefix", "xs");
				
				addinTreeNode.AddCodons(
					new Codon[] {
						new Codon(addin, "SchemaAssociation", properties1, new ICondition[0]),
						new Codon(addin, "SchemaAssociation", properties2, new ICondition[0])
					});
				
				schemaAssociations = new DefaultXmlSchemaFileAssociations(addinTreeNode);
			}
		}
        public void SetUp()
        {
            string addinXml = "<AddIn name     = 'Xml Editor'\r\n" +
                              "author      = ''\r\n" +
                              "copyright   = 'prj:///doc/copyright.txt'\r\n" +
                              "description = ''\r\n" +
                              "addInManagerHidden = 'preinstalled'>\r\n" +
                              "</AddIn>";

            using (StringReader reader = new StringReader(addinXml)) {
                var   addInTree = MockRepository.GenerateStrictMock <IAddInTree>();
                AddIn addin     = AddIn.Load(addInTree, reader);

                AddInTreeNode addinTreeNode = new AddInTreeNode();

                Properties properties = new Properties();
                properties.Set <string>("extensions", " .xml; .xsd ");
                properties.Set <string>("id", "Xml");

                addinTreeNode.AddCodons(
                    new Codon[] {
                    new Codon(addin, "CodeCompletionC#", new Properties(), new ICondition[0]),
                    new Codon(addin, "CodeCompletionXml", properties, new ICondition[0])
                });

                fileExtensions = new DefaultXmlFileExtensions(addinTreeNode);
            }
        }
コード例 #3
0
ファイル: IconService.cs プロジェクト: carlhuth/GenXSource
        static void InitializeIcons(AddInTreeNode treeNode)
        {
            extensionHashtable[".PRJX"] = "Icons.16x16.SolutionIcon";

            extensionHashtable[".CMBX"] = "Icons.16x16.CombineIcon";
            extensionHashtable[".SLN"]  = "Icons.16x16.CombineIcon";

            IconDescriptor[] icons = (IconDescriptor[])treeNode.BuildChildItems(null).ToArray(typeof(IconDescriptor));
            for (int i = 0; i < icons.Length; ++i)
            {
                IconDescriptor iconCodon = icons[i];
                string         imageName = iconCodon.Resource != null ? iconCodon.Resource : iconCodon.Id;

                if (iconCodon.Extensions != null)
                {
                    foreach (string ext in iconCodon.Extensions)
                    {
                        extensionHashtable[ext.ToUpperInvariant()] = imageName;
                    }
                }

                if (iconCodon.Language != null)
                {
                    projectFileHashtable[iconCodon.Language] = imageName;
                }
            }
        }
コード例 #4
0
        public void Init()
        {
            string addinXml = "<AddIn name     = 'Xml Editor'\r\n" +
                              "author      = ''\r\n" +
                              "copyright   = 'prj:///doc/copyright.txt'\r\n" +
                              "description = ''\r\n" +
                              "addInManagerHidden = 'preinstalled'>\r\n" +
                              "</AddIn>";

            using (StringReader reader = new StringReader(addinXml)) {
                AddIn addin = AddIn.Load(reader);

                AddInTreeNode addinTreeNode = new AddInTreeNode();

                Properties properties1 = new Properties();
                properties1.Set <string>("id", ".xml");
                properties1.Set <string>("namespaceUri", "http://example.com");

                Properties properties2 = new Properties();
                properties2.Set <string>("id", ".xsl");
                properties2.Set <string>("namespaceUri", "http://example.com/xsl");
                properties2.Set <string>("namespacePrefix", "xs");

                addinTreeNode.AddCodons(
                    new Codon[] {
                    new Codon(addin, "SchemaAssociation", properties1, new ICondition[0]),
                    new Codon(addin, "SchemaAssociation", properties2, new ICondition[0])
                });

                schemaAssociations = new DefaultXmlSchemaFileAssociations(addinTreeNode);
            }
        }
コード例 #5
0
        public void ListCodons(string path)
        {
            CodonLV.Items.Clear();
            if (path == null)
            {
                ExtTextBox.Text = "Extension : ";
                return;
            }

            ExtTextBox.Text = "Extension : " + path;

            AddInTreeNode node = AddInTree.GetTreeNode(path, false);

            if (node == null)
            {
                return;
            }
            foreach (Codon c in node.Codons)
            {
                ListViewItem lvi = new ListViewItem(c.Name);
                lvi.Tag = c;
                lvi.SubItems.Add(c.Id);

                lvi.SubItems.Add(c.Properties.Contains("class") ? c.Properties["class"] : "");

                foreach (ICondition condition in c.Conditions)
                {
                    lvi.SubItems.Add(condition.Name + ", " + condition.Action);
                }
                CodonLV.Items.Add(lvi);
            }
        }
コード例 #6
0
		DefaultXmlSchemaFileAssociations CreateDefaultXmlSchemaFileExtensions()
		{
			string addinXml = "<AddIn name     = 'Xml Editor'\r\n" +
       								"author      = ''\r\n" +
       								"copyright   = 'prj:///doc/copyright.txt'\r\n" +
       								"description = ''\r\n" +
       								"addInManagerHidden = 'preinstalled'>\r\n" +
								"</AddIn>";

			using (StringReader reader = new StringReader(addinXml)) {
				AddIn addin = AddIn.Load(reader);
				
				AddInTreeNode addinTreeNode = new AddInTreeNode();

				Properties properties = new Properties();
				properties.Set<string>("id", ".xml");
				properties.Set<string>("namespaceUri", "http://example.com");
				properties.Set<string>("namespacePrefix", "e");
				addinTreeNode.AddCodons(
					new Codon[] {
						new Codon(addin, "SchemaAssociation", properties, new ICondition[0])
					});
				
				return new DefaultXmlSchemaFileAssociations(addinTreeNode);
			}
		}
コード例 #7
0
		public void SetUp()
		{
			string addinXml = "<AddIn name     = 'Xml Editor'\r\n" +
       								"author      = ''\r\n" +
       								"copyright   = 'prj:///doc/copyright.txt'\r\n" +
       								"description = ''\r\n" +
       								"addInManagerHidden = 'preinstalled'>\r\n" +
								"</AddIn>";

			using (StringReader reader = new StringReader(addinXml)) {
				AddIn addin = AddIn.Load(reader);
				
				AddInTreeNode addinTreeNode = new AddInTreeNode();

				Properties properties = new Properties();
				properties.Set<string>("extensions", " .xml; .xsd ");
				properties.Set<string>("id", "Xml");
				
				addinTreeNode.AddCodons(
					new Codon[] {
						new Codon(addin, "CodeCompletionC#", new Properties(), new ICondition[0]),
						new Codon(addin, "CodeCompletionXml", properties, new ICondition[0])
					});
				
				fileExtensions = new DefaultXmlFileExtensions(addinTreeNode);
			}
		}
コード例 #8
0
        public static string BrowseForStylesheetFile()
        {
            using (OpenFileDialog dialog = new OpenFileDialog()) {
                dialog.AddExtension    = true;
                dialog.Multiselect     = false;
                dialog.CheckFileExists = true;
                dialog.Title           = ResourceService.GetString("ICSharpCode.XmlEditor.AssignXSLT.Title");

                AddInTreeNode node = AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter");
                if (node != null)
                {
                    string xmlFileFilter  = (string)node.BuildChildItem("Xml", null, null);
                    string allFilesFilter = (string)node.BuildChildItem("AllFiles", null, null);
                    string xslFileFilter  = (string)node.BuildChildItem("Xsl", null, null);

                    dialog.Filter      = String.Concat(xslFileFilter, "|", xmlFileFilter, "|", allFilesFilter);
                    dialog.FilterIndex = 1;
                }

                if (dialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK)
                {
                    return(dialog.FileName);
                }
            }

            return(null);
        }
コード例 #9
0
		public static bool? ShowTreeOptions(string dialogTitle, AddInTreeNode node)
		{
			TreeViewOptionsDialog o = new TreeViewOptionsDialog(node.BuildChildItems<IOptionPanelDescriptor>(null));
			o.Title = dialogTitle;
			o.Owner = WorkbenchSingleton.MainWindow;
			return o.ShowDialog();
		}
コード例 #10
0
        /// <summary>
        /// Returns a File Dialog filter that can be used to filter on all registered project formats
        /// </summary>
        public static string GetAllProjectsFilter(object caller)
        {
            AddInTreeNode addinTreeNode = AddInTree.GetTreeNode("/SharpDevelop/Workbench/Combine/FileFilter");
            StringBuilder b             = new StringBuilder(StringParser.Parse("${res:SharpDevelop.Solution.AllKnownProjectFormats}|"));
            bool          first         = true;

            foreach (Codon c in addinTreeNode.Codons)
            {
                string ext = c.Properties.Get("extensions", "");
                if (ext != "*.*" && ext.Length > 0)
                {
                    if (!first)
                    {
                        b.Append(';');
                    }
                    else
                    {
                        first = false;
                    }
                    b.Append(ext);
                }
            }
            foreach (string entry in addinTreeNode.BuildChildItems(caller))
            {
                b.Append('|');
                b.Append(entry);
            }
            return(b.ToString());
        }
コード例 #11
0
ファイル: IconService.cs プロジェクト: olesar/Altaxo
        private static void InitializeIcons(AddInTreeNode treeNode)
        {
            extensionHashtable[".PRJX"] = "Icons.16x16.SolutionIcon";

            extensionHashtable[".CMBX"] = "Icons.16x16.CombineIcon";
            extensionHashtable[".SLN"]  = "Icons.16x16.CombineIcon";

            foreach (IconDescriptor iconCodon in treeNode.BuildChildItems <IconDescriptor>(null))
            {
                string imageName = iconCodon.Resource != null ? iconCodon.Resource : iconCodon.Id;

                if (iconCodon.Extensions != null)
                {
                    foreach (string ext in iconCodon.Extensions)
                    {
                        extensionHashtable[ext.ToUpperInvariant()] = imageName;
                    }
                }

                if (iconCodon.Language != null)
                {
                    projectFileHashtable[iconCodon.Language] = imageName;
                }
            }
        }
        DefaultXmlSchemaFileAssociations CreateDefaultXmlSchemaFileExtensions()
        {
            string addinXml =
                "<AddIn name     = 'Xml Editor'\r\n" +
                "       author      = ''\r\n" +
                "       copyright   = 'prj:///doc/copyright.txt'\r\n" +
                "       description = ''\r\n" +
                "       addInManagerHidden = 'preinstalled'>\r\n" +
                "</AddIn>";

            using (StringReader reader = new StringReader(addinXml)) {
                var   addInTree = MockRepository.GenerateStrictMock <IAddInTree>();
                AddIn addin     = AddIn.Load(addInTree, reader);

                AddInTreeNode addinTreeNode = new AddInTreeNode();

                Properties properties = new Properties();
                properties.Set <string>("id", ".xml");
                properties.Set <string>("namespaceUri", "http://example.com");
                properties.Set <string>("namespacePrefix", "e");
                addinTreeNode.AddCodons(
                    new Codon[] {
                    new Codon(addin, "SchemaAssociation", properties, new ICondition[0])
                });

                return(new DefaultXmlSchemaFileAssociations(addinTreeNode));
            }
        }
コード例 #13
0
ファイル: ToolBarService.cs プロジェクト: Paccc/SharpDevelop
		static ToolBar CreateToolBar(UIElement inputBindingOwner, object owner, AddInTreeNode treeNode)
		{
			ToolBar tb = new CoreToolBar();
			ToolBarTray.SetIsLocked(tb, true);
			tb.ItemsSource = CreateToolBarItems(inputBindingOwner, treeNode.BuildChildItems<ToolbarItemDescriptor>(owner));
			UpdateStatus(tb.ItemsSource); // setting Visible is only possible after the items have been added
			return tb;
		}
コード例 #14
0
 static string GetFileFilter(AddInTreeNode node, string filterName)
 {
     FileFilterDescriptor fileFilter = node.BuildChildItem(filterName, null, null) as FileFilterDescriptor;
     if (fileFilter != null) {
         return fileFilter.ToString();
     }
     return String.Empty;
 }
コード例 #15
0
        static ToolBar CreateToolBar(UIElement inputBindingOwner, object owner, AddInTreeNode treeNode, bool showInTray, bool isLocked)
        {
            CoreToolBar tb = (CoreToolBar)CreateToolBar(inputBindingOwner, owner, treeNode);

            tb.ShowInTray = showInTray;
            ToolBarTray.SetIsLocked(tb, isLocked);
            return(tb);
        }
コード例 #16
0
 public static ToolStrip CreateToolStrip(object owner, AddInTreeNode treeNode)
 {
     ToolStrip toolStrip = new ToolStrip();
     toolStrip.Items.AddRange(CreateToolStripItems(owner, treeNode));
     UpdateToolbar(toolStrip);
     new LanguageChangeWatcher(toolStrip);
     return toolStrip;
 }
コード例 #17
0
ファイル: ToolsCommands.cs プロジェクト: soshan10/AI
        public static bool?ShowTabbedOptions(string dialogTitle, AddInTreeNode node)
        {
            TabbedOptionsDialog o = new TabbedOptionsDialog(node.BuildChildItems <IOptionPanelDescriptor>(null));

            o.Title = dialogTitle;
            o.Owner = WorkbenchSingleton.MainWindow;
            return(o.ShowDialog());
        }
コード例 #18
0
        public static bool?ShowTreeOptions(string dialogName, string dialogTitle, AddInTreeNode node)
        {
            TreeViewOptionsDialog o = new TreeViewOptionsDialog(node.BuildChildItems <IOptionPanelDescriptor>(null), dialogName);

            o.Title = dialogTitle;
            o.Owner = SD.Workbench.MainWindow;
            return(o.ShowDialog());
        }
コード例 #19
0
		public ProjectOptionsView(AddInTreeNode node, IProject project)
		{
			this.project = project;
			this.TitleName = project.Name;
			
			tabControl.IsDirtyChanged += delegate { RaiseIsDirtyChanged(); };
			tabControl.AddOptionPanels(node.BuildChildItems<IOptionPanelDescriptor>(project));
		}
コード例 #20
0
        public ProjectOptionsView(AddInTreeNode node, IProject project)
        {
            this.project   = project;
            this.TitleName = project.Name;

            tabControl.IsDirtyChanged += delegate { RaiseIsDirtyChanged(); };
            tabControl.AddOptionPanels(node.BuildChildItems <IOptionPanelDescriptor>(project));
        }
コード例 #21
0
ファイル: ToolBarService.cs プロジェクト: Paccc/SharpDevelop
		public static ToolStrip CreateToolStrip(object owner, AddInTreeNode treeNode)
		{
			ToolStrip toolStrip = new ToolStrip();
			toolStrip.Items.AddRange(CreateToolStripItems(owner, treeNode));
			UpdateToolbar(toolStrip); // setting Visible is only possible after the items have been added
			new LanguageChangeWatcher(toolStrip);
			return toolStrip;
		}
コード例 #22
0
        public ProjectOptionsView(AddInTreeNode node, IProject project)
        {
            this.project = project;

//			tabControl.Alignment = TabAlignment.Left;

            tabControl.HandleCreated += TabControlHandleCreated;
            AddOptionPanels(node.BuildChildItems <IDialogPanelDescriptor>(this));
        }
コード例 #23
0
        public static ToolStrip CreateToolStrip(object owner, AddInTreeNode treeNode)
        {
            ToolStrip toolStrip = new ToolStrip();

            toolStrip.Items.AddRange(CreateToolStripItems(owner, treeNode));
            UpdateToolbar(toolStrip);             // setting Visible is only possible after the items have been added
            new LanguageChangeWatcher(toolStrip);
            return(toolStrip);
        }
コード例 #24
0
		public static void ShowTabbedOptions(string dialogTitle, AddInTreeNode node)
		{
			TabbedOptions o = new TabbedOptions(dialogTitle, node);
			o.Width  = 450;
			o.Height = 425;
			o.FormBorderStyle = FormBorderStyle.FixedDialog;
			o.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
			o.Dispose();
		}
コード例 #25
0
        static ToolBar CreateToolBar(object owner, AddInTreeNode treeNode)
        {
            ToolBar tb = new ToolBar();

            tb.ItemsSource = CreateToolBarItems(treeNode.BuildChildItems <ToolbarItemDescriptor>(owner));
            UpdateStatus(tb.ItemsSource);             // setting Visible is only possible after the items have been added
            //new LanguageChangeWatcher(toolStrip);
            return(tb);
        }
コード例 #26
0
 public static void ShowTabbedOptions(string dialogTitle, AddInTreeNode node)
 {
     TabbedOptions options = new TabbedOptions(dialogTitle, PropertyService.Get<Properties>("SkyMap.Net.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new Properties()), node);
     options.Width = 450;
     options.Height = 0x1a9;
     options.FormBorderStyle = FormBorderStyle.FixedDialog;
     options.ShowDialog(WorkbenchSingleton.MainForm);
     options.Dispose();
 }
コード例 #27
0
        static ToolBar CreateToolBar(UIElement inputBindingOwner, object owner, AddInTreeNode treeNode)
        {
            ToolBar tb = new CoreToolBar();

            ToolBarTray.SetIsLocked(tb, true);
            tb.ItemsSource = CreateToolBarItems(inputBindingOwner, treeNode.BuildChildItems <ToolbarItemDescriptor>(owner));
            UpdateStatus(tb.ItemsSource);             // setting Visible is only possible after the items have been added
            return(tb);
        }
コード例 #28
0
		public ProjectOptionsView(AddInTreeNode node, IProject project)
		{
			this.project    = project;
			
//			tabControl.Alignment = TabAlignment.Left;
			
			tabControl.HandleCreated += TabControlHandleCreated;
			AddOptionPanels(node.BuildChildItems<IDialogPanelDescriptor>(this));
		}
コード例 #29
0
        static string GetFileFilter(AddInTreeNode node, string filterName)
        {
            FileFilterDescriptor fileFilter = node.BuildChildItem(filterName, null, null) as FileFilterDescriptor;

            if (fileFilter != null)
            {
                return(fileFilter.ToString());
            }
            return(String.Empty);
        }
コード例 #30
0
ファイル: ToolsCommands.cs プロジェクト: vu111293/pat-design
        public static void ShowTabbedOptions(string dialogTitle, AddInTreeNode node)
        {
            TabbedOptions o = new TabbedOptions(dialogTitle, node);

            o.Width           = 450;
            o.Height          = 425;
            o.FormBorderStyle = FormBorderStyle.FixedDialog;
            o.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
            o.Dispose();
        }
コード例 #31
0
		public TabbedOptions(string dialogName, AddInTreeNode node)
		{
			SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.TabbedOptionsDialog.xfrm"));
			
			this.Text       = dialogName;
			ControlDictionary["okButton"].Click += new EventHandler(AcceptEvent);
			Icon = null;
			Owner = WorkbenchSingleton.MainForm;
			
			AddOptionPanels(node.BuildChildItems<IDialogPanelDescriptor>(this));
		}
コード例 #32
0
        public TabbedOptions(string dialogName, AddInTreeNode node)
        {
            SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.TabbedOptionsDialog.xfrm"));

            this.Text = dialogName;
            ControlDictionary["okButton"].Click += new EventHandler(AcceptEvent);
            Icon  = null;
            Owner = WorkbenchSingleton.MainForm;

            AddOptionPanels(node.BuildChildItems <IDialogPanelDescriptor>(this));
        }
コード例 #33
0
        private static List <SearchItem> BuildSearchItems(SearchPathDescriptor descriptor)
        {
            List <SearchItem> result = new List <SearchItem>();
            AddInTreeNode     node   = AddInTree.GetTreeNode(descriptor.Path);

            foreach (Codon codon in node.Codons)
            {
                result.AddRange(HandleMenuCodon(descriptor, codon, descriptor.Path, new List <string>()));
            }
            return(result);
        }
コード例 #34
0
        public static void ShowTabbedOptions(string dialogTitle, AddInTreeNode node)
        {
            TabbedOptions o = new TabbedOptions(dialogTitle,
                                                ((Properties)PropertyService.Get("ICSharpCode.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new Properties())),
                                                node);

            o.Width           = 450;
            o.Height          = 425;
            o.FormBorderStyle = FormBorderStyle.FixedDialog;
            o.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
            o.Dispose();
        }
コード例 #35
0
 public TreeViewOptions(SkyMap.Net.Core.Properties properties, AddInTreeNode node)
 {
     this.properties = properties;
     this.Text = SkyMap.Net.Core.StringParser.Parse("${res:Dialog.Options.TreeViewOptions.DialogName}");
     this.InitializeComponent();
     this.plainFont = new Font(((TreeView) base.ControlDictionary["optionsTreeView"]).Font, FontStyle.Regular);
     this.boldFont = new Font(((TreeView) base.ControlDictionary["optionsTreeView"]).Font, FontStyle.Bold);
     this.InitImageList();
     if (node != null)
     {
         this.AddNodes(properties, ((TreeView) base.ControlDictionary["optionsTreeView"]).Nodes, new List<IDialogPanelDescriptor>((IDialogPanelDescriptor[]) node.BuildChildItems(this).ToArray(typeof(IDialogPanelDescriptor))));
     }
 }
コード例 #36
0
 void GetDefaultAssociations(AddInTreeNode node)
 {
     if (node != null)
     {
         foreach (Codon codon in node.Codons)
         {
             string fileExtension   = codon.Id;
             string namespaceUri    = codon.Properties["namespaceUri"];
             string namespacePrefix = codon.Properties["namespacePrefix"];
             Add(new XmlSchemaFileAssociation(fileExtension, namespaceUri, namespacePrefix));
         }
     }
 }
コード例 #37
0
 static private IConnection CreateConnectionObject(string connectionstring)
 {
     try
     {
         AddInTreeNode AddinNode = AddInTree.GetTreeNode("/SharpQuery/Connection");
         IConnection   conn      = (IConnection)AddinNode.BuildChildItem("ConnectionWrapper", null, null);
         conn.ConnectionString = connectionstring;
         return(conn);
     }
     catch (System.Exception e)
     {
         throw new ConnectionStringException(e.Message);
     }
 }
コード例 #38
0
        public bool IsSolutionOrProjectFile(FileName fileName)
        {
            AddInTreeNode addinTreeNode = SD.AddInTree.GetTreeNode("/SharpDevelop/Workbench/Combine/FileFilter");

            foreach (Codon codon in addinTreeNode.Codons)
            {
                string pattern = codon.Properties.Get("extensions", "*.*");
                if (pattern != "*.*" && FileUtility.MatchesPattern(fileName, pattern))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #39
0
ファイル: ProjectService.cs プロジェクト: carlhuth/GenXSource
        /// <summary>
        /// Returns if a project loader exists for the given file. This method works even in early
        /// startup (before service initialization)
        /// </summary>
        public static bool HasProjectLoader(string fileName)
        {
            AddInTreeNode addinTreeNode = AddInTree.GetTreeNode("/SharpDevelop/Workbench/Combine/FileFilter");

            foreach (Codon codon in addinTreeNode.Codons)
            {
                string pattern = codon.Properties.Get("extensions", "");
                if (FileUtility.MatchesPattern(fileName, pattern) && codon.Properties.Contains("class"))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #40
0
ファイル: ToolBarService.cs プロジェクト: stophun/fdotoolbox
		public static ToolStripItem[] CreateToolStripItems(object owner, AddInTreeNode treeNode)
		{
			List<ToolStripItem> collection = new List<ToolStripItem>();
			foreach (object item in treeNode.BuildChildItems(owner)) {
				if (item is ToolStripItem) {
					collection.Add((ToolStripItem)item);
				} else {
					ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item;
					collection.AddRange(submenuBuilder.BuildSubmenu(null, owner));
				}
			}
			
			return collection.ToArray();
		}
コード例 #41
0
ファイル: ProjectService.cs プロジェクト: carlhuth/GenXSource
        public static IProjectLoader GetProjectLoader(string fileName)
        {
            AddInTreeNode addinTreeNode = AddInTree.GetTreeNode("/SharpDevelop/Workbench/Combine/FileFilter");

            foreach (Codon codon in addinTreeNode.Codons)
            {
                string pattern = codon.Properties.Get("extensions", "");
                if (FileUtility.MatchesPattern(fileName, pattern) && codon.Properties.Contains("class"))
                {
                    object binding = codon.AddIn.CreateObject(codon.Properties["class"]);
                    return(binding as IProjectLoader);
                }
            }
            return(null);
        }
コード例 #42
0
        public TreeViewOptions(AddInTreeNode node)
        {
            this.Text = StringParser.Parse("${res:Dialog.Options.TreeViewOptions.DialogName}");

            this.InitializeComponent();

            plainFont = new Font(((TreeView)ControlDictionary["optionsTreeView"]).Font, FontStyle.Regular);
            boldFont  = new Font(((TreeView)ControlDictionary["optionsTreeView"]).Font, FontStyle.Bold);

            InitImageList();

            if (node != null)
            {
                AddNodes(((TreeView)ControlDictionary["optionsTreeView"]).Nodes, node.BuildChildItems <IDialogPanelDescriptor>(this));
            }
        }
コード例 #43
0
        /// <summary>
        /// Gets the keyboard shortcut for the menu item with the given addin tree
        /// path and given codon id.
        /// </summary>
        Keys GetKeyboardShortcut(string path, string id)
        {
            AddInTreeNode node = AddInTree.GetTreeNode(path);

            if (node != null)
            {
                foreach (Codon codon in node.Codons)
                {
                    if (codon.Id == id)
                    {
                        return(MenuCommand.ParseShortcut(codon.Properties["shortcut"]));
                    }
                }
            }
            return(Keys.None);
        }
コード例 #44
0
 public override void Run()
 {
                 #if !STANDALONE
     AddIn         addIn     = ((AddInControl)Owner).AddIn;
     AddInTreeNode dummyNode = new AddInTreeNode();
     foreach (KeyValuePair <string, ExtensionPath> pair in addIn.Paths)
     {
         if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog"))
         {
             dummyNode.AddCodons(pair.Value.Codons);
         }
     }
     ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions(addIn.Name + " " + ResourceService.GetString("AddInManager.Options"),
                                                                        dummyNode);
                 #endif
 }
コード例 #45
0
        /// <summary>
        /// Gets the keyboard shortcut for the menu item with the given addin tree
        /// path and given codon id.
        /// </summary>
        Keys GetKeyboardShortcut(string path, string id)
        {
            AddInTreeNode node = AddInTree.GetTreeNode(path);

            if (node != null)
            {
                foreach (Codon codon in node.Codons)
                {
                    if (codon.Id == id)
                    {
                        return((Keys) new KeysConverter().ConvertFromInvariantString(codon.Properties["shortcut"].Replace('|', '+')));
                    }
                }
            }
            return(Keys.None);
        }
コード例 #46
0
ファイル: ToolBarService.cs プロジェクト: Paccc/SharpDevelop
		public static ToolStripItem[] CreateToolStripItems(object owner, AddInTreeNode treeNode)
		{
			if (treeNode == null)
				return new ToolStripItem[0];
			List<ToolStripItem> collection = new List<ToolStripItem>();
			foreach (ToolbarItemDescriptor descriptor in treeNode.BuildChildItems<ToolbarItemDescriptor>(owner)) {
				object item = CreateToolbarItemFromDescriptor(descriptor);
				if (item is ToolStripItem) {
					collection.Add((ToolStripItem)item);
				} else if (item is IMenuItemBuilder) {
					IMenuItemBuilder submenuBuilder = (IMenuItemBuilder)item;
					collection.AddRange(submenuBuilder.BuildItems(descriptor.Codon, owner).Cast<ToolStripItem>().ToArray());
				}
			}
			
			return collection.ToArray();
		}
コード例 #47
0
 public static ToolStripItem[] CreateToolStripItems(object owner, AddInTreeNode treeNode)
 {
     List<ToolStripItem> list = new List<ToolStripItem>();
     foreach (object obj2 in treeNode.BuildChildItems(owner))
     {
         if (obj2 is ToolStripItem)
         {
             list.Add((ToolStripItem) obj2);
         }
         else
         {
             ISubmenuBuilder builder = (ISubmenuBuilder) obj2;
             list.AddRange(builder.BuildSubmenu(null, owner));
         }
     }
     return list.ToArray();
 }
コード例 #48
0
		public TreeViewOptions(Properties properties, AddInTreeNode node)
		{
			this.properties = properties;
			
			this.Text = StringParser.Parse("${res:Dialog.Options.TreeViewOptions.DialogName}");

			this.InitializeComponent();
			
			plainFont = new Font(((TreeView)ControlDictionary["optionsTreeView"]).Font, FontStyle.Regular);
			boldFont  = new Font(((TreeView)ControlDictionary["optionsTreeView"]).Font, FontStyle.Bold);
			
			InitImageList();
			
			if (node != null) {
				AddNodes(((TreeView)ControlDictionary["optionsTreeView"]).Nodes, node.BuildChildItems<IDialogPanelDescriptor>(this));
			}
		}
コード例 #49
0
 public IncludeReturnItem(AddInTreeNode node, object parameter, IEnumerable<ICondition> additionalConditions)
 {
     this.node = node;
     this.parameter = parameter;
     this.additionalConditions = additionalConditions;
 }
コード例 #50
0
ファイル: IconService.cs プロジェクト: netide/SharpDevelop
		static void InitializeIcons(AddInTreeNode treeNode)
		{
			extensionHashtable[".PRJX"] = "Icons.16x16.SolutionIcon";
			
			extensionHashtable[".CMBX"] = "Icons.16x16.CombineIcon";
			extensionHashtable[".SLN"]  = "Icons.16x16.CombineIcon";
			
			foreach (IconDescriptor iconCodon in treeNode.BuildChildItems<IconDescriptor>(null)) {
				string imageName = iconCodon.Resource != null ? iconCodon.Resource : iconCodon.Id;
				
				if (iconCodon.Extensions != null) {
					foreach (string ext in iconCodon.Extensions) {
						extensionHashtable[ext.ToUpperInvariant()] = imageName;
					}
				}
				
				if (iconCodon.Language != null) {
					projectFileHashtable[iconCodon.Language] = imageName;
				}
			}
		}
コード例 #51
0
ファイル: ToolsCommands.cs プロジェクト: Rew/SharpDevelop
		public static bool? ShowTreeOptions(string dialogTitle, AddInTreeNode node)
		{
			return ShowTreeOptions(TreeViewOptionsDialog.DefaultDialogName, dialogTitle, node);
		}
コード例 #52
0
		public override void ShowOptions()
		{
			ClearReportedMessages();
			
			AddInTreeNode dummyNode = new AddInTreeNode();
			foreach (KeyValuePair<string, ExtensionPath> pair in _addIn.Paths)
			{
				if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog"))
				{
					dummyNode.AddCodons(pair.Value.Codons);
				}
			}
			ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions(
				_addIn.Name + " " + SD.ResourceService.GetString("AddInManager.Options"),
				dummyNode);
		}
コード例 #53
0
		static void InitializeIcons(AddInTreeNode treeNode)
		{
			extensionHashtable[".PRJX"] = "Icons.16x16.SolutionIcon";
			
			extensionHashtable[".CMBX"] = "Icons.16x16.CombineIcon";
			extensionHashtable[".SLN"]  = "Icons.16x16.CombineIcon";
			
			IconDescriptor[] icons = (IconDescriptor[])treeNode.BuildChildItems(null).ToArray(typeof(IconDescriptor));
			for (int i = 0; i < icons.Length; ++i) {
				IconDescriptor iconCodon = icons[i];
				string imageName = iconCodon.Resource != null ? iconCodon.Resource : iconCodon.Id;
				
				if (iconCodon.Extensions != null) {
					foreach (string ext in iconCodon.Extensions) {
						extensionHashtable[ext.ToUpperInvariant()] = imageName;
					}
				}
				
				if (iconCodon.Language != null) {
					projectFileHashtable[iconCodon.Language] = imageName;
				}
			}
		}
コード例 #54
0
 private static void InitializeIcons(AddInTreeNode treeNode)
 {
     foreach (IconDescriptor descriptor in (IconDescriptor[]) treeNode.BuildChildItems(null).ToArray(typeof(IconDescriptor)))
     {
         string str = (descriptor.Resource != null) ? descriptor.Resource : descriptor.Id;
         if (descriptor.Extensions != null)
         {
             foreach (string str2 in descriptor.Extensions)
             {
                 extensionHashtable[str2.ToUpperInvariant()] = str;
             }
         }
         if (descriptor.Language != null)
         {
             projectFileHashtable[descriptor.Language] = str;
         }
     }
 }
コード例 #55
0
        public override void ShowOptions()
        {
            ClearReportedMessages();

            var dummyNode = new AddInTreeNode();
            foreach (var pair in _addIn.Paths)
            {
                if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog"))
                {
                    dummyNode.AddCodons(pair.Value.Codons);
                }
            }

            ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions(
                _addIn.Name + " " + Resources.AddInManager_Options,
                dummyNode);
        }
コード例 #56
0
		public override void Run()
		{
			#if !STANDALONE
			AddIn addIn = ((AddInControl)Owner).AddIn;
			AddInTreeNode dummyNode = new AddInTreeNode();
			foreach (KeyValuePair<string, ExtensionPath> pair in addIn.Paths) {
				if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog")) {
					dummyNode.Codons.AddRange(pair.Value.Codons);
				}
			}
			ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions(addIn.Name + " " + ResourceService.GetString("AddInManager.Options"),
			                                                                   dummyNode);
			#endif
		}