public MultiStructItemCustomView(IHasCustomView <MultiStructItemCustomView> parent, string name, string propertyName, string offsetPropName) { this.parent = parent; this.name = name; var property = parent.GetType().GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Debug.Assert(property != null, nameof(property) + " != null"); propertyType = property.PropertyType; getMethod = property.GetGetMethod(); setMethod = property.GetSetMethod(); isReadOnly = (IsReadOnlyAttribute)property.GetCustomAttribute(typeof(IsReadOnlyAttribute), true) != null; property = parent.GetType().GetProperty(offsetPropName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Debug.Assert(property != null, nameof(property) + " != null"); offsetGetMethod = property.GetGetMethod(); }
public PlDataItemCustomView(IHasCustomView <PlDataItemCustomView> parent, string name, string propertyName, byte[] bytes, ulong offset) : base(bytes, offset) { this.parent = parent; Name = name; var property = parent.GetType().GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Debug.Assert(property != null, nameof(property) + " != null"); propertyType = property.PropertyType; getMethod = property.GetGetMethod(); setMethod = property.GetSetMethod(); }