MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / MainForm

Method MainForm

src/NodeRTUI/MainForm.cs:36–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 private IEnumerable<string> _namespaces;
35
36 public MainForm()
37 {
38 InitializeComponent();
39
40 var queryTextChangedObservable =
41 Observable.FromEventPattern<EventHandler, EventArgs>
42 (s => txtFilter.TextChanged += s, s => txtFilter.TextChanged -= s);
43
44 queryTextChangedObservable
45 .Throttle(TimeSpan.FromMilliseconds(100))
46 .Scan(new { cts = new CancellationTokenSource(), e = default(EventPattern<EventArgs>) },
47 (previous, newObj) =>
48 {
49 previous.cts.Cancel();
50 return new { cts = new CancellationTokenSource(), e = newObj };
51 })
52 .ObserveOn(SynchronizationContext.Current)
53 .Subscribe(s =>
54 {
55 FilterNamespaces();
56 });
57
58 try
59 {
60 chkDefGen.Checked = Properties.Settings.Default.GenerateDefsChk;
61 txtFilename.Text = Properties.Settings.Default.LastWinMDPath;
62 txtFilter.Text = Properties.Settings.Default.LastFilter;
63 cmbVsVersion.SelectedIndex = Properties.Settings.Default.VsVersionComboSelection;
64 cmbWindowsVersion.SelectedIndex = Properties.Settings.Default.WinVersionComboSelection;
65 chkBuildModule.Checked = Properties.Settings.Default.BuildModuleChk;
66
67 if (String.IsNullOrEmpty(Properties.Settings.Default.OutputDirPath))
68 {
69 Properties.Settings.Default.OutputDirPath = GetDefaultOutputDir();
70 Properties.Settings.Default.Save();
71 }
72
73 txtOutputDirectory.Text = Properties.Settings.Default.OutputDirPath;
74
75 if (!string.IsNullOrWhiteSpace(txtFilename.Text))
76 {
77 LoadNamespaces(txtFilename.Text);
78 }
79 }
80 catch
81 {
82 // failed...reset everything..
83 ClearSettingsAndUI();
84 }
85 }
86
87 private void ClearSettingsAndUI()
88 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected