示例#1
0
 public AdvancedProperty(string xpathKey, T defaultValue, IAdvancedSettingsStorage settingsStorage, RawPropertyValueParser <T> rawValueParser)
     : base(xpathKey, settingsStorage)
 {
     DefaultValue   = defaultValue;
     RawValueParser = rawValueParser;
     _UserValue     = ReadSetting();
 }
示例#2
0
        public static AdvancedProperty <T> CreateAndRegisterGenericSetting <T>(string xPathKey, T defaultValue, RawPropertyValueParser <T> valueParser)
        {
            var property = new AdvancedProperty <T>(xPathKey, defaultValue, SettingsStorage, valueParser);

            RegisterGenericSetting(property);
            return(property);
        }
 /// <summary>
 ///   Creates and registers advanced setting stored in %AppData%/Sitecore/Sitecore Instance Manager/AdvancedSettings.xml
 ///   file
 /// </summary>
 /// <typeparam name="T">Type of stored value of this setting</typeparam>
 /// <param name="xPathKey">Key of the setting in a form of xpath expression</param>
 /// <param name="defaultValue">Default value of the setting</param>
 /// <param name="valueParcer">
 ///   Custom parser of the setting that deserializes string value into
 ///   <typeparam name="T" />
 /// </param>
 /// <returns></returns>
 public static AdvancedProperty <T> Create <T>(string xPathKey, T defaultValue, RawPropertyValueParser <T> valueParcer)
 {
     return(AdvancedSettingsManager.CreateAndRegisterGenericSetting(xPathKey, defaultValue, valueParcer));
 }