Пример #1
0
        internal void LoadConfigFromJSON(string filename)
        {
            this.filename = filename;
            MongoConfig config = JsonConvert.DeserializeObject <MongoConfig>(File.ReadAllText(filename));

            Helper.SetTextFromSettings(config.FieldName, this.cbFieldName);
            Helper.SetTextFromSettings(config.SearchType, this.cbSearchType);
            Helper.SetTextFromSettings(config.Occurence, this.tbTextToSearch);
        }
Пример #2
0
        public override IConfigService GetConfigFromUI()
        {
            MongoConfig conf = new MongoConfig
            {
                ServerUrl  = tbServer.Text,
                Database   = tbDatabase.Text,
                FieldName  = cbFieldName.Text,
                SearchType = cbSearchType.Text,
                Occurence  = tbTextToSearch.Text
            };

            return(conf);
        }
Пример #3
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: ");
        }
Пример #4
0
 public override string GetDefaultWorkspaceFilename()
 {
     return(MongoConfig.GetWorkspaceFilename());
 }