aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService/App_Start/RouteConfig.cs
blob: 613e83e72c2995fb8ab1800ffb3487ffbca29c65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Tango.MachineService
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Downloads", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
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)); } } } }