示例#1
0
        public T GetConfigurations <T>() where T : class
        {
            managerOfLogging = new ManagerOfLogging();
            if (path is null)
            {
                if (managerOfLogging.setuped == true)
                {
                    managerOfLogging.LoggerMessage("File of configurations not found.");
                }

                return(null);
            }

            IConfigurationParser <T> configurationParser = null;

            switch (Path.GetExtension(path))
            {
            case ".xml":
                Help.flg = true;
                break;

            case ".json":
                break;
            }
            configurationParser = new Parser <T>(path);
            return(configurationParser.Parse());
        }
示例#2
0
        public ManagerFiles()
        {
            var optionsManager = new ManagerOptions(AppDomain.CurrentDomain.BaseDirectory);

            options = optionsManager.GetConfigurations <ImportantOptions>();
            DatabaseProvider dataManager = new DatabaseProvider(options);

            logger = new ManagerOfLogging(dataManager.databaseManager);
            logger.Setup();
            dataManager.CreateXMLFiles();
        }
        public Parser(string path)
        {
            managerOfLogging = new ManagerOfLogging();

            this.jsonPath = path;

            this.xmlPath = path;
            if (File.Exists(Path.ChangeExtension(xmlPath, "xsd")))
            {
                xsdPath = Path.ChangeExtension(xmlPath, "xsd");
            }
        }