本文整理汇总了C#中MemberAccessor类的典型用法代码示例。如果您正苦于以下问题:C# MemberAccessor类的具体用法?C# MemberAccessor怎么用?C# MemberAccessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemberAccessor类属于命名空间,在下文中一共展示了MemberAccessor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Gremlin2,项目名称:bltoolkit,代码行数:8,代码来源:ExtensionMetadataProvider.cs
示例2: ToDefinition
public ToDefinition(MemberInfo memberInfo)
{
Require.NotNull(memberInfo, "memberInfo");
// We need a getter as well for situations where we are mapping into an existing object and need to merge into
// 'child' members, rather than just creating new instances of them.
Accessor = new MemberAccessor(memberInfo);
}
开发者ID:jonclare,项目名称:KodeKandy,代码行数:8,代码来源:ToDefinition.cs
示例3: 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);
}
开发者ID:sscctech,项目名称:bltoolkit,代码行数:8,代码来源:MetadataProviderBase.cs
示例4: GetValue
private static object GetValue(ObjectMapper mapper, MemberAccessor member, string elemName, out bool isSet)
{
object value = mapper.Extension[member.Name][elemName].Value;
isSet = value != null;
return value;
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:8,代码来源:ExtensionMetadataProvider.cs
示例5: 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);
}
开发者ID:Gremlin2,项目名称:bltoolkit,代码行数:9,代码来源:ExtensionMetadataProvider.cs
示例6: GetFieldName
public override string GetFieldName(ObjectMapper mapper, MemberAccessor member, out bool isSet)
{
object value = GetValue(mapper, member, "MapField", out isSet);
if (value != null)
return value.ToString();
return base.GetFieldName(mapper, member, out isSet);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:9,代码来源:ExtensionMetadataProvider.cs
示例7: 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;
}
开发者ID:Gremlin2,项目名称:bltoolkit,代码行数:9,代码来源:ExtensionMetadataProvider.cs
示例8: GetIgnore
public override bool GetIgnore(ObjectMapper mapper, MemberAccessor member, out bool isSet)
{
object value = GetValue(mapper, member, "MapIgnore", out isSet);
if (value != null)
return TypeExtension.ToBoolean(value);
return base.GetIgnore(mapper, member, out isSet);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:9,代码来源:ExtensionMetadataProvider.cs
示例9: 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);
}
开发者ID:Gremlin2,项目名称:bltoolkit,代码行数:9,代码来源:ExtensionMetadataProvider.cs
示例10: MemberAccessorTests
public MemberAccessorTests() {
person = new Person();
person.NameField = "John Smith";
person.Forename = "John";
person.Address = new Address {Country = new Country {Name = "United States"}};
nameFieldAccessor = MemberAccessor<Person>.From(x => x.NameField);
forenameAccessor = MemberAccessor<Person>.From(x => x.Forename);
countryNameAccessor = MemberAccessor<Person>.From(x => x.Address.Country.Name);
}
开发者ID:jango2015,项目名称:FluentValidation,代码行数:10,代码来源:MemberAccessorTests.cs
示例11: GetIgnore
public override bool GetIgnore(ObjectMapper mapper, MemberAccessor member, out bool isSet)
{
if (IsLinqObject(mapper.TypeAccessor.Type))
{
isSet = true;
return member.GetAttribute<ColumnAttribute>() == null;
}
return base.GetIgnore(mapper, member, out isSet);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:10,代码来源:LinqMetadataProvider.cs
示例12: SetEnumConverterInternal
void SetEnumConverterInternal(MemberAccessor ma, MappingSchema ms)
{
if (_valueConverter == null)
{
_valueConverter = o => ms.MapEnumToValue(o, ma, true);
}
else
{
var converter = _valueConverter;
_valueConverter = o => ms.MapEnumToValue(converter(o), ma, true);
}
}
开发者ID:starteleport,项目名称:bltoolkit,代码行数:12,代码来源:SqlValueBase.cs
示例13: GetIgnore
public override bool GetIgnore(ObjectMapper mapper, MemberAccessor member, out bool isSet)
{
foreach (MetadataProviderBase p in _list)
{
bool ignore = p.GetIgnore(mapper, member, out isSet);
if (isSet)
return ignore;
}
return base.GetIgnore(mapper, member, out isSet);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:12,代码来源:MetadataProviderList.cs
示例14: GetFieldName
public override string GetFieldName(ObjectMapper mapper, MemberAccessor member, out bool isSet)
{
foreach (MetadataProviderBase p in _list)
{
string name = p.GetFieldName(mapper, member, out isSet);
if (isSet)
return name;
}
return base.GetFieldName(mapper, member, out isSet);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:12,代码来源:MetadataProviderList.cs
示例15: GetTrimmable
public override bool GetTrimmable(ObjectMapper mapper, MemberAccessor member, out bool isSet)
{
if (member.Type == typeof(string))
{
object value = GetValue(mapper, member, "Trimmable", out isSet);
if (value != null)
return TypeExtension.ToBoolean(value);
}
return base.GetTrimmable(mapper, member, out isSet);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:12,代码来源:ExtensionMetadataProvider.cs
示例16: 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);
}
开发者ID:starteleport,项目名称:bltoolkit,代码行数:12,代码来源:MetadataProviderList.cs
示例17: 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);
}
开发者ID:starteleport,项目名称:bltoolkit,代码行数:12,代码来源:MetadataProviderList.cs
示例18: When_Member_Is_WriteOnlyProperty_Then_Constructed_Correctly
public void When_Member_Is_WriteOnlyProperty_Then_Constructed_Correctly()
{
// Act
var sut = new MemberAccessor(ReadWriteTestEntity.WriteOnlyPropertyMemberInfo);
// Asert
Assert.AreEqual(sut.Type, MemberAccessorType.Property);
Assert.AreEqual(sut.MemberName, ReadWriteTestEntity.WriteOnlyPropertyName);
Assert.AreEqual(typeof(ReadWriteTestEntity), sut.DeclaringType);
Assert.AreEqual(typeof(int), sut.MemberType);
Assert.IsNull(sut.Getter);
Assert.NotNull(sut.Setter);
}
开发者ID:jonclare,项目名称:KodeKandy,代码行数:13,代码来源:Given_Creating_MemberAccessor.cs
示例19: SetEnumConverter
internal void SetEnumConverter(MemberAccessor ma, MappingSchema ms)
{
if (!_isEnumConverterSet)
{
_isEnumConverterSet = true;
if (EnumTypes == null)
EnumTypes = new List<Type>();
EnumTypes.Add(ma.Type);
SetEnumConverterInternal(ma, ms);
}
}
开发者ID:ivanoffalex,项目名称:bltoolkit,代码行数:14,代码来源:SqlValueBase.cs
示例20: QueryInstanceBindingFlag
public void QueryInstanceBindingFlag()
{
var initialQuery = new MemberAccessor<MemberDescriptor>();
//var query = initialQuery.Where(x => x.AccessMode == MemberAccessMode.Instance).ToList();
var query1 =
initialQuery.Where(
x =>
x.MemberTypes == MemberTypes.Property
&& x.AccessMode == MemberAccessMode.Instance
&& (x.Visibility == MemberVisibility.NonPublic || x.Visibility == MemberVisibility.Public)
&& x.Name == "Test"
).ToList();
}
开发者ID:kkhodykin,项目名称:HandyReflection,代码行数:14,代码来源:MemberTreeVisitorTests.cs
注:本文中的MemberAccessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论