iSchedulerAreaRegistration.cs
4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using Vrh.iScheduler;
namespace Vrh.Web.iScheduler.Areas.iScheduler
{
/// <summary>
/// Az iScheduler area regisztrációja.
/// </summary>
public class iSchedulerAreaRegistration : AreaRegistration
{
/// <summary>
/// Csak olvasható tulajdonság, mely konstans módon visszaadja az area nevét.
/// </summary>
public override string AreaName
{
get { return SchConst.AREA; }
}
/// <summary>
/// Az area regisztrációjának belépési pontja.
/// </summary>
/// <remarks>
/// Ide kell tenni minden olyan dolgot,
/// melyet az area felélesztésekor el kell végezni.
/// Például:
/// - a szókódok inicializálása
/// - vagy a komponens működéséhez szükséges adatbázis migrációjának elvégzése
/// </remarks>
/// <param name="context"></param>
public override void RegisterArea(AreaRegistrationContext context)
{
RegisterRoutes(context);
RegisterBundles(BundleTable.Bundles);
//nyelvi fordítások inicializálása
VRH.Log4Pro.MultiLanguageManager.MultiLanguageManager.InitializeWordCodes(typeof(SchedulerWordCodes));
}
private void RegisterRoutes(AreaRegistrationContext context)
{
if (context == null) { throw new ArgumentNullException("context"); }
context.MapRoute(
this.AreaName + "_default",
this.AreaName + "/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
private void RegisterBundles(BundleCollection bundles)
{
if (bundles == null) { throw new ArgumentNullException("bundles"); }
string contentPrefix = string.Concat("~/Areas/", this.AreaName, "/Content/");
string scriptsPrefix = string.Concat("~/Areas/", this.AreaName, "/Scripts/");
#region Content - Componens (area) CSS összetevői
bundles.Add(new StyleBundle(SchConst.BUNDLES_STYLE_FOR_EDITOR).Include(
"~/Content/themes/base/autocomplete.css",
string.Concat(contentPrefix, "bootstrap-datetimepicker.min.css"),
string.Concat(contentPrefix, "Editor.css")
));
bundles.Add(new StyleBundle(SchConst.BUNDLES_STYLE_FOR_MANAGER).Include(
"~/Content/DataTables/css/dataTables.bootstrap4.min.css",
string.Concat(contentPrefix, "bootstrap-toggle.css"),
string.Concat(contentPrefix, "Manager.css")
));
bundles.Add(new StyleBundle(SchConst.BUNDLES_STYLE_FOR_MANAGERCALENDAR).Include(
"~/Content/fullcalendar.min.css",
string.Concat(contentPrefix, "bootstrap-toggle.css"),
string.Concat(contentPrefix, "ManagerCalendar.css")
));
#endregion Content - Componens (area) CSS összetevői
#region Scripts - Componens (area) javascript összetevői
bundles.Add(new ScriptBundle(SchConst.BUNDLES_SCRIPT_FOR_EDITOR).Include(
"~/Scripts/moment-with-locales.min.js",
"~/Scripts/jquery-ui-1.13.2.min.js",
string.Concat(scriptsPrefix, "bootstrap-datetimepicker.min.js"),
string.Concat(scriptsPrefix, "Editor.js")
));
bundles.Add(new ScriptBundle(SchConst.BUNDLES_SCRIPT_FOR_MANAGER).Include(
"~/Scripts/DataTables/jquery.dataTables.min.js",
"~/Scripts/DataTables/dataTables.bootstrap4.min.js",
"~/Scripts/moment-with-locales.min.js",
string.Concat(scriptsPrefix, "bootstrap-toggle.js"),
string.Concat(scriptsPrefix, "Manager.js")
));
bundles.Add(new ScriptBundle(SchConst.BUNDLES_SCRIPT_FOR_MANAGERCALENDAR).Include(
"~/Scripts/moment-with-locales.min.js",
"~/Scripts/jquery-ui-1.13.2.min.js",
"~/Scripts/fullcalendar.min.js",
string.Concat(scriptsPrefix, "bootstrap-toggle.js")
));
#endregion Scripts - Componens (area) javascript összetevői
}
}
}