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


C# ReferenceProjectItem.SetMetadata方法代码示例

本文整理汇总了C#中ICSharpCode.SharpDevelop.Project.ReferenceProjectItem.SetMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# ReferenceProjectItem.SetMetadata方法的具体用法?C# ReferenceProjectItem.SetMetadata怎么用?C# ReferenceProjectItem.SetMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICSharpCode.SharpDevelop.Project.ReferenceProjectItem的用法示例。


在下文中一共展示了ReferenceProjectItem.SetMetadata方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateIronPythonReference

		ReferenceProjectItem CreateIronPythonReference(IProject project)
		{
			ReferenceProjectItem reference = new ReferenceProjectItem(project, "IronPython");
			reference.SetMetadata("HintPath", @"$(PythonBinPath)\IronPython.dll");
			return reference;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:6,代码来源:ConvertProjectToPythonProjectCommand.cs

示例2: FileTemplateImpl

		public FileTemplateImpl(XmlDocument doc, IReadOnlyFileSystem fileSystem)
		{
			author = doc.DocumentElement.GetAttribute("author");
			
			XmlElement config = doc.DocumentElement["Config"];
			name         = config.GetAttribute("name");
			icon         = SD.ResourceService.GetImage(config.GetAttribute("icon"));
			category     = config.GetAttribute("category");
			defaultName  = config.GetAttribute("defaultname");
			languagename = config.GetAttribute("language");
			
			if (config.HasAttribute("subcategory")) {
				subcategory = config.GetAttribute("subcategory");
			}

			string newFileDialogVisibleAttr  = config.GetAttribute("newfiledialogvisible");
			if (newFileDialogVisibleAttr != null && newFileDialogVisibleAttr.Length != 0) {
				if (newFileDialogVisibleAttr.Equals("false", StringComparison.OrdinalIgnoreCase))
					newFileDialogVisible = false;
			}

			if (doc.DocumentElement["Description"] != null) {
				description  = doc.DocumentElement["Description"].InnerText;
			}
			
			if (config["Wizard"] != null) {
				wizardpath = config["Wizard"].Attributes["path"].InnerText;
			}
			
			if (doc.DocumentElement["Properties"] != null) {
				XmlNodeList propertyList = doc.DocumentElement["Properties"].SelectNodes("Property");
				foreach (XmlElement propertyElement in propertyList) {
					properties.Add(new TemplateProperty(propertyElement));
				}
			}
			
			if (doc.DocumentElement["Types"] != null) {
				XmlNodeList typeList = doc.DocumentElement["Types"].SelectNodes("Type");
				foreach (XmlElement typeElement in typeList) {
					customTypes.Add(new TemplateType(typeElement));
				}
			}
			
			if (doc.DocumentElement["References"] != null) {
				XmlNodeList references = doc.DocumentElement["References"].SelectNodes("Reference");
				foreach (XmlElement reference in references) {
					if (!reference.HasAttribute("include"))
						throw new InvalidDataException("Reference without 'include' attribute!");
					ReferenceProjectItem item = new ReferenceProjectItem(null, reference.GetAttribute("include"));
					item.SetMetadata("HintPath", reference.GetAttribute("hintPath"));
					var requiredTargetFramework = reference.GetElementsByTagName("RequiredTargetFramework").OfType<XmlElement>().FirstOrDefault();
					if (requiredTargetFramework != null) {
						item.SetMetadata("RequiredTargetFramework", requiredTargetFramework.Value);
					}
					requiredAssemblyReferences.Add(item);
				}
			}
			
			if (doc.DocumentElement["Actions"] != null) {
				foreach (XmlElement el in doc.DocumentElement["Actions"]) {
					Action<FileTemplateResult> action = ReadAction(el);
					if (action != null)
						actions += action;
				}
			}
			
			fileoptions = doc.DocumentElement["AdditionalOptions"];
			
			// load the files
			XmlElement files  = doc.DocumentElement["Files"];
			XmlNodeList nodes = files.ChildNodes;
			foreach (XmlNode filenode in nodes) {
				if (filenode is XmlElement) {
					this.files.Add(new FileDescriptionTemplate((XmlElement)filenode, fileSystem));
				}
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:77,代码来源:FileTemplateImpl.cs

示例3: AddReference

		public void AddReference()
		{
			foreach (ListViewItem item in listView.SelectedItems) {
				string include = chooseSpecificVersionCheckBox.Checked ? item.Tag.ToString() : item.Text;
				ReferenceProjectItem rpi = new ReferenceProjectItem(selectDialog.ConfigureProject, include);
				string requiredFrameworkVersion;
				if (chooseSpecificVersionCheckBox.Checked) {
					if (KnownFrameworkAssemblies.TryGetRequiredFrameworkVersion(item.Tag.ToString(), out requiredFrameworkVersion)) {
						rpi.SetMetadata("RequiredTargetFramework", requiredFrameworkVersion);
					}
				} else {
					// find the lowest version of the assembly and use its RequiredTargetFramework
					ListViewItem lowestVersion = item;
					foreach (ListViewItem item2 in fullItemList) {
						if (item2.Text == item.Text) {
							if (new Version(item2.SubItems[1].Text) < ((DomAssemblyName)lowestVersion.Tag).Version) {
								lowestVersion = item2;
							}
						}
					}
					if (KnownFrameworkAssemblies.TryGetRequiredFrameworkVersion(lowestVersion.Tag.ToString(), out requiredFrameworkVersion)) {
						rpi.SetMetadata("RequiredTargetFramework", requiredFrameworkVersion);
					}
				}
				selectDialog.AddReference(
					item.Text, "Gac", rpi.Include,
					rpi
				);
			}
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:30,代码来源:GacReferencePanel.cs

示例4: AddReferenceIfNotExists

		void AddReferenceIfNotExists(string name, string requiredTargetFramework)
		{
			if (!(Project.GetItemsOfType(ItemType.Reference).Any(r => string.Equals(r.Include, name, StringComparison.OrdinalIgnoreCase)))) {
				ReferenceProjectItem rpi = new ReferenceProjectItem(Project, name);
				if (requiredTargetFramework != null)
					rpi.SetMetadata("RequiredTargetFramework", requiredTargetFramework);
				ProjectService.AddProjectItem(Project, rpi);
			}
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:9,代码来源:DotNetStartBehavior.cs

示例5: AddDotnet35References

		protected internal virtual void AddDotnet35References()
		{
			ReferenceProjectItem rpi = new ReferenceProjectItem(this, "System.Core");
			rpi.SetMetadata("RequiredTargetFramework", "3.5");
			ProjectService.AddProjectItem(this, rpi);
			
			if (GetItemsOfType(ItemType.Reference).Any(r => r.Include == "System.Data")) {
				rpi = new ReferenceProjectItem(this, "System.Data.DataSetExtensions");
				rpi.SetMetadata("RequiredTargetFramework", "3.5");
				ProjectService.AddProjectItem(this, rpi);
			}
			if (GetItemsOfType(ItemType.Reference).Any(r => r.Include == "System.Xml")) {
				rpi = new ReferenceProjectItem(this, "System.Xml.Linq");
				rpi.SetMetadata("RequiredTargetFramework", "3.5");
				ProjectService.AddProjectItem(this, rpi);
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:17,代码来源:CompilableProject.cs

示例6: FileTemplate

		public FileTemplate(string filename)
		{
			XmlDocument doc = new XmlDocument();
			doc.Load(filename);
			
			author = doc.DocumentElement.GetAttribute("author");
			
			XmlElement config = doc.DocumentElement["Config"];
			name         = config.GetAttribute("name");
			icon         = config.GetAttribute("icon");
			category     = config.GetAttribute("category");
			defaultName  = config.GetAttribute("defaultname");
			languagename = config.GetAttribute("language");
			
			if (config.HasAttribute("subcategory")) {
				subcategory = config.GetAttribute("subcategory");
			}

			string newFileDialogVisibleAttr  = config.GetAttribute("newfiledialogvisible");
			if (newFileDialogVisibleAttr != null && newFileDialogVisibleAttr.Length != 0) {
				if (newFileDialogVisibleAttr.Equals("false", StringComparison.OrdinalIgnoreCase))
					newFileDialogVisible = false;
			}

			if (doc.DocumentElement["Description"] != null) {
				description  = doc.DocumentElement["Description"].InnerText;
			}
			
			if (config["Wizard"] != null) {
				wizardpath = config["Wizard"].Attributes["path"].InnerText;
			}
			
			if (doc.DocumentElement["Properties"] != null) {
				XmlNodeList propertyList = doc.DocumentElement["Properties"].SelectNodes("Property");
				foreach (XmlElement propertyElement in propertyList) {
					properties.Add(new TemplateProperty(propertyElement));
				}
			}
			
			if (doc.DocumentElement["Types"] != null) {
				XmlNodeList typeList = doc.DocumentElement["Types"].SelectNodes("Type");
				foreach (XmlElement typeElement in typeList) {
					customTypes.Add(new TemplateType(typeElement));
				}
			}
			
			if (doc.DocumentElement["References"] != null) {
				XmlNodeList references = doc.DocumentElement["References"].SelectNodes("Reference");
				foreach (XmlElement reference in references) {
					if (!reference.HasAttribute("include"))
						throw new InvalidDataException("Reference without 'include' attribute!");
					ReferenceProjectItem item = new ReferenceProjectItem(null, reference.GetAttribute("include"));
					item.SetMetadata("HintPath", reference.GetAttribute("hintPath"));
					requiredAssemblyReferences.Add(item);
				}
			}
			
			fileoptions = doc.DocumentElement["AdditionalOptions"];
			
			doc.DocumentElement.SetAttribute("fileName", filename); // used for template loading warnings
			
			// load the files
			XmlElement files  = doc.DocumentElement["Files"];
			XmlNodeList nodes = files.ChildNodes;
			foreach (XmlNode filenode in nodes) {
				if (filenode is XmlElement) {
					this.files.Add(new FileDescriptionTemplate((XmlElement)filenode, Path.GetDirectoryName(filename)));
				}
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:70,代码来源:FileTemplate.cs


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