blob: e136c5983cb529ec7ffe1382e9162984677b6583 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highliusing System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Tango.Core.Commands;
using Tango.MachineStudio.DB.CustomAttributes;
using Tango.MachineStudio.DB.Views.DBViews;
namespace Tango.MachineStudio.DB.Managers
{
/// <summary>
/// Represents the data table views manager.
/// </summary>
public static class ViewsManager
{
/// <summary>
/// Gets or sets the displayed views.
/// </summary>
public static ObservableCollection<RegisteredView> DisplayedViews { get; set; }
/// <summary>
/// Gets or sets all the views.
/// </summary>
public static ObservableCollection<RegisteredView> DbViews { get; set; }
/// <summary>
/// Initializes the <see cref="ViewsManager"/> class.
/// </summary>
static ViewsManager()
{
DisplayedViews = new ObservableCollection<RegisteredView>();
DbViews = new ObservableCollection<RegisteredView>();
foreach (var type in typeof(ViewsManager).Assembly.GetTypes().Where(x => x.CustomAttributes.Count() > 0 && x.CustomAttributes.First().AttributeType == typeof(DBViewAttribute)).OrderBy(x => x.Name))
{
DbViews.Add(new RegisteredView(type.Name.Replace("View", "").ToTitle(), Activator.CreateInstance(type) as FrameworkElement));
}
}
}
}
|