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

C# Properties类代码示例

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

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



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

示例1: AddOptionPanels

		void AddOptionPanels(IEnumerable<IDialogPanelDescriptor> dialogPanelDescriptors)
		{
			Properties newProperties = new Properties();
			newProperties.Set("Project", project);
			
			foreach (IDialogPanelDescriptor descriptor in dialogPanelDescriptors) {
				descriptors.Add(descriptor);
				if (descriptor != null && descriptor.DialogPanel != null && descriptor.DialogPanel.Control != null) { // may be null, if it is only a "path"
					descriptor.DialogPanel.CustomizationObject = newProperties;
					descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated);
					ICanBeDirty dirtyable = descriptor.DialogPanel as ICanBeDirty;
					if (dirtyable != null) {
						dirtyable.DirtyChanged += PanelDirtyChanged;
					}
					
					TabPage page = new TabPage(descriptor.Label);
					page.UseVisualStyleBackColor = true;
					page.Controls.Add(descriptor.DialogPanel.Control);
					tabControl.TabPages.Add(page);
				}
				
				if (descriptor.ChildDialogPanelDescriptors != null) {
					AddOptionPanels(descriptor.ChildDialogPanelDescriptors);
				}
			}
			// re-evaluate dirty because option pages can be dirty when they are newly loaded
			PanelDirtyChanged(null, null);
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:28,代码来源:ProjectOptionsView.cs


示例2: ErrorListPad

        public ErrorListPad()
        {
            instance = this;
            properties = PropertyService.NestedProperties("ErrorListPad");

            TaskService.Cleared += TaskServiceCleared;
            TaskService.Added   += TaskServiceAdded;
            TaskService.Removed += TaskServiceRemoved;
            TaskService.InUpdateChanged += delegate {
                if (!TaskService.InUpdate)
                    InternalShowResults();
            };

            SD.BuildService.BuildFinished += ProjectServiceEndBuild;
            SD.ProjectService.SolutionOpened += OnSolutionOpen;
            SD.ProjectService.SolutionClosed += OnSolutionClosed;
            errors = new ObservableCollection<SDTask>(TaskService.Tasks.Where(t => t.TaskType != TaskType.Comment));

            toolBar = ToolBarService.CreateToolBar(contentPanel, this, "/SharpDevelop/Pads/ErrorList/Toolbar");

            contentPanel.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
            contentPanel.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
            contentPanel.Children.Add(toolBar);
            contentPanel.Children.Add(errorView);
            Grid.SetRow(errorView, 1);
            errorView.ItemsSource = errors;
            errorView.MouseDoubleClick += ErrorViewMouseDoubleClick;
            errorView.Style = (Style)new TaskViewResources()["TaskListView"];
            errorView.ContextMenu = MenuService.CreateContextMenu(errorView, DefaultContextMenuAddInTreeEntry);

            errorView.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, ExecuteCopy, CanExecuteCopy));
            errorView.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, ExecuteSelectAll, CanExecuteSelectAll));

            InternalShowResults();
        }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:35,代码来源:ErrorListPad.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: WolfEntity

        public WolfEntity(Rectangle rect, Properties properties, GameScene gs)
        {
            position.X = rect.X;
            position.Y = rect.Y;

            spriteChoice.texture = spritesheet;
            animState.AnimationName = "alive";
            hitbox = new Rectangle (0, 0, rect.Width, rect.Height);
            spriteChoice.rect = anim.GetRectangle (animState);
            Visible = true;
            inverseMass = 5;

            health = 10;
            contactDamage = 2;
            fireDefense = 0;
            waterDefense = 0;
            earthDefense = 1;
            airDefense = 0;

            this.properties = properties;
            this.gs = gs;

            baseline = hitbox.Bottom;
            seePlayer = false;
            positionPushTimer = new TimeSpan(0,0,0,0,1000);

            backtracking = false;
        }
开发者ID:jgeumlek,项目名称:Element-Chronicles-Prototype,代码行数:28,代码来源:WolfEntity.cs


示例5: LazyLoadDoozer

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


示例6: OperatorHasTest2

        public void OperatorHasTest2()
        {
            var p1 = new Properties();
            p1.SetProperty("name", "jack");

            var p2 = new Properties();
            p2.SetProperty("name", "jill");
            p2.SetProperty("count", 3);

            var node1 = Node.CreateNode();
            var node2 = Node.CreateNode();
            var node3 = Node.CreateNode();

            var rel1 = node1.CreateRelationshipTo(node2, "like", p1);
            var rel2 = node1.CreateRelationshipTo(node3, "like", p2);

            var cypher = new Cypher();
            cypher.Start(s => s.Relationship("rel", rel1.Id	, rel2.Id));
            cypher.Where(w => w.RelationshipHas("rel", "count"));
            cypher.Return(r => r.Relationship("rel"));

            var result = cypher.Execute();

            Assert.IsTrue(result.Count() == 1);
            Assert.IsTrue(result.First().Field<Relationship>("rel") == rel2);
        }
开发者ID:yonglehou,项目名称:Neo4jRestNet,代码行数:26,代码来源:CypherWhereTest.cs


示例7: Create

		public static AddInReference Create(Properties properties, string hintPath)
		{
			AddInReference reference = new AddInReference(properties["addin"]);
			string version = properties["version"];
			if (version != null && version.Length > 0) {
				int pos = version.IndexOf('-');
				if (pos > 0) {
					reference.minimumVersion = ParseVersion(version.Substring(0, pos), hintPath);
					reference.maximumVersion = ParseVersion(version.Substring(pos + 1), hintPath);
				} else {
					reference.maximumVersion = reference.minimumVersion = ParseVersion(version, hintPath);
				}
				
				if (reference.Name == "SharpDevelop") {
					// HACK: SD 4.1 AddIns work with SharpDevelop 4.2
					// Because some 4.1 AddIns restrict themselves to SD 4.1, we extend the
					// supported SD range.
					if (reference.maximumVersion == new Version("4.1")) {
						reference.maximumVersion = new Version("4.2");
					}
				}
			}
			reference.requirePreload = string.Equals(properties["requirePreload"], "true", StringComparison.OrdinalIgnoreCase);
			return reference;
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:25,代码来源:AddInReference.cs


示例8: SetProperties

        private static Properties SetProperties()
        {
            const string mzTabProperties = "conf/mztab/mztab.properties";
            const string formatProperties = "conf/mztab/mztab_format_error.properties";
            const string logicalProperties = "conf/mztab/mztab_logical_error.properties";
            const string crosscheckProperties = "conf/mztab/mztab_crosscheck_error.properties";
            try{
                properties = new Properties();
                StreamReader reader = new StreamReader(mzTabProperties);
                properties.load(reader);
                reader.Close();

                reader = new StreamReader(formatProperties);
                properties.load(reader);
                reader.Close();

                reader = new StreamReader(logicalProperties);
                properties.load(reader);
                reader.Close();

                reader = new StreamReader(crosscheckProperties);
                properties.load(reader);
                reader.Close();

                return properties;
            }
            catch (FileNotFoundException e){
                Console.Error.WriteLine(e.Message);
            }
            catch (IOException e){
                Console.Error.WriteLine(e.Message);
            }

            return null;
        }
开发者ID:neuhauser,项目名称:perseus-plugins,代码行数:35,代码来源:MZTabProperties.cs


示例9: SetRowProperties

 internal void SetRowProperties(DataRow dr, Properties.VideoQualityTypeProperties row)
 {
     row.ID = Convert.ToByte(dr["ID"]);
     row.Description = Convert.ToString(dr["Description"]);
     row.Exists = true;
     row.HasChanged = false;
 }
开发者ID:bedashii,项目名称:ReturnMedz,代码行数:7,代码来源:VideoQualityTypeData.cs


示例10: SetRowProperties

 internal void SetRowProperties(DataRow dr, Properties.AudioLanguagesProperties row)
 {
     row.ID = Convert.ToInt16(dr["ID"]);
     row.Description = Convert.ToString(dr["Description"]);
     row.Exists = true;
     row.HasChanged = false;
 }
开发者ID:bedashii,项目名称:ReturnMedz,代码行数:7,代码来源:AudioLanguagesData.cs


示例11: ErrorListPad

		public ErrorListPad()
		{
			instance = this;
			properties = PropertyService.Get("ErrorListPad", new Properties());
			
			RedrawContent();
			ResourceService.LanguageChanged += delegate { RedrawContent(); };
			
			TaskService.Cleared += new EventHandler(TaskServiceCleared);
			TaskService.Added   += new TaskEventHandler(TaskServiceAdded);
			TaskService.Removed += new TaskEventHandler(TaskServiceRemoved);
			TaskService.InUpdateChanged += delegate {
				if (!TaskService.InUpdate)
					InternalShowResults();
			};
			
			ProjectService.BuildFinished  += ProjectServiceEndBuild;
			ProjectService.SolutionLoaded += OnSolutionOpen;
			ProjectService.SolutionClosed += OnSolutionClosed;
			
			taskView.CreateControl();
			contentPanel.Controls.Add(taskView);
			
			toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/ErrorList/Toolbar");
			toolStrip.Stretch   = true;
			toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
			
			contentPanel.Controls.Add(toolStrip);
			
			InternalShowResults();
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:31,代码来源:ErrorListPad.cs


示例12: WorldmapSector

    public WorldmapSector(string Filename)
    {
        List WorldMapL = Util.Load(Filename, "supertux-worldmap");

        LispIterator iter = new LispIterator(WorldMapL);
        while(iter.MoveNext()) {
            switch(iter.Key) {
                case "properties":
                    Properties Props = new Properties(iter.List);
                    Props.Get("name", ref Name);
                    Props.Get("music", ref Music);
                    Console.WriteLine("Name: " + Name);
                    Console.WriteLine("Music: " + Music);
                    Props.PrintUnusedWarnings();
                    break;
                case "spawnpoint":
                    WorldmapSpawnPoint SpawnPoint = new WorldmapSpawnPoint();
                    SpawnPoint.Parse(iter.List);
                    SpawnPoints.Add(SpawnPoint.Name, SpawnPoint);
                    break;
                default:
                    GameObject Object = ParseObject(iter.Key, iter.List);
                    if(Object != null)
                        AddObject(Object);
                    break;
            }
        }

        Player = new WorldmapTux(this);
        AddObject(Player);
        Spawn("default");
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:32,代码来源:WorldMapSector.cs


示例13: Load

        public override void Load()
        {
            Name = "TDSMPlugin Example";
            Description = "Plugin Example for TDSM.";
            Author = "DeathCradle";
            Version = "1";
            TDSMBuild = 32; //You put here the release this plugin was made/build for.

            plugin = this;

            string pluginFolder = Statics.PluginPath + Path.DirectorySeparatorChar + "TDSM";
            //Create folder if it doesn't exist
            CreateDirectory(pluginFolder);

            //setup a new properties file
            properties = new Properties(pluginFolder + Path.DirectorySeparatorChar + "tdsmplugin.properties");
            properties.Load();
            properties.pushData(); //Creates default values if needed. [Out-Dated]
            properties.Save();

            //read properties data
            spawningAllowed = properties.SpawningCancelled;
            tileBreakageAllowed = properties.TileBreakage;
            explosivesAllowed = properties.ExplosivesAllowed;
        }
开发者ID:Dyrian,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:25,代码来源:TDSMPlugin.cs


示例14: ReadSampleBlock

        public static List<Properties> ReadSampleBlock(Stream source)
        {
            BinaryReader sourceReader = new BinaryReader(source);
            byte[] sourceData = sourceReader.ReadBytes(0x2000);
            int count = 256;
            List<Properties> result = new List<Properties>();

            // load sample block
            using (MemoryStream tempMem = new MemoryStream(sourceData))
            {
                BinaryReaderEx dataReader = new BinaryReaderEx(tempMem);
                for (int i = 0; i < count; i++)
                {
                    Properties props = new Properties();
                    props.Channel = dataReader.ReadByte();
                    props.Flag01 = dataReader.ReadByte();
                    props.Frequency = dataReader.ReadUInt16S();
                    props.Volume = dataReader.ReadByte();
                    props.Panning = dataReader.ReadByte();
                    props.SampleOffset = dataReader.ReadInt24S() * 2;
                    props.SampleLength = ((dataReader.ReadInt24S() * 2) - props.SampleOffset);
                    props.Value0C = dataReader.ReadInt16S();
                    props.Flag0E = dataReader.ReadByte();
                    props.Flag0F = dataReader.ReadByte();
                    props.SizeInBlocks = dataReader.ReadInt16S();
                    result.Add(props);
                }
            }

            return result;
        }
开发者ID:NoOnes2,项目名称:scharfrichter,代码行数:31,代码来源:RF5C400.cs


示例15: PropertyChangedEventArgs

		public PropertyChangedEventArgs(Properties properties, string key, object oldValue, object newValue)
		{
			this.properties = properties;
			this.key        = key;
			this.oldValue   = oldValue;
			this.newValue   = newValue;
		}
开发者ID:stophun,项目名称:fdotoolbox,代码行数:7,代码来源:PropertyChangedEvent.cs


示例16: CreateRelationshipWithProperties

        public void CreateRelationshipWithProperties()
        {
            var node1 = Node.CreateNode();
            var node2 = Node.CreateNode();

            var p = new Properties();
            p.SetProperty("name", "jack");
            p.SetProperty("age", 12);

            var cypher = new Cypher();
            cypher.Start(s => s.Node("n1", node1.Id).Node("n2", node2.Id));

            cypher.Create(c => c.Node("n1").To("r", "like", p).Node("n2"));

            cypher.Return(r => r.Relationship("r"));

            var result = cypher.Execute();

            Assert.IsTrue(result.Count() == 1);
            Assert.IsTrue(result.First().Field<Relationship>("r") != null);
            var rel = result.First().Field<Relationship>("r");
            Assert.IsTrue(rel.StartNode == node1);
            Assert.IsTrue(rel.EndNode == node2);
            Assert.IsTrue(rel.GetProperty<string>("name") == "jack");
            Assert.IsTrue(rel.GetProperty<int>("age") == 12);
        }
开发者ID:yonglehou,项目名称:Neo4jRestNet,代码行数:26,代码来源:CypherCreateTest.cs


示例17: 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


示例18: Initialize

        protected override void Initialize()
        {
            base.Initialize();

            var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (null != mcs) {
                var id = new CommandID(GuidList.GuidCmdSet, (int)PkgCmdIDList.FormatDocumentCommand);
                _formatDocMenuCommand = new OleMenuCommand(FormatDocumentCallback, id);
                mcs.AddCommand(_formatDocMenuCommand);
                _formatDocMenuCommand.BeforeQueryStatus += OnBeforeQueryStatus;

                id = new CommandID(GuidList.GuidCmdSet, (int)PkgCmdIDList.FormatSelectionCommand);
                _formatSelMenuCommand = new OleMenuCommand(FormatSelectionCallback, id);
                mcs.AddCommand(_formatSelMenuCommand);
                _formatSelMenuCommand.BeforeQueryStatus += OnBeforeQueryStatus;
            }

            _dte = (DTE)GetService(typeof(DTE));

            _documentEventListener = new DocumentEventListener(this);
            _documentEventListener.BeforeSave += OnBeforeDocumentSave;

            if (_dte.RegistryRoot.Contains("VisualStudio")) {
                _isCSharpEnabled = true;
            }

            _props = _dte.Properties["AStyle Formatter", "General"];
            _props.Item("IsCSarpEnabled").Value = _isCSharpEnabled;
        }
开发者ID:nelabidi,项目名称:astyle-extension,代码行数:29,代码来源:AStyleExtensionPackage.cs


示例19: OperatorInTest

        public void OperatorInTest()
        {
            var p1 = new Properties();
            p1.SetProperty("name", "jack");
            p1.SetProperty("count", 3);

            var p2 = new Properties();
            p2.SetProperty("name", "jill");
            p2.SetProperty("count", 3);

            var node1 = Node.CreateNode(p1);
            var node2 = Node.CreateNode(p1);
            var node3 = Node.CreateNode(p2);

            var cypher = new Cypher();
            cypher.Start(s => s.Node("node", node1.Id, node2.Id, node3.Id));
            cypher.Where(w => w.Node("node").Property("name").In("jack"));
            cypher.Return(r => r.Node("node"));

            var result = cypher.Execute();

            Assert.IsTrue(result.Count() == 2);
            Assert.IsTrue(result.First().Field<Node>("node") == node1);
            Assert.IsTrue(result.ElementAt(1).Field<Node>("node") == node2);
        }
开发者ID:yonglehou,项目名称:Neo4jRestNet,代码行数:25,代码来源:CypherWhereTest.cs


示例20: SetNodeProperty2

        public void SetNodeProperty2()
        {
            var now = DateTime.Now;

            var p = new Properties();
            p.SetProperty("name", "jack");
            p.SetProperty("age", 12);
            p.SetProperty("date", now);

            var node1 = Node.CreateNode();

            var cypher = new Cypher();

            cypher.Start(s => s.Node("node1", node1.Id));
            cypher.Set(s => s.Node("node1", p));
            cypher.Return(r => r.Node("node1"));

            var results = cypher.Execute();

            var n1 = results.Rows[0].Field<Node>("node1");

            Assert.IsTrue(n1.GetProperty<string>("name") == "jack");
            Assert.IsTrue(n1.GetProperty<int>("age") == 12);
            Assert.IsTrue(n1.GetProperty<DateTime>("date") == now);
        }
开发者ID:kodo65,项目名称:Neo4jRestNet,代码行数:25,代码来源:CypherSetTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Property类代码示例发布时间:2022-05-24
下一篇:
C# PropagationFlags类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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