CommandMeta(TypeMeta owner, MethodInfo method, MemberMeta condition) : base(owner, method.Name, typeof(ICommand)) { Method = method; Condition = condition; HasParameter = method.GetParameters().Any(); }
public ProxyTypeDescriptor(Type type) { Meta = TypeMeta.Get(type); ProxyType = typeof(PlatformProxy<>).MakeGenericType(type); _properties = Meta.Members.Select(m => new ProxyPropertyDescriptor(this, m)).ToArray(); _propertyCollection = new PropertyDescriptorCollection(_properties); _events = new EventDescriptorCollection(type.GetEvents().Select(e => new ProxyEventDescriptor(e)).ToArray()); }
public MemberMeta(TypeMeta owner, string name, Type type) { DeclaringType = owner; Name = name; MemberType = type; IsViewModel = ViewModelTypes.IsViewModel(type); IsCollection = typeof(IEnumerable).IsAssignableFromPortable(MemberType) && MemberType != typeof(string); }
internal static IEnumerable<MemberMeta> GetAll(TypeMeta owner, IEnumerable<MemberMeta> properties) { var conditions = (from property in properties where property.MemberType == typeof(bool) && property.Name.StartsWith("Can") select property).ToList(); return from method in owner.Type.GetMethodsPortable() where method.IsPublic && !method.IsStatic && !method.IsSpecialName && method.ReturnType == typeof(void) && method.GetParameters().Length <= 1 select new CommandMeta(owner, method, conditions.FirstOrDefault(c => c.Name == "Can" + method.Name)); }
internal static IEnumerable <MemberMeta> GetAll(TypeMeta owner, IEnumerable <MemberMeta> properties) { var conditions = (from property in properties where property.MemberType == typeof(bool) && property.Name.StartsWith("Can") select property).ToList(); return(from method in owner.Type.GetMethodsPortable() where method.IsPublic && !method.IsStatic && !method.IsSpecialName && method.ReturnType == typeof(void) && method.GetParameters().Length <= 1 select new CommandMeta(owner, method, conditions.FirstOrDefault(c => c.Name == "Can" + method.Name))); }
PropertyMeta(TypeMeta owner, PropertyInfo property) : base(owner, property.Name, property.PropertyType) { Property = property; _earlierPropertyNames = property .GetCustomAttributesPortable <NotifyAfterAttribute>() .Select(a => a.OtherProperty) .ToList(); }
public MemberMeta(TypeMeta owner, string name, Type type) { DeclaringType = owner; Name = name; MemberType = type; IsViewModel = ViewModelTypes.IsViewModel(type); IsCollection = typeof(IEnumerable).IsAssignableFromPortable(MemberType) && MemberType != typeof(string); IsObservableCollection = typeof(INotifyCollectionChanged).IsAssignableFromPortable(type) || IsBindingList(type); }
public static TypeMeta Get(Type type) { TypeMeta result; lock (_cache) { if (!_cache.TryGetValue(type, out result)) _cache[type] = result = new TypeMeta(type); } return result; }
public static TypeMeta Get(Type type) { TypeMeta result; lock (_cache) { if (!_cache.TryGetValue(type, out result)) { _cache[type] = result = new TypeMeta(type); } } return(result); }
internal static IEnumerable <MemberMeta> GetAll(TypeMeta owner) { return(from property in owner.Type.GetPropertiesPortable() where property.CanRead && property.GetGetMethodPortable().IsPublic&& !property.GetGetMethodPortable().IsStatic select new PropertyMeta(owner, property)); }
FieldMeta(TypeMeta owner, FieldInfo field) : base(owner, field.Name, field.FieldType) { Field = field; }
protected ViewProxy(object instance, TypeMeta type) { Instance = instance; _slots = (from member in type.Members select MemberSlot.Create(this, member)).ToArray(); }
internal static IEnumerable<MemberMeta> GetAll(TypeMeta owner) { return from field in owner.Type.GetFieldsPortable() where field.IsPublic && !field.IsStatic select new FieldMeta(owner, field); }
PropertyMeta(TypeMeta owner, PropertyInfo property) : base(owner, property.Name, property.PropertyType) { Property = property; }
internal static IEnumerable <MemberMeta> GetAll(TypeMeta owner) { return(from field in owner.Type.GetFieldsPortable() where field.IsPublic && !field.IsStatic select new FieldMeta(owner, field)); }
internal static IEnumerable<MemberMeta> GetAll(TypeMeta owner) { return from property in owner.Type.GetPropertiesPortable() where property.CanRead && property.GetGetMethodPortable().IsPublic && !property.GetGetMethodPortable().IsStatic select new PropertyMeta(owner, property); }
protected PlatformProxy(object instance, TypeMeta type) : base(instance, type) { }
ProxyXamlType(TypeMeta meta) { _meta = meta; _underlyingType = typeof(PlatformProxy<>).MakeGenericType(meta.Type); _members = meta.Members.Select(m => new ProxyXamlMember(this, m)).ToDictionary(m => m.Name); }