Exemplo n.º 1
0
        public MultiAdminConfig(Config config, MultiAdminConfig parentConfig)
        {
            Config       = config;
            ParentConfig = parentConfig;

            if (!File.Exists(Config?.ConfigPath))
            {
                try
                {
                    if (Config?.ConfigPath != null)
                    {
                        File.Create(Config.ConfigPath).Close();
                    }
                }
                catch (Exception e)
                {
                    new ColoredMessage[]
                    {
                        new ColoredMessage($"Error while creating config (Path = {Config?.ConfigPath ?? "Null"}):", ConsoleColor.Red),
                        new ColoredMessage(e.ToString(), ConsoleColor.Red)
                    }.WriteLines();
                }
            }

            ReloadConfig();
        }
Exemplo n.º 2
0
 public MultiAdminConfig(string path, MultiAdminConfig parentConfig) : this(new Config(path), parentConfig)
 {
 }