1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows.Controls;
|
---|
6 | using HeuristicLab.BackgroundProcessing;
|
---|
7 | using System.Windows;
|
---|
8 | using System.IO.Compression;
|
---|
9 | using System.IO;
|
---|
10 | using HeuristicLab.MainForm.WPF;
|
---|
11 | using HeuristicLab.MainForm;
|
---|
12 | using System.Windows.Input;
|
---|
13 |
|
---|
14 | namespace HeuristicLab.OKB.Cockpit.Admin {
|
---|
15 | public partial class TableOverview : UserControl, IAutoView, IOKBCockpitItem {
|
---|
16 |
|
---|
17 | public TableOverview() {
|
---|
18 | InitializeComponent();
|
---|
19 | }
|
---|
20 |
|
---|
21 | protected void OnClick(object sender, RoutedEventArgs args) {
|
---|
22 | string tableName = ((Button)args.Source).Name;
|
---|
23 | TableView tableView = null;
|
---|
24 | if (Keyboard.Modifiers != ModifierKeys.Shift) {
|
---|
25 | tableView = (TableView)
|
---|
26 | MainFormManager.MainForm.Views
|
---|
27 | .FirstOrDefault(v => v is TableView && ((TableView)v).TableName == tableName);
|
---|
28 | }
|
---|
29 | if (tableView == null)
|
---|
30 | tableView = new TableView() { TableName = tableName };
|
---|
31 | tableView.Show();
|
---|
32 | }
|
---|
33 |
|
---|
34 | #region IView Members
|
---|
35 |
|
---|
36 | public string Caption {
|
---|
37 | get { return "OKB Admin Main View"; }
|
---|
38 | set { }
|
---|
39 | }
|
---|
40 |
|
---|
41 | public event EventHandler CaptionChanged;
|
---|
42 |
|
---|
43 | public event EventHandler Changed;
|
---|
44 |
|
---|
45 | public virtual void Close() {
|
---|
46 | MainFormManager.GetMainForm<WPFMainFormBase>().CloseView(this);
|
---|
47 | IsShown = false;
|
---|
48 | }
|
---|
49 |
|
---|
50 | public void Hide() {
|
---|
51 | MainFormManager.GetMainForm<WPFMainFormBase>().HideView(this);
|
---|
52 | IsShown = false;
|
---|
53 | }
|
---|
54 |
|
---|
55 | public bool IsShown { get; protected set; }
|
---|
56 |
|
---|
57 | private bool readOnly = false;
|
---|
58 | public bool ReadOnly {
|
---|
59 | get {
|
---|
60 | return readOnly;
|
---|
61 | }
|
---|
62 | set {
|
---|
63 | if (value == readOnly) return;
|
---|
64 | readOnly = value;
|
---|
65 | OnReadOnlyChanged();
|
---|
66 | }
|
---|
67 | }
|
---|
68 | public event EventHandler ReadOnlyChanged;
|
---|
69 | protected void OnReadOnlyChanged() {
|
---|
70 | EventHandler handler = ReadOnlyChanged;
|
---|
71 | if (handler != null)
|
---|
72 | handler(this, EventArgs.Empty);
|
---|
73 | }
|
---|
74 |
|
---|
75 | public void Show() {
|
---|
76 | MainFormManager.GetMainForm<WPFMainFormBase>().ShowView(this);
|
---|
77 | IsShown = true;
|
---|
78 | }
|
---|
79 |
|
---|
80 |
|
---|
81 | #endregion
|
---|
82 | }
|
---|
83 | }
|
---|