Пример #1
0
        public static void SettingInfo(ref ASLSettings settings, int id)
        {
            if (id > settings.OrderedSettings.Count)
            {
                Console.WriteLine("Wrong id, type settings list to get a list of the settings with their ids");
                return;
            }

            ASLSetting setting = settings.OrderedSettings[id - 1];

            string parentString = "None";

            if (setting.Parent != null)
            {
                int count = 1;
                parentString = setting.Parent + " ";
                ASLSetting tempSetting = settings.Settings[setting.Parent];
                do
                {
                    if (tempSetting.Parent == null)
                    {
                        break;
                    }
                    tempSetting = settings.Settings[tempSetting.Parent];
                    count++;
                    parentString += ", " + tempSetting.Parent;
                }while (true);
                parentString += "(" + count + ")";
            }

            Console.WriteLine($"{setting.Label} ({setting.Id}) :" + Environment.NewLine
                              + "Tooltip : " + setting.ToolTip + Environment.NewLine
                              + "Value : " + setting.Value + Environment.NewLine
                              + "Default value : " + setting.DefaultValue + Environment.NewLine
                              + "Parent(s) : " + parentString);
        }
Пример #2
0
        public static void SaveSettings(string path, ref ASLSettings settings)
        {
            string json = JsonConvert.SerializeObject(settings.Settings, Formatting.Indented);

            File.WriteAllText(path, json);
        }
Пример #3
0
 public ASLSettingsReader(ASLSettings s)
 {
     _s = s;
 }
Пример #4
0
 public ASLSettingsBuilder(ASLSettings s)
 {
     _s = s;
 }