Exemplo n.º 1
0
        internal void LoadConfigFromJSONAsync(string filename)
        {
            this.filename = filename;
            MongoConfig config = JsonConvert.DeserializeObject <MongoConfig>(File.ReadAllText(filename));

            PromptHelper.ShowPromptInfo($"Server: {config.ServerUrl}");
            PromptHelper.ShowPromptInfo(config.FieldName);
            PromptHelper.ShowPromptInfo(config.SearchType);

            MongoServer   = config.ServerUrl;
            MongoDatabase = config.Database;

            PromptHelper.ShowPromptInfo($"Last {LastItems} files: ");
            InitGridAsync(config.FieldName, config.SearchType, "").GetAwaiter().GetResult();

            ShowMenu();

            string fileToDownload = PromptHelper.EnterValue($"Enter: ");
        }