Exemple #1
0
        public bool Load()
        {
            var value = SerializableBase.Load(GetType(), Directory, Name + ".xml") as ConfigBase;

            SetValue(value ?? GetDefault());
            return(value != null);
        }
Exemple #2
0
        protected void SetValue(SerializableBase value)
        {
            var type = value.GetType();

            foreach (var prop in type.GetProperties().Where(x => !x.CustomAttributes.Any(x => x.AttributeType == typeof(XmlIgnoreAttribute))))
            {
                this.GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(value));
            }
        }