Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKB/HeuristicLab.OKB.Cockpit.Admin/TableOverview.xaml.cs @ 5510

Last change on this file since 5510 was 4311, checked in by swagner, 14 years ago

Integrated OKB clients for HL 3.3 (#1166)

File size: 2.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Controls;
6using HeuristicLab.BackgroundProcessing;
7using System.Windows;
8using System.IO.Compression;
9using System.IO;
10using HeuristicLab.MainForm.WPF;
11using HeuristicLab.MainForm;
12using System.Windows.Input;
13
14namespace 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}
Note: See TracBrowser for help on using the repository browser.