示例#1
0
 public static void LoadFrom(this AppSettings.ToolsSection dstSettings, AppSettings.ToolsSection srcSettings)
 {
     Validate.IsNotNull <AppSettings.ToolsSection>(srcSettings, "srcSettings");
     if (dstSettings != srcSettings)
     {
         string[] pathComponents = SettingPath.GetPathComponents(dstSettings.Path);
         string[] strArray2      = SettingPath.GetPathComponents(srcSettings.Path);
         foreach (Setting setting in dstSettings.Settings)
         {
             string[] strArray3 = SettingPath.GetPathComponents(setting.Path);
             string[] strArray4 = new string[(strArray3.Length - pathComponents.Length) + strArray2.Length];
             int      index     = 0;
             for (int i = 0; i < strArray2.Length; i++)
             {
                 strArray4[index] = strArray2[i];
                 index++;
             }
             for (int j = pathComponents.Length; j < strArray3.Length; j++)
             {
                 strArray4[index] = strArray3[j];
                 index++;
             }
             string  str3     = SettingPath.CombinePathComponents(strArray4);
             Setting setting2 = srcSettings[str3];
             setting.Value = setting2.Value;
         }
     }
 }
示例#2
0
 private static string ConvertToolsPathToToolDefaultsPath(string settingPath)
 {
     string[] pathComponents = SettingPath.GetPathComponents(settingPath);
     if (pathComponents[0] == ToolSettings.Null.Path)
     {
         pathComponents[0] = AppSettings.Instance.ToolDefaults.Path;
     }
     return(SettingPath.CombinePathComponents(pathComponents));
 }