SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
HideTabs.xaml.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Windows;
6 using System.Windows.Controls;
7 using System.Windows.Data;
8 using System.Windows.Documents;
9 using System.Windows.Input;
10 using System.Windows.Media;
11 using System.Windows.Media.Imaging;
12 using System.Windows.Shapes;
13 using System.Data;
14 
15 namespace SeciUserInterface.Dialogs.Tabs
16 {
20  public partial class HideTabs : Window
21  {
22  Seci.SerialisableList<Seci.Definitions.Tab> _tabs;
23  DataTable _dt;
24 
25  public HideTabs(Seci.SerialisableList<Seci.Definitions.Tab> tabs)
26  {
27  InitializeComponent();
28  _tabs = tabs;
29  }
30 
31  private void Window_Loaded(object sender, RoutedEventArgs e)
32  {
33  _dt = new DataTable();
34  _dt.Columns.Add("Tab", typeof(string));
35  _dt.Columns.Add("Visible", typeof(Boolean));
36 
37  if (_tabs != null)
38  {
39  foreach (Seci.Definitions.Tab tab in _tabs)
40  {
41  _dt.Rows.Add(tab.Name, tab.VisibleForUser);
42  }
43  }
44  dgTabs.ItemsSource = _dt.DefaultView;
45  }
46 
47  private void btnCancel_Click(object sender, RoutedEventArgs e)
48  {
49  DialogResult = false;
50  this.Close();
51  }
52 
53  private void btnOk_Click(object sender, RoutedEventArgs e)
54  {
55  foreach (DataRow row in _dt.Rows)
56  {
57  foreach (Seci.Definitions.Tab tab in _tabs)
58  {
59  if (row.ItemArray[0].ToString() == tab.Name)
60  {
61  tab.VisibleForUser = (bool)row.ItemArray[1];
62  }
63  }
64  }
65 
66  DialogResult = true;
67  this.Close();
68  }
69  }
70 }
void btnCancel_Click(object sender, RoutedEventArgs e)
void Window_Loaded(object sender, RoutedEventArgs e)
HideTabs(Seci.SerialisableList< Seci.Definitions.Tab > tabs)
Seci.SerialisableList< Seci.Definitions.Tab > _tabs
void btnOk_Click(object sender, RoutedEventArgs e)
Interaction logic for HideTabs.xaml