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


C# Properties.Set方法代码示例

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


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

示例1: CreateDefaultXmlSchemaFileExtensions

		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);
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:26,代码来源:DefaultXmlEditorOptionsTestFixture.cs

示例2: CreateMemento

		/// <summary>
		/// Saves project preferences (currently opened files, bookmarks etc.) to the
		/// a property container.
		/// </summary>
		public virtual Properties CreateMemento()
		{
			WorkbenchSingleton.AssertMainThread();
			
			// breakpoints and files
			Properties properties = new Properties();
			properties.Set("bookmarks", ICSharpCode.SharpDevelop.Bookmarks.BookmarkManager.GetProjectBookmarks(this).ToArray());
			List<string> files = new List<string>();
			foreach (string fileName in FileService.GetOpenFiles()) {
				if (fileName != null && IsFileInProject(fileName)) {
					files.Add(fileName);
				}
			}
			properties.Set("files", files.ToArray());
			
			// web project properties
			var webOptions = WebProjectsOptions.Instance.GetWebProjectOptions(Name);
			if (webOptions != null)
				properties.Set("WebProjectOptions", webOptions);
			
			// other project data
			properties.Set("projectSavedData", ProjectSpecificProperties ?? new Properties());
			
			return properties;
		}
开发者ID:OmerRaviv,项目名称:SharpDevelop,代码行数:29,代码来源:AbstractProject.cs

示例3: Init

		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);
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:33,代码来源:DefaultSchemaFileAssociationsTestFixture.cs

示例4: SetUp

		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);
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:27,代码来源:XmlEditorFileExtensionsTestFixture.cs

示例5: CreateProjectWithExistingCustomToolProperties

		void CreateProjectWithExistingCustomToolProperties(bool runOnBuild, string fileNames = "")
		{
			CreateProject();
			properties = new Properties();
			properties.Set("runOnBuild", runOnBuild);
			properties.Set("fileNames", fileNames);
			projectSpecificProperties.SetNestedProperties("customTool", properties);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:8,代码来源:ProjectCustomToolOptionsTests.cs

示例6: FillConfigurations

		void FillConfigurations (Gtk.TreeIter configIter)
		{
			foreach (string name in test.GetConfigurations ()) {
				Properties configNodeProperties = new Properties();
				configNodeProperties.Set ("UnitTest", test);
				configNodeProperties.Set ("Config", name);
				foreach (OptionsDialogSection section in configurationNode.ChildNodes) {
					OptionsDialogSection s = (OptionsDialogSection)section.Clone ();
					if (firstSection == null)
						firstSection = s;
					s.Label = StringParserService.Parse (section.Label, new string[,] { { "Configuration", name } });
					AddSection (configIter, s, configNodeProperties);
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:15,代码来源:UnitTestOptionsDialog.cs

示例7: CreateMemento

		/// <summary>
		/// Saves project preferences (currently opened files, bookmarks etc.) to the
		/// a property container.
		/// </summary>
		public virtual Properties CreateMemento()
		{
			WorkbenchSingleton.AssertMainThread();
			
			Properties properties = new Properties();
			properties.Set("bookmarks", ICSharpCode.SharpDevelop.Bookmarks.BookmarkManager.GetProjectBookmarks(this).ToArray());
			List<string> files = new List<string>();
			foreach (string fileName in FileService.GetOpenFiles()) {
				if (fileName != null && IsFileInProject(fileName)) {
					files.Add(fileName);
				}
			}
			properties.Set("files", files.ToArray());
			return properties;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:19,代码来源:AbstractProject.cs

示例8: GeneratePlainReport_1

		public void GeneratePlainReport_1()
		{
			ReportModel model = ReportModel.Create();
			Properties customizer = new Properties();
			
			customizer.Set("ReportLayout",GlobalEnums.ReportLayout.ListLayout);
			IReportGenerator generator = new GeneratePlainReport(model,customizer);
			generator.GenerateReport();
			
			XDocument doc1 = XDocument.Load(new XmlNodeReader (generator.XmlReport));
			
			XDocument doc2 = new XDocument();
			
			using (XmlWriter w = doc2.CreateWriter()){
				generator.XmlReport.Save (w);
			}
			XDocument doc3 = ReportGenerationHelper.XmlDocumentToXDocument(generator.XmlReport);
			Assert.IsNotNull (doc1);
			Assert.IsNotNull (doc2);
			Assert.IsNotNull (doc2);
			
			var sq = from si in doc1.Descendants() select si;
			Console.WriteLine ("xxxxx");
			foreach (XElement a in sq)
			{
				Console.WriteLine (a.Name);
		}
			
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:29,代码来源:GeneratePlainReportFixture_1.cs

示例9: NoThreadSetToTrueInProperties

		public void NoThreadSetToTrueInProperties()
		{
			Properties newProperties = new Properties();
			newProperties.Set<bool>(UnitTestingOptions.NoThreadProperty, true);
			UnitTestingOptions options = new UnitTestingOptions(newProperties);
			
			Assert.IsTrue(options.NoThread);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:8,代码来源:UnitTestingOptionsTestFixture.cs

示例10: CreateMemento

		/// <summary>
		/// Saves project preferences (currently opened files, bookmarks etc.) to the
		/// a property container.
		/// </summary>
		public virtual Properties CreateMemento()
		{
			WorkbenchSingleton.AssertMainThread();
			
			Properties properties = new Properties();
			properties.Set("bookmarks", ICSharpCode.SharpDevelop.Bookmarks.BookmarkManager.GetProjectBookmarks(this).ToArray());
			List<string> files = new List<string>();
			foreach (ICSharpCode.SharpDevelop.Gui.IViewContent vc
			         in ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.Workbench.ViewContentCollection)
			{
				string fileName = vc.FileName;
				if (fileName != null && IsFileInProject(fileName)) {
					files.Add(fileName);
				}
			}
			properties.Set("files", files.ToArray());
			return properties;
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:22,代码来源:AbstractProject.cs

示例11: SetUpFixture

		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				Properties p = new Properties();
				p.Set("XPathResultsListView.MatchColumn.Width", 10);
				p.Set("XPathResultsListView.LineColumn.Width", 20);
				queryControl.SetMemento(p);

				matchColumnWidthAfterLoad = queryControl.XPathResultsListView.Columns[0].Width;
				lineColumnWidthAfterLoad = queryControl.XPathResultsListView.Columns[1].Width;
				
				queryControl.XPathResultsListView.Columns[0].Width = 40;
				queryControl.XPathResultsListView.Columns[1].Width = 50;

				p = queryControl.CreateMemento();
				matchColumnWidthAfterSave = p.Get<int>("XPathResultsListView.MatchColumn.Width", 0);
				lineColumnWidthAfterSave = p.Get<int>("XPathResultsListView.LineColumn.Width", 0);
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:19,代码来源:XPathResultsListViewColumnWidthsTestFixture.cs

示例12: SetupDesigner

		public static ReportDesignerView SetupDesigner ()
		{
			
			ReportModel model = ReportModel.Create();
			Properties customizer = new Properties();
			customizer.Set("ReportLayout",GlobalEnums.ReportLayout.ListLayout);
			IReportGenerator generator = new GeneratePlainReport(model,customizer);
			generator.GenerateReport();
			
			OpenedFile file = FileService.CreateUntitledOpenedFile(GlobalValues.PlainFileName,new byte[0]);
			file.SetData(generator.Generated.ToArray());
			return SetupDesigner(file);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:13,代码来源:ViewCommands.cs

示例13: SetUpFixture

		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				Properties p = new Properties();
				p.Set("XPathQuery.LastQuery", "//w:Wix");
				expectedXPathsAfterLoad = new string[] {"//w:Fragment", "//w:Dialog"};
				p.Set("XPathQuery.History", expectedXPathsAfterLoad);
				queryControl.SetMemento(p);

				comboBoxTextAfterLoad = queryControl.XPathComboBox.Text;
				comboBoxItemsAfterLoad = GetComboBoxItems(queryControl.XPathComboBox);

				queryControl.XPathComboBox.Text = "*";
				queryControl.XPathComboBox.Items.Clear();
				queryControl.XPathComboBox.Items.Add("xs:schema");
				expectedXPathsAfterSave = GetComboBoxItems(queryControl.XPathComboBox);

				p = queryControl.CreateMemento();
				
				xpathQueryAfterSave = p.Get("XPathQuery.LastQuery", String.Empty);
				xpathsAfterSave = p.Get("XPathQuery.History", new string[0]);
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:23,代码来源:XPathQueryHistoryTestFixture.cs

示例14: SetUpFixture

        public void SetUpFixture()
        {
            using (XPathQueryControl queryControl = new XPathQueryControl()) {
                Properties p = new Properties();
                p.Set("NamespacesDataGridView.PrefixColumn.Width", 10);
                queryControl.SetMemento(p);

                prefixColumnWidthAfterLoad = queryControl.NamespacesDataGridView.Columns["prefixColumn"].Width;

                queryControl.NamespacesDataGridView.Columns["prefixColumn"].Width = 40;

                p = queryControl.CreateMemento();
                prefixColumnWidthAfterSave = p.Get<int>("NamespacesDataGridView.PrefixColumn.Width", 0);
            }
        }
开发者ID:BackupTheBerlios,项目名称:nantgui,代码行数:15,代码来源:NamespaceGridColumnWidthsLoadedTestFixture.cs

示例15: SetUpFixture

		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				Properties p = new Properties();
				expectedNamespaces = new List<XmlNamespace>();
				expectedNamespaces.Add(new XmlNamespace("f", "http://foo.com"));
				expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com"));
				
				List<string> namespaces = new List<string>();
				foreach (XmlNamespace xmlNamespace in expectedNamespaces) {
					namespaces.Add(xmlNamespace.ToString());
				}
				p.Set("Namespaces", namespaces.ToArray());
				queryControl.SetMemento(p);
				actualNamespaces = queryControl.GetNamespaces();
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:17,代码来源:NamespacePropertiesLoaded.cs


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