Esempio n. 1
0
        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();
        }
        public MultiStructItemCustomView(IHasCustomView <MultiStructItemCustomView> parent, string name, string propertyName)
        {
            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;
        }