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

C# PropertyData类代码示例

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

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



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


示例16: HandleGetterAccessor

 protected override void HandleGetterAccessor(IInvocation invocation, PropertyData propertyData)
 {
     IPropertyDataInterceptor propertyInterceptor = _contentDataInterceptorHandler.GetPropertyInterceptor(propertyData.GetType());
     if (propertyInterceptor != null)
     {
         invocation.ReturnValue = propertyInterceptor.GetValue(propertyData, invocation.Method.ReturnType);
     }
     else if ((propertyData.Value == null) && invocation.Method.ReturnType.IsValueType)
     {
         invocation.ReturnValue = Activator.CreateInstance(invocation.Method.ReturnType);
     }
     else
     {
         invocation.ReturnValue = propertyData.Value;
     }
 }
开发者ID:VladimirLevchuk,项目名称:EPiProperties,代码行数:16,代码来源:DebugContentDataInterceptor.cs


示例17: ToCode_given_NameAndType_should_ReturnCode

        public void ToCode_given_NameAndType_should_ReturnCode()
        {
            //	#	Arrange.
            var sut = new PropertyData
            {
                Scope = Common.VisibilityScope.Public,
                Name = "MyName",
                SystemType = typeof(string)
            };

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

            //	#	Assert.
            Assert.AreEqual(1, res.Count);
            Assert.AreEqual(
                @"public System.String MyName{ get; set; }",
                res[0]);
        }
开发者ID:LosManos,项目名称:St4mpede,代码行数:19,代码来源:PropertyDataTest.cs


示例18: AddControl

        private void AddControl(string propertyName, PropertyData propertyValue, Guid propertyTypeId, string headerText, string parameters) {
            var propertyType = Core.PropertyType.GetPropertyType(propertyTypeId);
            var editControl = propertyType.EditControl;

            var loadControl = (PropertyEditorBase)LoadControl(editControl);
            loadControl.PropertyName = propertyName;
            loadControl.PropertyLabel = headerText;
            
            if (propertyValue != null) {
                loadControl.PropertyValue = propertyValue;
            }

            if (!string.IsNullOrEmpty(parameters)) {
                loadControl.Parameters = parameters;
            }

            EditControls.Controls.Add(loadControl);
            _controls.Add(loadControl);
        }
开发者ID:dummykam,项目名称:KalikoCMS.Core,代码行数:19,代码来源:EditPage.aspx.cs


示例19: CheckForErrors

    public string CheckForErrors(PropertyData propertyData, bool isBeforeAfter)
    {
        var propertyDefinition = propertyData.PropertyDefinition;
        if (propertyDefinition.SetMethod.Name == "set_Item" && propertyDefinition.SetMethod.Parameters.Count == 2 && propertyDefinition.SetMethod.Parameters[1].Name == "value")
        {
            return "Property is an indexer.";
        }
        if (propertyDefinition.SetMethod.IsAbstract)
        {
            return "Property is abstract.";
        }
        if (propertyData.CheckForEquality && (propertyData.BackingFieldReference == null) && (propertyDefinition.GetMethod == null))
        {
            return "When using CheckForEquality the property set must contain code that sets the backing field or have a property Get. Either the property contains no field set or it contains multiple sets and the names cannot be mapped to a property.";
        }
        if (isBeforeAfter && (propertyDefinition.GetMethod == null))
        {
            return "When using a before/after invoker the property have a 'get'.";
        }

        return null;
    }
开发者ID:shiftkey,项目名称:NotifyPropertyWeaver,代码行数:22,代码来源:ErrorChecker.cs


示例20: Map

        public string Map(PageData pageData, PropertyData propertyData)
        {
            //http://tedgustaf.com/en/blog/2009/9/parse-an-episerver-xhtml-property-with-dynamic-content/

            // Create a Property control which will parse the XHTML value for us
            var ctrl = new PropertyLongStringControl { PropertyData = propertyData };

            // Set the PropertyData to the property we want to parse
            // Initialize the Property control
            ctrl.SetupControl();

            // Create a string writer...
            var sw = new StringWriter();

            // ...and an HtmlTextWriter using that string writer
            var htw = new HtmlTextWriter(sw);

            // Render the Property control to get the markup
            ctrl.RenderControl(htw);

            return string.Format("\"{0}\"", Utils.EscapeStringForJs(sw.ToString()));
        }
开发者ID:troufster,项目名称:epi-json,代码行数:22,代码来源:PropertyXhtmlStringMap.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PropertyDeclaration类代码示例发布时间:2022-05-24
下一篇:
C# PropertyCollection类代码示例发布时间: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