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


C# PropertyData类代码示例

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


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

示例1: Add

        public void Add(PropertyData propertyData) {
            if (this.propertyData != null) {
                throw new AuditException("Only one property can be added!");
            }

            this.propertyData = propertyData;
        }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:7,代码来源:SinglePropertyMapper.cs

示例2: Add

 public void Add(PropertyData propertyData)
 {
     var single = new SinglePropertyMapper();
     single.Add(propertyData);
     Properties.Add(propertyData, single);
     PropertyDatas.Add(propertyData.Name, propertyData);
 }
开发者ID:umittal,项目名称:MunimJi,代码行数:7,代码来源:MultiPropertyMapper.cs

示例3: OneToOneNotOwningMapper

 public OneToOneNotOwningMapper(String owningReferencePropertyName, String owningEntityName,
     PropertyData propertyData)
 {
     this.owningReferencePropertyName = owningReferencePropertyName;
     this.owningEntityName = owningEntityName;
     this.propertyData = propertyData;
 }
开发者ID:hazzik,项目名称:nhcontrib-all,代码行数:7,代码来源:OneToOneNotOwningMapper.cs

示例4: PropertyWeaver

 public PropertyWeaver(MsCoreReferenceFinder msCoreReferenceFinder, Logger logger, PropertyData propertyData, TypeNode typeNode)
 {
     this.msCoreReferenceFinder = msCoreReferenceFinder;
     this.logger = logger;
     this.propertyData = propertyData;
     this.typeNode = typeNode;
 }
开发者ID:marcuswhit,项目名称:NotifyPropertyWeaver,代码行数:7,代码来源:PropertyWeaver.cs

示例5: ToOneIdMapper

 public ToOneIdMapper(IIdMapper delegat, PropertyData propertyData, String referencedEntityName, bool nonInsertableFake)
 {
     this.delegat = delegat;
     this.propertyData = propertyData;
     this.referencedEntityName = referencedEntityName;
     this.nonInsertableFake = nonInsertableFake;
 }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:7,代码来源:ToOneIdMapper.cs

示例6: CheckForWarning

    public string CheckForWarning(PropertyData propertyData, InvokerTypes invokerType)
    {
        var propertyDefinition = propertyData.PropertyDefinition;
        var setMethod = propertyDefinition.SetMethod;

        if (setMethod.Name == "set_Item" && setMethod.Parameters.Count == 2 && setMethod.Parameters[1].Name == "value")
        {
            return "Property is an indexer.";
        }
        if (setMethod.Parameters.Count > 1)
        {
            return "Property takes more than one parameter.";
        }
        if (setMethod.IsAbstract)
        {
            return "Property is abstract.";
        }
        if ((propertyData.BackingFieldReference == null) && (propertyDefinition.GetMethod == null))
        {
            return "Property has no field set logic or it contains multiple sets and the names cannot be mapped to a property.";
        }
        if (invokerType == InvokerTypes.BeforeAfter && (propertyDefinition.GetMethod == null))
        {
            return "When using a before/after invoker the property have a 'get'.";
        }
        return null;
    }
开发者ID:Fody,项目名称:PropertyChanged,代码行数:27,代码来源:WarningChecker.cs

示例7: Should_Return_False_For_PropertyInfo_Objects_With_Different_Names

 public void Should_Return_False_For_PropertyInfo_Objects_With_Different_Names()
 {
     var type = new { Prop1 = 10, Prop2 = 20 }.GetType();
       var propData1 = new PropertyData(type.GetProperties()[0]);
       var propData2 = new PropertyData(type.GetProperties()[1]);
       Assert.IsFalse(propData1.Equals(propData2));
 }
开发者ID:jbrechtel,项目名称:plant,代码行数:7,代码来源:PropertyDataTest.cs

示例8: ToCode_given_CommentAndNameAndType_should_ReturnCode

        public void ToCode_given_CommentAndNameAndType_should_ReturnCode()
        {
            //	#	Arrange.
            var sut = new PropertyData
            {
                Comment = new CommentData("MyComment"),
                Scope = Common.VisibilityScope.Private,
                Name = "CustomerID",
                SystemType = typeof(int)
            };

            //	#	Act.
            var res = sut.ToCode();

            //	#	Assert.
            Assert.AreEqual(3, res.Count);
            CollectionAssert.AreEqual(
                new[]
                {
                    "/// <summary> MyComment",
                    "/// </summary>",
                    "private System.Int32 CustomerID{ get; set; }"
                },
                res.ToList());
        }
开发者ID:LosManos,项目名称:St4mpede,代码行数:25,代码来源:PropertyDataTest.cs

示例9: PropertyWeaver

 public PropertyWeaver(ModuleWeaver moduleWeaver, PropertyData propertyData, TypeNode typeNode, TypeSystem typeSystem )
 {
     this.moduleWeaver = moduleWeaver;
     this.propertyData = propertyData;
     this.typeNode = typeNode;
     this.typeSystem = typeSystem;
 }
开发者ID:jbruening,项目名称:PropertyChanged,代码行数:7,代码来源:PropertyWeaver.cs

示例10: CommonCollectionMapperData

 public CommonCollectionMapperData(AuditEntitiesConfiguration verEntCfg, String versionsMiddleEntityName,
                                   PropertyData collectionReferencingPropertyData, MiddleIdData referencingIdData,
                                   IRelationQueryGenerator queryGenerator) {
     this._verEntCfg = verEntCfg;
     this._versionsMiddleEntityName = versionsMiddleEntityName;
     this._collectionReferencingPropertyData = collectionReferencingPropertyData;
     this._referencingIdData = referencingIdData;
     this._queryGenerator = queryGenerator;
 }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:9,代码来源:CommonCollectionMapperData.cs

示例11: PropertyValue

        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyValue"/> class.
        /// </summary>
        /// <param name="propertyData">The property data.</param>
        /// <param name="name">The name of the property.</param>
        /// <param name="value">The value of the property.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="propertyData"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">The <paramref name="name"/> is <c>null</c> or whitespace.</exception>
        public PropertyValue(PropertyData propertyData, string name, object value)
        {
            Argument.IsNotNull("propertyData", propertyData);
            Argument.IsNotNullOrWhitespace("name", name);

            PropertyData = propertyData;
            Name = name;
            Value = value;
        }
开发者ID:JaysonJG,项目名称:Catel,代码行数:17,代码来源:PropertyValue.cs

示例12: AddComponent

        public ICompositeMapperBuilder AddComponent(PropertyData propertyData, String componentClassName) {
            if (Properties[propertyData] != null) {
			    // This is needed for second pass to work properly in the components mapper
                return (ICompositeMapperBuilder) Properties[propertyData];
            }

            ComponentPropertyMapper componentMapperBuilder = new ComponentPropertyMapper(propertyData, componentClassName);
		    AddComposite(propertyData, componentMapperBuilder);

            return componentMapperBuilder;
        }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:11,代码来源:MultiPropertyMapper.cs

示例13: Map

        public string Map(PageData pageData, PropertyData propertyData)
        {
            var propertyDate = propertyData as PropertyDate;
            if (propertyDate != null)
            {
                var d = propertyDate.Date;
                return d != default(DateTime) ? UnixTicks(d).ToString(CultureInfo.InvariantCulture) : (-1).ToString(CultureInfo.InvariantCulture);
            }

            return String.Empty;
        }
开发者ID:troufster,项目名称:epi-json,代码行数:11,代码来源:PropertyDateMap.cs

示例14: HandleSetterAccessor

 protected override void HandleSetterAccessor(IInvocation invocation, PropertyData propertyData)
 {
     IPropertyDataInterceptor propertyInterceptor = _contentDataInterceptorHandler.GetPropertyInterceptor(propertyData.GetType());
     if (propertyInterceptor != null)
     {
         Type parameterType = invocation.Method.GetParameters()[0].ParameterType;
         propertyInterceptor.SetValue(propertyData, parameterType, invocation.Arguments[0]);
     }
     else
     {
         propertyData.Value = invocation.Arguments[0];
     }
 }
开发者ID:VladimirLevchuk,项目名称:EPiProperties,代码行数:13,代码来源:DebugContentDataInterceptor.cs

示例15: IsIndexer

    public void IsIndexer()
    {
        var checker = new ModuleWeaver();
        var propertyDefinition = DefinitionFinder.FindType<IndexerClass>()
            .Properties
            .First();

        var propertyData = new PropertyData
        {
            PropertyDefinition = propertyDefinition,
        };
        var message = checker.CheckForWarning(propertyData, InvokerTypes.String);
        Approvals.Verify(message);
    }
开发者ID:Fody,项目名称:PropertyChanged,代码行数:14,代码来源:IndexerCheckerTest.cs


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