예제 #1
0
        protected void _init(string path, string filename = "config.json")
        {
            this._data = new ConfigData();

            path = DirectoryHandler.ValidateDirectoryPath(path);

            if (!DirectoryHandler.Exists(path))
            {
                throw new ConfigDirectoryNotFound(path);
            }

            if (FileHandler.Exists(path + filename))
            {
                this._path = path + filename;
                this.LoadFromFile(path + filename);
            }
            else
            {
                this._data.Path = path;
                this._path      = path + filename;

                using (FileHandler fHandler = new FileHandler(this._path))
                {
                    fHandler.Serializer.WriteJson(this._data);
                }
            }
        }
예제 #2
0
파일: Core.cs 프로젝트: maksa988/Warehouse
        protected void _init()
        {
            if (!DirectoryHandler.Exists(this._config.TablesDirectory))
            {
                new DirectoryHandler(this._config.TablesDirectory);
            }

            this._loadTables();
        }