当前位置: 首页>>代码示例>>C#>>正文


C# Core.AddIn类代码示例

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


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

示例1: DoSetUp

		void DoSetUp(XmlReader reader, string endElement, AddIn addIn)
		{
			Stack<ICondition> conditionStack = new Stack<ICondition>();
			List<Codon> innerCodons = new List<Codon>();
			while (reader.Read()) {
				switch (reader.NodeType) {
					case XmlNodeType.EndElement:
						if (reader.LocalName == "Condition" || reader.LocalName == "ComplexCondition") {
							conditionStack.Pop();
						} else if (reader.LocalName == endElement) {
							if (innerCodons.Count > 0)
								this.codons.Add(innerCodons);
							return;
						}
						break;
					case XmlNodeType.Element:
						string elementName = reader.LocalName;
						if (elementName == "Condition") {
							conditionStack.Push(Condition.Read(reader, addIn));
						} else if (elementName == "ComplexCondition") {
							conditionStack.Push(Condition.ReadComplexCondition(reader, addIn));
						} else {
							Codon newCodon = new Codon(this.AddIn, elementName, Properties.ReadFromAttributes(reader), conditionStack.ToArray());
							innerCodons.Add(newCodon);
							if (!reader.IsEmptyElement) {
								ExtensionPath subPath = this.AddIn.GetExtensionPath(this.Name + "/" + newCodon.Id);
								subPath.DoSetUp(reader, elementName, addIn);
							}
						}
						break;
				}
			}
			if (innerCodons.Count > 0)
				this.codons.Add(innerCodons);
		}
开发者ID:Rew,项目名称:SharpDevelop,代码行数:35,代码来源:ExtensionPath.cs

示例2: Codon

		public Codon(AddIn addIn, string name, Properties properties, ICondition[] conditions)
		{
			this.addIn      = addIn;
			this.name       = name;
			this.properties = properties;
			this.conditions = conditions;
		}
开发者ID:stophun,项目名称:fdotoolbox,代码行数:7,代码来源:Codon.cs

示例3: GetExtensions

 void GetExtensions(AddIn ai, TreeNode treeNode)
 {
     foreach (ExtensionPath ext in ai.Paths.Values) {
         string[] name = ext.Name.Split('/');
         TreeNode currentNode = treeNode;
         if (name.Length < 1) {
             continue;
         }
         for (int i = 1; i < name.Length; ++i) {
             bool found = false;
             foreach (TreeNode n in currentNode.Nodes) {
                 if (n.Text == name[i]) {
                     currentNode = n;
                     found = true;
                     break;
                 }
             }
             if (found) {
                 if (i == name.Length - 1 && currentNode.Tag == null)
                     currentNode.Tag = ext;
             } else {
                 TreeNode newNode = new TreeNode(name[i]);
                 newNode.ImageIndex = 3;
                 newNode.SelectedImageIndex = 4;
                 if (i == name.Length - 1) {
                     newNode.Tag = ext;
                 }
                 currentNode.Nodes.Add(newNode);
                 currentNode = newNode;
             }
         }
     }
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:33,代码来源:TreeTreeView.cs

示例4: ReadComplexCondition

		public static ICondition ReadComplexCondition(XmlReader reader, AddIn addIn)
		{
			Properties properties = Properties.ReadFromAttributes(reader);
			reader.Read();
			ICondition condition = null;
			while (reader.Read()) {
				switch (reader.NodeType) {
					case XmlNodeType.Element:
						switch (reader.LocalName) {
							case "And":
								condition = AndCondition.Read(reader, addIn);
								goto exit;
							case "Or":
								condition = OrCondition.Read(reader, addIn);
								goto exit;
							case "Not":
								condition = NegatedCondition.Read(reader, addIn);
								goto exit;
							default:
								throw new AddInLoadException("Invalid element name '" + reader.LocalName
								                             + "', the first entry in a ComplexCondition " +
								                             "must be <And>, <Or> or <Not>");
						}
				}
			}
		exit:
			if (condition != null) {
				ConditionFailedAction action = properties.Get("action", ConditionFailedAction.Exclude);
				condition.Action = action;
			}
			return condition;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:32,代码来源:Condition.cs

示例5: Condition

		public Condition(string name, Properties properties, AddIn addIn)
		{
			this.AddIn = addIn;
			this.name = name;
			this.properties = properties;
			action = properties.Get("action", ConditionFailedAction.Exclude);
		}
开发者ID:Rew,项目名称:SharpDevelop,代码行数:7,代码来源:Condition.cs

示例6: CreateAddIns

		private void CreateAddIns()
		{
			// Create AddIn objects from *.addin files available in this assembly's output directory
			FakeAddInTree _addInTree = new FakeAddInTree();

			using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test.addin"))
			{
				_addIn1 = AddIn.Load(_addInTree, streamReader);
			}
			
			using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_New.addin"))
			{
				_addIn1_new = AddIn.Load(_addInTree, streamReader);
			}
			
			using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_2.addin"))
			{
				_addIn2 = AddIn.Load(_addInTree, streamReader);
			}
			
			using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_2_New.addin"))
			{
				_addIn2_new = AddIn.Load(_addInTree, streamReader);
			}
			
			using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_noVersion.addin"))
			{
				_addIn_noVersion = AddIn.Load(_addInTree, streamReader);
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:30,代码来源:AvailableAddInsViewModelTests.cs

示例7: LazyLoadDoozer

		public LazyLoadDoozer(AddIn addIn, Properties properties)
		{
			this.addIn      = addIn;
			this.name       = properties["name"];
			this.className  = properties["class"];
			
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:LazyDoozer.cs

示例8: DefaultOptionPanelDescriptor

 public DefaultOptionPanelDescriptor(string id, string label, AddIn addin, object owner, string optionPanelPath)
     : this(id, label)
 {
     this.addin = addin;
     this.owner = owner;
     this.optionPanelPath = optionPanelPath;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:DefaultOptionPanelDescriptor.cs

示例9: LazyConditionEvaluator

		public LazyConditionEvaluator(AddIn addIn, Properties properties)
		{
			if (addIn == null)
				throw new ArgumentNullException("addIn");
			this.addIn      = addIn;
			this.name       = properties["name"];
			this.className  = properties["class"];
		}
开发者ID:Rew,项目名称:SharpDevelop,代码行数:8,代码来源:LazyConditionEvaluator.cs

示例10: GetCodon

		/// <summary>
		/// Gets the codon with the specified extension path and name.
		/// </summary>
		public static Codon GetCodon(AddIn addin, string extensionPath, string name)
		{
			if (addin.Paths.ContainsKey(extensionPath)) {
				ExtensionPath path = addin.Paths[extensionPath];
				return GetCodon(path.Codons, name);
			}
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:11,代码来源:AddInHelper.cs

示例11: PadDescriptor

		/// <summary>
		/// Creates a new pad descriptor from the AddIn tree.
		/// </summary>
		public PadDescriptor(Codon codon)
		{
			addIn = codon.AddIn;
			shortcut = codon.Properties["shortcut"];
			category = codon.Properties["category"];
			icon = codon.Properties["icon"];
			title = codon.Properties["title"];
			@class = codon.Properties["class"];
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:12,代码来源:PadDescriptor.cs

示例12: AddToTree

		public void AddToTree(AddIn addIn)
		{
			if (addIn != null)
			{
				SD.Log.DebugFormatted(
					"[AddInManager2.SD] Added {0} AddIn {1} to tree.", ((addIn.Action == AddInAction.Update) ? "updated" : "new"), addIn.Name);
				
				((AddInTreeImpl)SD.AddInTree).InsertAddIn(addIn);
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:10,代码来源:SDAddInManagement.cs

示例13: ManagedAddIn

        public ManagedAddIn(AddIn addIn)
        {
            if (addIn == null)
            {
                throw new ArgumentNullException("addIn");
            }

            _addIn = addIn;
            InstallationSource = AddInInstallationSource.Offline;
        }
开发者ID:MyLoadTest,项目名称:VuGenAddinManager,代码行数:10,代码来源:ManagedAddIn.cs

示例14: Codon

		public Codon(AddIn addIn, string name, Properties properties, IReadOnlyList<ICondition> conditions)
		{
			if (name == null)
				throw new ArgumentNullException("name");
			if (properties == null)
				throw new ArgumentNullException("properties");
			this.addIn      = addIn;
			this.name       = name;
			this.properties = properties;
			this.conditions = conditions;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:11,代码来源:Codon.cs

示例15: PlugInProperties

        public PlugInProperties(AddIn addIn)
        {
            m_AddIn = addIn;

            InitializeComponent();
            treeView1.Nodes[0].Tag = new PiGeneral(addIn);

            Text = addIn.Name + " Properties";

            if (addIn.Properties["required"] == "true")
                button3.Enabled = false;
        }
开发者ID:NasuTek,项目名称:NasuTek-Grabbie,代码行数:12,代码来源:PlugInProperties.cs


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