Пример #1
0
        public void Apply(Type type)
        {
            if (!StaticField)
            {
                throw new ArgumentException("Not a static FieldConfigWrapper");
            }

            ConfigEntryDescriptionWrapper.UpdateDescription(GetValue <T>(type));

            if (ConfigEntryDescriptionWrapper.IsNotDefault())
            {
                type.SetFieldValue(FieldName, ConfigEntryDescriptionWrapper.Value);
            }
        }
Пример #2
0
        public void Apply(object obj)
        {
            if (StaticField)
            {
                throw new ArgumentException("Not a instance FieldConfigWrapper");
            }

            ConfigEntryDescriptionWrapper.UpdateDescription(GetValue <T>(obj));

            if (ConfigEntryDescriptionWrapper.IsNotDefault())
            {
                obj.SetFieldValue(FieldName, ConfigEntryDescriptionWrapper.Value);
            }
        }
Пример #3
0
 public void AddFieldChangedListener(Action <IFieldChanger> func)
 {
     ConfigEntryDescriptionWrapper.AddFieldChangedListener(this, func);
 }
Пример #4
0
 public FieldConfigWrapper(ConfigEntryDescriptionWrapper <T> configEntryDescriptionWrapper, string fieldName, bool staticField = false)
 {
     ConfigEntryDescriptionWrapper = configEntryDescriptionWrapper;
     FieldName   = fieldName;
     StaticField = staticField;
 }