コード例 #1
0
        public CoreConfigurationProperty(string name, T defaultValue, string oldName = null)
        {
            propertyName = name;

            if (!string.IsNullOrEmpty(oldName) && PropertyService.HasValue(oldName))
            {
                if (!PropertyService.HasValue(name))
                {
                    value = PropertyService.Get <T> (oldName);
                    PropertyService.Set(name, value);
                }
                PropertyService.Set(oldName, null);
            }

            value = PropertyService.Get(name, defaultValue);
        }
コード例 #2
0
 public CoreConfigurationProperty(string name, T defaultValue, string oldName = null)
 {
     this.propertyName = name;
     if (PropertyService.HasValue(name))
     {
         value = PropertyService.Get <T> (name);
         return;
     }
     else if (!string.IsNullOrEmpty(oldName))
     {
         if (PropertyService.HasValue(oldName))
         {
             value = PropertyService.Get <T> (oldName);
             PropertyService.Set(name, value);
             return;
         }
     }
     value = defaultValue;
 }