本文整理汇总了C#中IValue.SetTypeUsingReflection方法的典型用法代码示例。如果您正苦于以下问题:C# IValue.SetTypeUsingReflection方法的具体用法?C# IValue.SetTypeUsingReflection怎么用?C# IValue.SetTypeUsingReflection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValue
的用法示例。
在下文中一共展示了IValue.SetTypeUsingReflection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateIdentifierProperty
private void CreateIdentifierProperty(PersistentClass pclass, IValue identifier, string propName)
{
identifier.SetTypeUsingReflection(pclass.MappedClass == null ? null : pclass.MappedClass.AssemblyQualifiedName,
propName, DefaultValues.Accessor);
var property = new Property(identifier) {
Name = propName,
PropertyAccessorName = DefaultValues.Accessor,
Cascade = mapper.Mappings.DefaultCascade,
IsUpdateable = true,
IsInsertable = true,
IsOptimisticLocked = true,
Generation = PropertyGeneration.Never
};
pclass.IdentifierProperty = property;
}
示例2: CreateProperty
private static Property CreateProperty(IValue value, PropertyInfo info, string className)
{
if (!string.IsNullOrEmpty(className) && value.IsSimpleValue) {
value.SetTypeUsingReflection(className, info.Name, DefaultValues.Accessor);
}
return new Property {Name = info.Name, Value = value};
}
示例3: CreateProperty
protected Mapping.Property CreateProperty(IValue value, string propertyName, System.Type parentClass,
XmlNode subnode)
{
if (parentClass != null && value.IsSimpleValue)
value.SetTypeUsingReflection(parentClass.AssemblyQualifiedName, propertyName, PropertyAccess(subnode));
// This is done here 'cos we might only know the type here (ugly!)
if (value is ToOne)
{
ToOne toOne = (ToOne) value;
string propertyRef = toOne.ReferencedPropertyName;
if (propertyRef != null)
mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
}
value.CreateForeignKey();
Mapping.Property prop = new Mapping.Property();
prop.Value = value;
BindProperty(subnode, prop);
return prop;
}
示例4: CreateProperty
private Property CreateProperty(IEntityPropertyMapping propertyMapping, string propertyOwnerClassName, IValue value, IDictionary<string, MetaAttribute> inheritedMetas)
{
if (string.IsNullOrEmpty(propertyMapping.Name))
{
throw new MappingException("A property mapping must define the name attribute [" + propertyOwnerClassName + "]");
}
var propertyAccessorName = GetPropertyAccessorName(propertyMapping.Access);
if (!string.IsNullOrEmpty(propertyOwnerClassName) && value.IsSimpleValue)
value.SetTypeUsingReflection(propertyOwnerClassName, propertyMapping.Name, propertyAccessorName);
var property = new Property
{
Name = propertyMapping.Name,
PropertyAccessorName = propertyAccessorName,
Value = value,
IsLazy = propertyMapping.IsLazyProperty,
IsOptimisticLocked = propertyMapping.OptimisticLock,
MetaAttributes = GetMetas(propertyMapping, inheritedMetas)
};
return property;
}
示例5: CreateProperty
protected Property CreateProperty(IValue value, string propertyName, string className,
XmlNode subnode, IDictionary<string, MetaAttribute> inheritedMetas)
{
if (string.IsNullOrEmpty(propertyName))
{
throw new MappingException(subnode.LocalName + " mapping must defined a name attribute [" + className + "]");
}
if (!string.IsNullOrEmpty(className) && value.IsSimpleValue)
value.SetTypeUsingReflection(className, propertyName, PropertyAccess(subnode));
// This is done here 'cos we might only know the type here (ugly!)
var toOne = value as ToOne;
if (toOne != null)
{
string propertyRef = toOne.ReferencedPropertyName;
if (propertyRef != null)
mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
}
value.CreateForeignKey();
var prop = new Property {Value = value};
BindProperty(subnode, prop, inheritedMetas);
return prop;
}