本文整理汇总了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;
}
示例2: Add
public void Add(PropertyData propertyData)
{
var single = new SinglePropertyMapper();
single.Add(propertyData);
Properties.Add(propertyData, single);
PropertyDatas.Add(propertyData.Name, propertyData);
}
示例3: OneToOneNotOwningMapper
public OneToOneNotOwningMapper(String owningReferencePropertyName, String owningEntityName,
PropertyData propertyData)
{
this.owningReferencePropertyName = owningReferencePropertyName;
this.owningEntityName = owningEntityName;
this.propertyData = propertyData;
}
示例4: PropertyWeaver
public PropertyWeaver(MsCoreReferenceFinder msCoreReferenceFinder, Logger logger, PropertyData propertyData, TypeNode typeNode)
{
this.msCoreReferenceFinder = msCoreReferenceFinder;
this.logger = logger;
this.propertyData = propertyData;
this.typeNode = typeNode;
}
示例5: ToOneIdMapper
public ToOneIdMapper(IIdMapper delegat, PropertyData propertyData, String referencedEntityName, bool nonInsertableFake)
{
this.delegat = delegat;
this.propertyData = propertyData;
this.referencedEntityName = referencedEntityName;
this.nonInsertableFake = nonInsertableFake;
}
示例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;
}
示例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));
}
示例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());
}
示例9: PropertyWeaver
public PropertyWeaver(ModuleWeaver moduleWeaver, PropertyData propertyData, TypeNode typeNode, TypeSystem typeSystem )
{
this.moduleWeaver = moduleWeaver;
this.propertyData = propertyData;
this.typeNode = typeNode;
this.typeSystem = typeSystem;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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];
}
}
示例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);
}