Esempio n. 1
0
 private void DisplayQueryHistory(HistoryItem history)
 {
     if (history != null)
     {
         var historyMetadata = QueryHistoryStorage.MetaData;
         ChangeQueryText(history.Query, true);
         var executeQueryHistoryTitle = GetTranslation("executeQuery");
         var lastExecuteTime = GetTranslation("lastExecuteTime");
         pnlResult.RemoveResultsExcept(historyMetadata);
         UpdateResultViewInternal(new List<Result>()
         {
             new Result(){
                 Title = string.Format(executeQueryHistoryTitle,history.Query),
                 SubTitle = string.Format(lastExecuteTime,history.ExecutedDateTime),
                 IcoPath = "Images\\history.png",
                 PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                 Action = _ =>{
                     ChangeQuery(history.Query,true);
                     return false;
                 }
             }
         }, historyMetadata);
     }
 }
Esempio n. 2
0
        private void DisplayQueryHistory(HistoryItem history)
        {
            if (history != null)
            {
                var historyMetadata = QueryHistoryStorage.MetaData;

                QueryText = history.Query;
                SelectAllText = true;

                var executeQueryHistoryTitle = InternationalizationManager.Instance.GetTranslation("executeQuery");
                var lastExecuteTime = InternationalizationManager.Instance.GetTranslation("lastExecuteTime");
                Results.RemoveResultsExcept(historyMetadata);
                UpdateResultViewInternal(new List<Result>
                {
                    new Result
                    {
                        Title = string.Format(executeQueryHistoryTitle,history.Query),
                        SubTitle = string.Format(lastExecuteTime,history.ExecutedDateTime),
                        IcoPath = "Images\\history.png",
                        PluginDirectory = WoxDirectroy.Executable,
                        Action = _ =>{

                            QueryText = history.Query;
                            SelectAllText = true;

                            return false;
                        }
                    }
                }, historyMetadata);
            }
        }