當前位置: 首頁>>代碼示例>>C#>>正文


C# System.Property類代碼示例

本文整理匯總了C#中System.Property的典型用法代碼示例。如果您正苦於以下問題:C# Property類的具體用法?C# Property怎麽用?C# Property使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Property類屬於System命名空間,在下文中一共展示了Property類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Spec

 public Spec(Property[] props)
 {
     foreach (Property prop in props)
     {
         spec.Add(prop);
     }
 }
開發者ID:zedr0n,項目名稱:Screeps,代碼行數:7,代碼來源:Creep.cs

示例2: GetArgumentStringFor

 public string GetArgumentStringFor(Property property)
 {
     return RawArgumentString
         .Replace("#entity.Name#", property.Entity.Name)
         .Replace("#property.Name#", property.Name)
         .Replace("#property.Type#", property.Type);
 }
開發者ID:uQr,項目名稱:Visual-NHibernate,代碼行數:7,代碼來源:CustomAttribute.cs

示例3: establish_context

        public override void establish_context()
        {
            property = ReflectionHelper.GetAccessor(GetPropertyExpression());
            target = new PropertyEntity();

            sut = new Property<PropertyEntity, string>(property, "expected");
        }
開發者ID:roelofb,項目名稱:fluent-nhibernate,代碼行數:7,代碼來源:PropertySpecs.cs

示例4: ApplyPropertyTemplate

        protected virtual void ApplyPropertyTemplate(Property prop)
        {
            bool isReadOnly = false;
            bool isList = false;

            if (prop is ValueTypeProperty)
            {
                var vtp = (ValueTypeProperty)prop;
                isList = vtp.IsList;
                isReadOnly = vtp.IsCalculated;
            }
            else if (prop is CompoundObjectProperty)
            {
                isList = ((CompoundObjectProperty)prop).IsList;
            }
            else if (prop is ObjectReferenceProperty)
            {
                isList = ((ObjectReferenceProperty)prop).IsList();
            }
            else if (prop is CalculatedObjectReferenceProperty)
            {
                isReadOnly = true;
            }

            if (isList)
            {
                Properties.SimplePropertyListTemplate.Call(Host, ctx, prop);
            }
            else
            {
                Properties.SimplePropertyTemplate.Call(Host, ctx, prop, isReadOnly);
            }
        }
開發者ID:daszat,項目名稱:zetbox,代碼行數:33,代碼來源:Template.cs

示例5: VisitProperty

        public override bool VisitProperty(Property decl)
        {
            if(!AlreadyVisited(decl) && decl.ExplicitInterfaceImpl == null)
                CheckDuplicate(decl);

            return false;
        }
開發者ID:jijamw,項目名稱:CppSharp,代碼行數:7,代碼來源:CheckDuplicatedNamesPass.cs

示例6: Can_search_with_filters

        public void Can_search_with_filters()
        {
            Property property = new Property { Id = Guid.NewGuid(), Name = "Property Name", BedroomCount = 3 };
            Catalog catalog = new Catalog() { Id = Guid.NewGuid(), Type = "Waterfront", PropertyId = property.Id };

            using(var store = NewDocumentStore())
            using(var _session = store.OpenSession())
            {

                _session.Store(property);
                _session.Store(catalog);
                _session.SaveChanges();

                var catalogs = _session.Advanced.DocumentQuery<Catalog>().WhereEquals("Type", "Waterfront").Select(c => c.PropertyId);
                var properties = _session.Advanced.DocumentQuery<Property>();
                properties.OpenSubclause();
                var first = true;
                foreach (var guid in catalogs)
                {
                    if (first == false)
                        properties.OrElse(); 
                    properties.WhereEquals("__document_id", guid);
                    first = false;
                }
                properties.CloseSubclause();
                var refinedProperties = properties.AndAlso().WhereGreaterThanOrEqual("BedroomCount", "2").Select(p => p.Id);

                Assert.NotEqual(0, refinedProperties.Count());
            }
        }
開發者ID:j2jensen,項目名稱:ravendb,代碼行數:30,代碼來源:Samina.cs

示例7: AttachEditorComponents

		public static void AttachEditorComponents(Entity entity, string name, Property<Entity.Handle> target)
		{
			entity.Add(name, target);
			if (entity.EditorSelected != null)
			{
				Transform transform = entity.Get<Transform>("Transform");

				LineDrawer connectionLines = new LineDrawer { Serialize = false };
				connectionLines.Add(new Binding<bool>(connectionLines.Enabled, entity.EditorSelected));

				connectionLines.Add(new NotifyBinding(delegate()
				{
					connectionLines.Lines.Clear();
					Entity targetEntity = target.Value.Target;
					if (targetEntity != null)
					{
						Transform targetTransform = targetEntity.Get<Transform>("Transform");
						if (targetTransform != null)
						{
							connectionLines.Lines.Add
							(
								new LineDrawer.Line
								{
									A = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(transform.Position, connectionLineColor),
									B = new Microsoft.Xna.Framework.Graphics.VertexPositionColor(targetTransform.Position, connectionLineColor)
								}
							);
						}
					}
				}, transform.Position, target, entity.EditorSelected));

				entity.Add(connectionLines);
			}
		}
開發者ID:dsmo7206,項目名稱:Lemma,代碼行數:34,代碼來源:EntityConnectable.cs

示例8: TestSelectionViewModel

 private TestSelectionViewModel()
 {
     _sourceControlBrowser = Property.New(this, p => p.SourceControlTestBrowser, OnPropertyChanged);
     _fileSystemBrowser = Property.New(this, p => p.FileSystemTestBrowser, OnPropertyChanged);
     _manualEntry = Property.New(this, p => p.ManualEntry, OnPropertyChanged);
     _selectedTestCase = Property.New(this, p => p.SelectedTestCase, OnPropertyChanged);
 }
開發者ID:testpulse,項目名稱:TFSTestCaseAutomator,代碼行數:7,代碼來源:TestSelectionViewModel.cs

示例9: ModelMslEntityTypeMappingScalarProperty

 public ModelMslEntityTypeMappingScalarProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Property prop, string parentName)
     : base(_host)
 {
     this.ctx = ctx;
     this.prop = prop;
     this.parentName = parentName;
 }
開發者ID:daszat,項目名稱:zetbox,代碼行數:7,代碼來源:ModelMslEntityTypeMapping.ScalarProperty.cs

示例10: Configure

 protected virtual PropertyControlInfo Configure(Property property)
 {
     var info = PropertyControlInfo.CreateFor(property);
     if (Name != null) info.SetPropertyControlValue(property.Name, ControlInfoPropertyNames.DisplayName, Name);
     if (Description != null) info.SetPropertyControlValue(property.Name, ControlInfoPropertyNames.Description, Description);
     return info;
 }
開發者ID:Sigillatus,項目名稱:DinkPDN,代碼行數:7,代碼來源:ConfigurableAttribute.cs

示例11: OnValueChanged

        private void OnValueChanged(Property property, object newValue) {
            var field = GetType().GetField(property.Name);
            if(newValue != null && !newValue.GetType().IsSubtypeOrEqualTo(field.FieldType))
                return;

            field.SetValue(this, newValue);
        }
開發者ID:fachammer,項目名稱:DataPrototypes,代碼行數:7,代碼來源:DataPrototype.cs

示例12: SimplePropertyListTemplate

        public SimplePropertyListTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Property prop)
            : base(_host)
        {
			this.ctx = ctx;
			this.prop = prop;

        }
開發者ID:daszat,項目名稱:zetbox,代碼行數:7,代碼來源:SimplePropertyListTemplate.Designer.cs

示例13: Cursor

 public Cursor(Entity ent, String name)
     : base(ent, name)
 {
     m_Position = Entity.AddProperty<Vector3>("Position", Vector3.Zero);
     Broadphases.Input inp = XNAGame.Instance.GetBroadphase<Broadphases.Input>("Input");
     inp.MouseMoved += new Broadphases.MouseEventHandler(inp_MouseMoved);
 }
開發者ID:Quantumplation,項目名稱:Kannon,代碼行數:7,代碼來源:Cursor.cs

示例14: CollectProperties

 private void CollectProperties(object instance, PropertyDescriptor descriptor, List<Property> propertyCollection, bool automaticlyExpandObjects, string filter)
 {
     if (descriptor.Attributes[typeof(FlatAttribute)] == null)
     {
         Property property = new Property(instance, descriptor);
         if (descriptor.IsBrowsable)
         {
             //Add a property with Name: AutomaticlyExpandObjects
             Type propertyType = descriptor.PropertyType;
             if (automaticlyExpandObjects && propertyType.IsClass && !propertyType.IsArray && propertyType != typeof(string))
             {
                 propertyCollection.Add(new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter));
             }
             else if (descriptor.Converter.GetType() == typeof(ExpandableObjectConverter))
             {
                 propertyCollection.Add(new ExpandableProperty(instance, descriptor, automaticlyExpandObjects, filter));
             }
             else
                 propertyCollection.Add(property);
         }
     }
     else
     {
         instance = descriptor.GetValue(instance);
         PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(instance);
         foreach (PropertyDescriptor propertyDescriptor in properties)
         {
             CollectProperties(instance, propertyDescriptor, propertyCollection, automaticlyExpandObjects, filter);
         }
     }
 }
開發者ID:spolnik,項目名稱:DocumentEditor,代碼行數:31,代碼來源:PropertyCollection.cs

示例15: Create

        /// <summary>
        /// Create a new option.  
        /// </summary>
        /// <param name="opco">The three or four letter code for the operating company</param>
        /// <param name="name">The human-readable name for this option</param>
        /// <param name="slug">A unique slug for this option; optional, will be generated from the name if not provided</param>
        /// <param name="external">An third-party external identifier for this option (optional)</param>
        /// <param name="language">The two-letter ISO language for the option's name; defaults to the opco's language</param>
        /// <param name="relatedTo">The category or taxonomy using this option (optional)</param>
        /// <param name="relatedBy">The property by which this option is related to the relatedTo value</param>
        /// <returns>The newly created Option</returns>
        /// <exception cref="Terra.ServerException">
        /// <list type="bullet">
        /// <item>
        /// <description>If any of the parameters submitted are invalid, returns a status of Not Acceptable.</description>
        /// </item>
        /// <item>
        /// <description>If the slug already exists, returns a status of Conflict.</description>
        /// </item>
        /// <item>
        /// <description>If the operating company, relatedTo, or relatedBy does not exist, returns a status of Not Found.</description>
        /// </item>
        /// </list>
        /// </exception>
        public Option Create(string opco, string name, string slug = null, string external = null, string language = null,
            Node relatedTo = null, Property relatedBy = null)
        {
            var request = _client.Request("option", Method.POST).
                AddParameter("opco", opco).
                AddParameter("name", name).
                AddParameter("slug", slug).
                AddParameter("external", external).
                AddParameter("lang", language);

            if (relatedBy != null)
            {
                if (relatedTo is Taxonomy)
                {
                    request.AddParameter("taxonomy", ((Taxonomy)relatedTo).Slug);
                }
                else if (relatedTo is Category)
                {
                    request.AddParameter("category", ((Category)relatedTo).Slug);
                }

                request.AddParameter("property", relatedBy.Slug);
            }

            return request.MakeRequest<Option>();
        }
開發者ID:brilliantarc,項目名稱:Terra.cs,代碼行數:50,代碼來源:Options.cs


注:本文中的System.Property類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。