void ReleaseDesignerOutlets() { if (OfflineSwitch != null) { OfflineSwitch.Dispose(); OfflineSwitch = null; } if (ResultsWindow != null) { ResultsWindow.Dispose(); ResultsWindow = null; } if (ProgressIndicator != null) { ProgressIndicator.Dispose(); ProgressIndicator = null; } if (ShareButton != null) { ShareButton.Dispose(); ShareButton = null; } }
private void SearchController_OnSearchComplete(SearchProxy search) { Task.Run(async() => { try { var results = await Services.Instance.Handler.FindMultiple(new ResultProxy() { SearchId = search.Id }); Dispatcher.Invoke(() => { var window = new ResultsWindow((List <ResultProxy>)results, search.Term); window.Show(); }); } catch (Exception e) { throw; } }); // As the one received from the event has been throught the database, and the one in the list hase not, they are different, while still in reality being the same. // Matching them on thier ExecutedAt, ensures the correct one is found and removed. // This is needed incase many searhes are done rapidly, and one done later is finished before one done earlier. var item = model.CurrentSearches.Where(x => x.ExecutedAt == search.ExecutedAt).ToList().First(); Dispatcher.Invoke(() => model.CurrentSearches.Remove(item)); }
void ShowResults() { StopTimer(); ResultsWindow resWin = new ResultsWindow(results); resWin.Show(); this.Destroy(); }
/// <summary> /// Initializes a new instance of the CrossJoinSelectDialogWindow in the context of the given results screen. /// </summary> /// <param name="owner">The results screen referencing the Documents to Display and owning the new dialog window.</param> public CrossJoinSelectDialog(ResultsWindow owner) { InitializeComponent(); Top = owner.Top; Left = owner.Left; owner.Documents .Select(CreateCheckBoxForDocument) .ToList() .ForEach(checkBox => documentsPanel.Children.Add(checkBox)); }
private void ShowDetails() { var viewModel = SimpleIoc.Default.GetInstance<ResultsWindowViewModel>(); viewModel.SetResults(Messages, string.Format("Results - {0} - Total {1} message(s)", File, Messages.Count)); var info = new ResultsWindow { Owner = Application.Current.MainWindow }; info.ShowDialog(); }
public override string ToString() { var sb = new StringBuilder(); sb.Append("Skyline file: ").AppendLine(SkylineFilePath); sb.Append("Folder to watch: ").AppendLine(FolderToWatch); sb.Append("Include subfolders: ").AppendLine(IncludeSubfolders.ToString()); sb.AppendLine(QcFileFilter.ToString()); sb.Append("Instrument: ").AppendLine(InstrumentType); sb.Append("Results window: ").Append(ResultsWindow.ToString()).AppendLine(" days"); sb.Append("Acquisition time: ").Append(AcquisitionTime.ToString()).AppendLine(" minutes"); return(sb.ToString()); }
void LoadHTML() { if (!HTMLLoaded) { ResultsWindow.LoadRequest(new NSMutableUrlRequest(NSUrl.FromFilename(TempHtmlPath), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 60)); HTMLLoaded = true; } else { //WebView doesn't refresh the images if you just load the request again (even if ignoring the cache). So we need to call Reload instead ResultsWindow.Reload(); } }
private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { if (!loaded) { return; } loaded = false; if (ResultsWindow != null && !ResultsWindow.IsClosed) { ResultsWindow.Close(); } PokeManager.ManagerWindow.PokemonSearchWindow = null; IsClosed = true; PokeManager.ManagerWindow.Focus(); }
private void OnSearchClicked(object sender, RoutedEventArgs e) { PokemonSearch searcher = new PokemonSearch(); searcher.Search = search; searcher.Results = results; searcher.SearchPokemon(); if (ResultsWindow != null && !ResultsWindow.IsClosed) { ResultsWindow.ShowResults(searcher.Results); } else { ResultsWindow = PokemonSearchResults.Show(Owner, searcher.Results); } }
/// <summary> /// Initializes a new instance of the MainWindow class. /// </summary> public MainWindow() { InitializeComponent(); Closing += (s, e) => ViewModelLocator.Cleanup(); Messenger.Default.Register <NotificationMessage>(this, (message) => { switch (message.Notification) { case "OpenResultsWindow": var mainViewModel = (ViewModel.MainViewModel)message.Sender; var resultsWindow = new ResultsWindow(); resultsWindow.Show(); Messenger.Default.Send <string>(mainViewModel.GetResultsSummary(), "Results"); break; } }); }
void LoadHTML() { ResultsWindow.Navigate(new System.Uri("ms-appdata:///local/" + ReportGenerator.TempHtmlRelFolder + "/" + ReportGenerator.TempHtmlName)); }
//public void ShowResults() //{ // Console.Clear(); // Console.WriteLine("------------------------------WYNIKI-------------------------------------"); // Console.WriteLine("------------------------------Pakiet-------------------------------------"); // Console.WriteLine("|Liczba pakietow bez bledu : " + P_results[(int)Data.noError]); // Console.WriteLine("|Liczba wykrytych blednych pakietow : " + P_results[(int)Data.Detected]); // Console.WriteLine("|Liczba niewykrytych blednych pakietow : " + P_results[(int)Data.unDetected]); // Console.WriteLine("|Liczba wykrytych bledow, przy poprawnych danych: " + P_results[(int)Data.detectedNoError]); // Console.WriteLine("|Liczba transmisji - " + P_results[(int)Data.number_of_transmission]); // Console.WriteLine("------------------------------Ramki--------------------------------------"); // Console.WriteLine("|Liczba ramek bez bledu : " + F_results[(int)Data.noError]); // Console.WriteLine("|Liczba wykrytych blednych ramek : " + F_results[(int)Data.Detected]); // Console.WriteLine("|Liczba niewykrytych blednych ramek : " + F_results[(int)Data.unDetected]); // Console.WriteLine("|Liczba wykrytych bledow, przy poprawnych danych: " + F_results[(int)Data.detectedNoError]); // Console.WriteLine("|Liczba transmisji - " + F_results[(int)Data.number_of_transmission]); // Console.WriteLine("-------------------------------------------------------------------------"); //} public void ShowResults(ref ResultsWindow resultsWin) { resultsWin.SetResultsboxes(this.P_results, this.F_results); }
//-------------------methods------------------ protected void Build() { VBox vbox; Alignment align; Gtk.Image settings_icon; AppPaintable = true; KeepAbove = true; Decorated = false; // This typehint gets the window to raise all the way to top. TypeHint = WindowTypeHint.Splashscreen; try { SetIconFromFile("/usr/share/icons/gnome/scalable/actions/system-run.svg"); } catch { } SetColormap(); resultsWindow = new ResultsWindow(BackgroundColor, NumberResultsDisplayed); resultsWindow.SelectionChanged += OnResultsWindowSelectionChanged; currentPane = Pane.First; frame = new GlossyRoundedFrame(); frame.DrawFill = frame.DrawFrame = true; frame.FillColor = frame.FrameColor = BackgroundColor; frame.FillAlpha = frame.FrameAlpha = WindowTransparency; frame.Radius = Screen.IsComposited ? IconBoxRadius : 0; Add(frame); frame.Show(); vbox = new VBox(false, 0); frame.Add(vbox); vbox.BorderWidth = IconBoxPadding; vbox.Show(); settings_icon = new Gtk.Image(GetType().Assembly, "settings-triangle.png"); align = new Alignment(1.0F, 0.0F, 0, 0); align.SetPadding(3, 0, 0, IconBoxPadding); align.Add(settings_icon); vbox.PackStart(align, false, false, 0); settings_icon.Show(); align.Show(); resultsHBox = new HBox(false, (int)IconBoxPadding * 2); resultsHBox.BorderWidth = IconBoxPadding; vbox.PackStart(resultsHBox, false, false, 0); resultsHBox.Show(); iconbox = new IconBox[3]; iconbox[0] = new IconBox(IconBoxIconSize); iconbox[0].IsFocused = true; iconbox[0].Radius = IconBoxRadius; resultsHBox.PackStart(iconbox[0], false, false, 0); iconbox[0].Show(); iconbox[1] = new IconBox(IconBoxIconSize); iconbox[1].IsFocused = false; iconbox[1].Radius = IconBoxRadius; resultsHBox.PackStart(iconbox[1], false, false, 0); iconbox[1].Show(); iconbox[2] = new IconBox(IconBoxIconSize); iconbox[2].IsFocused = false; iconbox[2].Radius = IconBoxRadius; resultsHBox.PackStart(iconbox[2], false, false, 0); // iconbox[2].Show (); align = new Alignment(0.5F, 0.5F, 1, 1); align.SetPadding(0, 2, 0, 0); label = new SymbolDisplayLabel(); align.Add(label); vbox.PackStart(align, false, false, 0); label.Show(); align.Show(); ScreenChanged += OnScreenChanged; ConfigureEvent += OnConfigureEvent; SizeAllocated += delegate { Reposition(); }; iconbox[0].LinesChanged += OnLineChangedEvent; iconbox[1].LinesChanged += OnLineChangedEvent; iconbox[2].LinesChanged += OnLineChangedEvent; Reposition(); }
public void RefreshUI() { ResultsWindow.RefreshUI(); }
/// <summary> /// Open session window /// </summary> public void OpenSessionWindow() { if (_group == null || _group.Length < 1 || _indiv == null || _indiv.Length < 1 || _eval == null || _eval.Length < 1 || _cond == null || _cond.Length < 1 || _keys == null || _keys.Length < 1 || _sessionNumber == null || _sessionNumber.Length < 1 || _ther == null || _ther.Length < 1 || _collect == null || _collect.Length < 1 || _dataRole == null || _dataRole.Length < 1 || _sessionTime == null || _sessionTime.Length < 1) { return; } int session; if (!int.TryParse(_sessionNumber, out session)) { return; } try { string savedStatePath = Path.Combine(Properties.Settings.Default.SaveLocation, "SavedState.json"); var savedState = new SavedState(); savedState.Group = _group; savedState.Individual = _indiv; savedState.Evaluation = _eval; savedState.Condition = _cond; savedState.KeySet = _keys; savedState.Therapist = _ther; savedState.DataCollector = _collect; savedState.Role = _dataRole; savedState.Duration = _sessionTime; string json = JsonConvert.SerializeObject(savedState); File.WriteAllText(savedStatePath, json); } catch { } var window = new SessionWindow("Recording Session: Session #" + SessionNumber); window.GroupName = _group; window.PatientName = _indiv; window.EvaluationName = _eval; window.ConditionName = _cond; window.KeyboardName = _keys + ".json"; window.SessionCount = session; window.TherapistName = _ther; window.CollectorName = _collect; window.CollectorRole = _dataRole; window.SetKeys(keyboardListViewModel.keyboardSelection); window.SessionTime = GetSessionLength(_sessionTime); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.ShowDialog(); var kbWindow = new ResultsWindow(); kbWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; kbWindow.mFrequencyColumns = window.GetFrequencyKeys(); kbWindow.mDurationColumns = window.GetDurationKeys(); kbWindow.mainFreqCounts = window.GetMainFrequencyCounts(); kbWindow.mainFreqMinutes = window.GetMainFrequencyTotals(); kbWindow.mainFreqRPM = window.GetMainFrequencyRPM(); kbWindow.mainDurCounts = window.GetMainDurationTime(); kbWindow.mainDurMinutes = window.GetMainDurationTotalTime(); kbWindow.mainDurPercent = window.GetMainDurationPercentageSession(); kbWindow.schOneFreqCounts = window.GetSchOneFrequencyCounts(); kbWindow.schOneFreqMinutes = window.GetSchOneFrequencyTotals(); kbWindow.schOneFreqRPM = window.GetSchOneFrequencyRPM(); kbWindow.schOneDurCounts = window.GetSchOneDurationTime(); kbWindow.schOneDurMinutes = window.GetSchOneDurationTotalTime(); kbWindow.schOneDurPercent = window.GetSchOneDurationPercentageSession(); kbWindow.schTwoFreqCounts = window.GetSchTwoFrequencyCounts(); kbWindow.schTwoFreqMinutes = window.GetSchTwoFrequencyTotals(); kbWindow.schTwoFreqRPM = window.GetSchTwoFrequencyRPM(); kbWindow.schTwoDurCounts = window.GetSchTwoDurationTime(); kbWindow.schTwoDurMinutes = window.GetSchTwoDurationTotalTime(); kbWindow.schTwoDurPercent = window.GetSchTwoDurationPercentageSession(); kbWindow.schThreeFreqCounts = window.GetSchThreeFrequencyCounts(); kbWindow.schThreeFreqMinutes = window.GetSchThreeFrequencyTotals(); kbWindow.schThreeFreqRPM = window.GetSchThreeFrequencyRPM(); kbWindow.schThreeDurCounts = window.GetSchThreeDurationTime(); kbWindow.schThreeDurMinutes = window.GetSchThreeDurationTotalTime(); kbWindow.schThreeDurPercent = window.GetSchThreeDurationPercentageSession(); kbWindow.ShowDialog(); if (kbWindow.SaveData && window.stopWatch.Elapsed.TotalSeconds > 0) { XSSFWorkbook hssfworkbook = new XSSFWorkbook(); try { ISheet page = hssfworkbook.CreateSheet("Cover Page"); window.WriteResults(page, window.freqIntervalListMain, window.stopWatch, window.durationIntervalListMain, window.mMultiScheds[0], true, 0); page = hssfworkbook.CreateSheet("Schedule 1 Only"); window.WriteResults(page, window.freqIntervalListSchOne, window.scheduleOne, window.durationIntervalListSchOne, window.mMultiScheds[1], false, 1); page = hssfworkbook.CreateSheet("Schedule 2 Only"); window.WriteResults(page, window.freqIntervalListSchTwo, window.scheduleTwo, window.durationIntervalListSchTwo, window.mMultiScheds[2], false, 2); page = hssfworkbook.CreateSheet("Schedule 3 Only"); window.WriteResults(page, window.freqIntervalListSchThree, window.scheduleThree, window.durationIntervalListSchThree, window.mMultiScheds[3], false, 3); page = hssfworkbook.CreateSheet("FrequencyIntervals"); window.WriteFreqIntervalResults(page, window.keyFrequency, window.mKeyboards.frequencyKeys, window.freqIntervalListMain); page = hssfworkbook.CreateSheet("DurationIntervals"); window.WriteDurIntervalResults(page, window.keyDuration, window.mKeyboards.durationKeys, window.durationIntervalListMain); var task = new Task <bool>(() => { var targetDir = Path.Combine(Properties.Settings.Default.SaveLocation, window.GroupName, window.PatientName, window.EvaluationName, window.ConditionName); var di = new DirectoryInfo(targetDir); return(di.Exists); }); task.Start(); bool resp = task.Wait(100) && task.Result; if (resp) { var targetFile = Path.Combine(Properties.Settings.Default.SaveLocation, window.GroupName, window.PatientName, window.EvaluationName, window.ConditionName, "Session_" + window.SessionCount + "_" + window.CollectorRole + ".xlsx"); using (FileStream file = new FileStream(targetFile, FileMode.Create)) { hssfworkbook.Write(file); } } else { var targetFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "DataTracker", window.GroupName, window.PatientName, window.EvaluationName, window.ConditionName, "Session_" + window.SessionCount + "_" + window.CollectorRole + ".xlsx"); using (FileStream file = new FileStream(targetFile, FileMode.Create)) { hssfworkbook.Write(file); } MessageBox.Show("Saved to local location!"); } } catch (IOException e2) { Console.WriteLine(e2.ToString()); } } CountSessions(); }
private void ExecuteCommand(string cmd) { DbCommand dbCmd = _connection.CreateCommand(); dbCmd.CommandText = cmd; if (cmd.Trim().StartsWith("SELECT", StringComparison.InvariantCultureIgnoreCase)) { DbDataReader reader = dbCmd.ExecuteReader(); DataTable schema = reader.GetSchemaTable(); int lineLength = 0; bool[] columnIsRightAligned = new bool[reader.FieldCount]; int[] columnWidths = new int[reader.FieldCount]; string[] columnTitles = new string[reader.FieldCount]; foreach (DataRow row in schema.Rows) { int colNumber = (int)row["ColumnOrdinal"]; bool rightAlign = true; int length = 0; DbType type = (DbType)row["ProviderType"]; switch (type) { case DbType.Boolean: length = 5; // False break; case DbType.Byte: length = 4; // -128 break; case DbType.Int16: length = 6; // -32767 break; case DbType.Int32: length = 10; // -134217728 break; case DbType.Int64: length = 19; // -576460752303423488 break; case DbType.Single: length = 14; // -3.4028234E-38 break; case DbType.Double: length = 25; // -2.2250738585072009E−308 break; case DbType.Decimal: length = (int)row["NumericPrecision"]; break; case DbType.Date: length = 10; // 2000-12-31 break; case DbType.Time: length = 18; // 10:00:00.234GMT+11 break; case DbType.DateTime: length = 29; // 2000-12-31T10:00:00.234GMT+11 break; default: rightAlign = false; length = (int)row["ColumnSize"]; break; } length = Math.Min(length, 80); string label = row["ColumnName"].ToString(); if (label == null || label.Length == 0) { label = row["BaseColumnName"].ToString(); } if (label == null || label.Length == 0) { label = String.Format("Column{0}", row["ColumnOrdinal"]); } length = Math.Max(length, label.Length); columnWidths[colNumber] = length; string padLeft = String.Format("{0," + ((length - label.Length) / 2) + "}", ""); string padRight = String.Format("{0," + (length - padLeft.Length - label.Length) + "}", ""); columnTitles[colNumber] = padLeft + label + padRight; columnIsRightAligned[colNumber] = rightAlign; lineLength += length + 1; } StringBuilder outputRow = new StringBuilder(lineLength); for (int i = 0; i < columnTitles.Length; i++) { outputRow.Append(columnTitles[i]).Append(" "); } outputRow.AppendLine(); ResultsWindow.AppendText(outputRow.ToString()); outputRow.Clear(); for (int i = 0; i < columnWidths.Length; i++) { outputRow.Append(String.Format("{0," + columnWidths[i] + "}", "").Replace(' ', '-')).Append(" "); } outputRow.AppendLine(); ResultsWindow.AppendText(outputRow.ToString()); while (reader.Read()) { outputRow.Clear(); for (int i = 0; i < reader.FieldCount; i++) { string col = reader.GetString(i); if (col == null) { col = "<null>"; } if (col.Length > columnWidths[i]) { if (columnWidths[i] > 5) { col = col.Substring(0, columnWidths[i] - 5) + "[...]"; } else { col = col.Substring(0, columnWidths[i]); } } outputRow.Append(String.Format("{0," + (columnIsRightAligned[i] ? "" : "-") + columnWidths[i] + "}", col)).Append(" "); } outputRow.AppendLine(); ResultsWindow.AppendText(outputRow.ToString()); } reader.Close(); } else { int affectedRows = dbCmd.ExecuteNonQuery(); StringBuilder outputRow = new StringBuilder(); outputRow.AppendLine(String.Format("{0} row(s) updated", affectedRows)); ResultsWindow.AppendText(outputRow.ToString()); } }
internal void ExecuteSQL() { ResultsWindow.Clear(); string sql = CommandWindow.Text.Trim().Replace("\r", ""); if (sql.Length == 0) { return; } #if DEBUG System.Diagnostics.Trace.WriteLine("SQLEditor.ExecuteSQL: " + sql); #endif char[] quotes = new char[] { '\'', '\"', '`' }; string delimiter = ";"; int pos = -1; // to avoid searching too many times for tokens that are far away or non present at all, keep them in global variables int nextString = -1, nextComment1 = -1, nextComment2 = -1, nextDelimiter = -1; StringBuilder currentCmd = new StringBuilder(); while (pos < sql.Length) { // update the position of the tokens, if the cursor went past them if (nextString <= pos) { nextString = sql.IndexOfAny(quotes, pos + 1); } if (nextString == -1) { nextString = Int32.MaxValue; } if (nextComment1 <= pos) { nextComment1 = sql.IndexOf("--", pos + 1); } if (nextComment1 == -1) { nextComment1 = Int32.MaxValue; } if (nextComment2 <= pos) { nextComment2 = sql.IndexOf("/*", pos + 1); } if (nextComment2 == -1) { nextComment2 = Int32.MaxValue; } if (nextDelimiter <= pos) { nextDelimiter = sql.IndexOf(delimiter, pos + 1); } if (nextDelimiter == -1) { nextDelimiter = Int32.MaxValue; } int nextSpecialPos = Math.Min(nextString, Math.Min(nextDelimiter, Math.Min(nextComment1, nextComment2))); // if nothing has been found, take the rest of the string and consider it terminated by a delimiter if (nextSpecialPos == Int32.MaxValue) { nextSpecialPos = nextDelimiter = sql.Length; } currentCmd.Append(sql.Substring(pos + 1, nextSpecialPos - pos - 1)); // check if the partial command we identified is a special "delimiter change instruction" if (currentCmd.Length > 10 && currentCmd.ToString().Trim().StartsWith("delimiter ", StringComparison.InvariantCultureIgnoreCase)) { // re-synchronize the position by searching for "delimiter" in the original string - we did a Trim on the cmd string pos = sql.IndexOf("delimiter ", pos, StringComparison.InvariantCultureIgnoreCase) + 10; int endOfLine = sql.IndexOf('\n', pos + 1); if (endOfLine == -1) { endOfLine = sql.Length; } // take as a delimiter what is between the keyword and the end of the line, and put the cursor back to that position delimiter = sql.Substring(pos, endOfLine - pos); pos = endOfLine; currentCmd.Clear(); nextDelimiter = -1; // force a new search for the delimiter, the old value was referring to a different kind continue; } else { pos = nextSpecialPos; } // test the delimiter before any other marker, as it could have been changed to be equal to a special // string like // or -- if (nextSpecialPos == nextDelimiter) { // command is ended, run it string cmd = currentCmd.ToString().Trim(); currentCmd.Clear(); CommandWindow.SetCaret(pos); #if DEBUG System.Diagnostics.Trace.WriteLine(cmd); #endif ExecuteCommand(cmd); pos += delimiter.Length; } else if (nextSpecialPos == nextComment1) { // skip the rest of the line int endOfLine = sql.IndexOf('\n', pos); pos = (endOfLine == -1) ? sql.Length : endOfLine; } else if (nextSpecialPos == nextComment2) { // skip until */ int endOfLine = sql.IndexOf("*/", pos); pos = (endOfLine == -1) ? sql.Length : endOfLine + 1; } else if (nextSpecialPos == nextString) { char quote = sql[pos]; int endOfString = sql.IndexOf(quote, pos + 1); pos = (endOfString == -1) ? sql.Length : endOfString; currentCmd.Append(sql.Substring(nextSpecialPos, pos - nextSpecialPos + 1)); } } }
void SetHTML(string html) { ResultsWindow.LoadHtmlString(html, null); HTMLLoaded = false; }
void SetHTML(string html) { ResultsWindow.NavigateToString(html); }
private void openResults() { ResultsWindow resultsWin = new ResultsWindow(Event); resultsWin.Show( ); }
private void DisplayResults() { ResultsWindow results = new ResultsWindow(); results.Show(); }