Пример #1
0
        private void EditFieldDecriptor(FieldMemberInfo descriptor)
        {
            var stringEventArgs = new EditingValueEventArgs <string>();

            OnEditFieldDescriptorMemberName(descriptor.FieldInfo, stringEventArgs);
            descriptor.MemberName = stringEventArgs.Value;

            stringEventArgs.Value = null;
            OnEditFieldDescriptorDisplayName(descriptor.FieldInfo, stringEventArgs);
            descriptor.DisplayName = stringEventArgs.Value;

            stringEventArgs.Value = null;
            OnEditFieldDescriptorStringValue(descriptor.FieldInfo, stringEventArgs);
            descriptor.Value = stringEventArgs.Value;

            var szEventArgs = new EditingValueEventArgs <int>();

            OnEditFieldDescriptorSize(descriptor.FieldInfo, szEventArgs);
            descriptor.MemberSize = szEventArgs.Value;
        }
Пример #2
0
        public IEnumerable <IMemberInfo> GetMemberInfos()
        {
            if (_descriprors != null)
            {
                return(_descriprors);
            }

            _descriprors = new List <IMemberInfo>();

            foreach (var fieldInfo in ObjectType.GetFields())
            {
                var descriptor = new FieldMemberInfo(fieldInfo);
                var arg        = new CancelEventArgs();
                OnEditMemberDescriptorOverride(fieldInfo, arg);
                if (arg.Cancel)
                {
                    continue;
                }
                EditFieldDecriptor(descriptor);
                _descriprors.Add(descriptor);
            }

            return(_descriprors);
        }