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

C# Core.AddIn类代码示例

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

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



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


示例16: Initialize

		private void Initialize(ManagedAddIn addIn)
		{
			_markedAddIn = addIn;
			if (_markedAddIn != null)
			{
				_addIn = addIn.AddIn;
			}
			if (_addIn != null)
			{
				UpdateMembers();
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:12,代码来源:OfflineAddInViewModel.cs


示例17: CodonLVSelectedIndexChanged

		void CodonLVSelectedIndexChanged(object sender, EventArgs e)
		{
			if (CodonLV.SelectedItems.Count != 1) {
				return;
			}
			Codon c = CodonLV.SelectedItems[0].Tag as Codon;
			if (c == null) {
				return;
			}
			
			CurrentAddIn = c.AddIn;
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:12,代码来源:CodonListPanel.cs


示例18: GetExtensions

 void GetExtensions(AddIn ai, TreeNode treeNode)
 {
     if (!ai.Enabled)
         return;
     foreach (ExtensionPath ext in ai.Paths.Values) {
         TreeNode newNode = new TreeNode(ext.Name);
         newNode.ImageIndex = 3;
         newNode.SelectedImageIndex = 4;
         newNode.Tag = ext;
         treeNode.Nodes.Add(newNode);
     }
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:12,代码来源:AddinTreeView.cs


示例19: FixtureSetUp

		public void FixtureSetUp()
		{
			var addInTree = MockRepository.GenerateStub<IAddInTree>();
			addIn = AddIn.Load(addInTree, "CSharpBinding.addin");
			
			registeredIssueProviders = addIn.Paths["/SharpDevelop/ViewContent/TextEditor/C#/IssueProviders"].Codons
				.Select(c => FindType(c.Properties["class"])).Where(t => t != null).ToList();
			NRissueProviders = NRCSharpRefactoring.ExportedTypes.Where(t => t.GetCustomAttribute<IssueDescriptionAttribute>() != null).ToList();
			
			registeredContextActions = addIn.Paths["/SharpDevelop/ViewContent/TextEditor/C#/ContextActions"].Codons
				.Select(c => FindType(c.Properties["class"])).Where(t => t != null).ToList();
			NRcontextActions = NRCSharpRefactoring.ExportedTypes.Where(t => t.GetCustomAttribute<ContextActionAttribute>() != null).ToList();
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:13,代码来源:RegistrationTests.cs


示例20: PadDescriptor

		/// <summary>
		/// Creates a new pad descriptor from the AddIn tree.
		/// </summary>
		public PadDescriptor(Codon codon)
		{
			if (codon == null)
				throw new ArgumentNullException("codon");
			addIn = codon.AddIn;
			shortcut = codon.Properties["shortcut"];
			category = codon.Properties["category"];
			icon = codon.Properties["icon"];
			title = codon.Properties["title"];
			@class = codon.Properties["class"];
			if (!string.IsNullOrEmpty(codon.Properties["defaultPosition"])) {
				DefaultPosition = (DefaultPadPositions)Enum.Parse(typeof(DefaultPadPositions), codon.Properties["defaultPosition"]);
			}
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:17,代码来源:PadDescriptor.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Core.Codon类代码示例发布时间:2022-05-26
下一篇:
C# Snippets.InsertionContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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