本文整理匯總了C#中System.TypeExtension類的典型用法代碼示例。如果您正苦於以下問題:C# TypeExtension類的具體用法?C# TypeExtension怎麽用?C# TypeExtension使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TypeExtension類屬於System命名空間,在下文中一共展示了TypeExtension類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetValue
private static object GetValue(TypeExtension typeExtension, MemberAccessor member, string elemName, out bool isSet)
{
var value = typeExtension[member.Name][elemName].Value;
isSet = value != null;
return value;
}
示例2: GetMapIgnore
public virtual bool GetMapIgnore(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return
TypeHelper.IsScalar(member.Type) == false;// ||
//(member.MemberInfo is FieldInfo && ((FieldInfo)member.MemberInfo).IsLiteral);
}
示例3: GetInheritanceDiscriminator
public override bool GetInheritanceDiscriminator(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var value = GetValue(typeExtension, member, "IsInheritanceDiscriminator", out isSet);
if (value != null)
return TypeExtension.ToBoolean(value);
return base.GetInheritanceDiscriminator(typeExtension, member, out isSet);
}
示例4: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var value = GetValue(typeExtension, member, "FieldStorage", out isSet);
if (value != null)
return value.ToString();
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例5: GetMapIgnore
public override bool GetMapIgnore(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var value = GetValue(typeExtension, member, "MapIgnore", out isSet);
if (value != null)
return TypeExtension.ToBoolean(value);
return base.GetMapIgnore(typeExtension, member, out isSet) || GetAssociation(typeExtension, member) != null;
}
示例6: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
foreach (var p in _list)
{
var name = p.GetFieldStorage(typeExtension, member, out isSet);
if (isSet)
return name;
}
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例7: GetInheritanceDiscriminator
public override bool GetInheritanceDiscriminator(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
foreach (var p in _list)
{
var value = p.GetInheritanceDiscriminator(typeExtension, member, out isSet);
if (isSet)
return value;
}
return base.GetInheritanceDiscriminator(typeExtension, member, out isSet);
}
示例8: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
if (IsLinqObject(member.TypeAccessor.Type))
{
var a = member.GetAttribute<ColumnAttribute>();
if (a != null && !string.IsNullOrEmpty(a.Name))
{
isSet = true;
return a.Storage;
}
}
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例9: GetFieldStorage
public override string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
var a = member.GetAttribute<MapFieldAttribute>();
if (a != null)
{
isSet = true;
return a.Storage;
}
foreach (MapFieldAttribute attr in GetMapFieldAttributes(member.TypeAccessor))
{
if (string.Equals(attr.OrigName, member.Name, StringComparison.InvariantCultureIgnoreCase))
{
isSet = true;
return attr.Storage;
}
}
return base.GetFieldStorage(typeExtension, member, out isSet);
}
示例10: GetFieldStorage
public virtual string GetFieldStorage(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return null;
}
示例11: GetFieldName
public virtual string GetFieldName(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return member.Name;
}
示例12: GetInheritanceMapping
public virtual InheritanceMappingAttribute[] GetInheritanceMapping(Type type, TypeExtension typeExtension)
{
return Array<InheritanceMappingAttribute>.Empty;
}
示例13: GetAssociation
public virtual Association GetAssociation(TypeExtension typeExtension, MemberAccessor member)
{
return null;
}
示例14: GetPrimaryKeyFields
protected static List<string> GetPrimaryKeyFields(MappingSchema schema, TypeAccessor ta, TypeExtension tex)
{
var mdp = schema.MetadataProvider;
var keys = new List<string>();
foreach (MemberAccessor sma in ta)
{
bool isSetFlag;
mdp.GetPrimaryKeyOrder(ta.Type, tex, sma, out isSetFlag);
if (isSetFlag)
{
var name = mdp.GetFieldName(tex, sma, out isSetFlag);
keys.Add(name);
}
}
return keys;
}
示例15: GetSqlIgnore
public virtual bool GetSqlIgnore(TypeExtension typeExtension, MemberAccessor member, out bool isSet)
{
isSet = false;
return false;
}