-
Notifications
You must be signed in to change notification settings - Fork 3
/
QuickFillWindow.xaml.cs
48 lines (42 loc) · 1.4 KB
/
QuickFillWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System.Windows;
using System.Windows.Controls;
using System.Collections.Generic;
namespace UsosApiBrowser
{
public partial class QuickFillWindow : Window
{
public QuickFillWindow()
{
InitializeComponent();
}
private void okButton_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
this.Close();
}
private void cancelButton_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
this.Close();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
foreach (ApiScope scope in ((BrowserWindow)this.Owner).scopes)
{
var cb = new CheckBox { Content = scope.key, Width = 130 };
((BrowserWindow)this.Owner).varsCache.BindWithCheckBox("quickFill#" + scope.key, cb);
this.scopeCheckboxesPanel.Children.Add(cb);
}
}
internal System.Collections.Generic.List<string> GetSelectedScopeKeys()
{
var scopes = new List<string>();
foreach (CheckBox cb in this.scopeCheckboxesPanel.Children)
{
if (cb.IsChecked == true)
scopes.Add(cb.Content.ToString());
}
return scopes;
}
}
}