private static object ToEnum(IContext context, int classId, long enumValue) { var clazz = Container(context).ClassMetadataForID(classId); var enumType = NetReflector.ToNative(clazz.ClassReflector()); return(Enum.ToObject(enumType, enumValue)); }
protected override bool Accept(ClassMetadata classmetadata) { #if CF || SILVERLIGHT return(false); #else return(NetReflector.ToNative(classmetadata.ClassReflector()) == typeof(DateTimeOffset)); #endif }
public bool Match(IReflectClass classReflector) { var type = NetReflector.ToNative(classReflector); if (type == null) { return(false); } return(type.IsEnum); }
protected override bool Accept(ClassMetadata classmetadata) { var isGuid = NetReflector.ToNative(classmetadata.ClassReflector()) == typeof(Guid); if (!isGuid) { classmetadata.TraverseDeclaredFields(reindexer); } return(isGuid); }
public bool Match(IReflectClass classReflector) { if (classReflector == null) { return(false); } Type type = NetReflector.ToNative(classReflector); return(type == typeof(System.Array)); }
public bool Match(IReflectClass classReflector) { var type = NetReflector.ToNative(classReflector); if (type == null) { return false; } if (!type.IsGenericType) { return false; } return type.GetGenericTypeDefinition() == _genericType; }
public bool Match(IReflectClass classReflector) { Type type = NetReflector.ToNative(classReflector); if (type == null) { return(false); } if (!type.IsGenericType) { return(false); } return(_type == type.GetGenericTypeDefinition()); }
public bool Match(IReflectClass classReflector) { var type = NetReflector.ToNative(classReflector); if (type == null) { return(false); } if (!type.IsGenericType) { return(false); } return(((IList <Type>)_genericTypes).Contains(type.GetGenericTypeDefinition())); }
private static void ReindexDateTimeField(IStoredField field) { var claxx = field.GetStoredType(); if (claxx == null) { return; } var t = NetReflector.ToNative(claxx); if (t == typeof(T) || t == typeof(T?)) { field.DropIndex(); field.CreateIndex(); } }
public object Cast(object value) { System.Type type = NetReflector.ToNative(_type); if (null == type) { return(null); } if (IsNullable) { type = type.GetGenericArguments()[0]; } return(type.IsEnum ? ConvertEnum(type, value) : Convert.ChangeType(value, type)); }
internal static bool IsBuiltinCollectionClass(ReplicationReflector reflector, IReflectClass claxx) { Type type = NetReflector.ToNative(claxx); if (Contains(_nonGeneric, type)) { return(true); } if (!type.IsGenericType) { return(false); } if (Contains(_generic, type.GetGenericTypeDefinition())) { return(true); } return(false); }
protected override bool Accept(ClassMetadata classmetadata) { var type = NetReflector.ToNative(classmetadata.ClassReflector()); return(type != null ? type.IsEnum : false); }
public bool CanHold(IReflectClass type) { return(NetReflector.ToNative(type).Equals(typeof(Guid))); }
protected override bool Accept(ClassMetadata classmetadata) { return(NetReflector.ToNative(classmetadata.ClassReflector()) == typeof(Guid)); }