-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClickHandler.cs
46 lines (40 loc) · 1.26 KB
/
ClickHandler.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EsriApplicationChooser
{
class ClickHandler
{
private string _tag;
public ClickHandler(string tag)
{
this._tag = tag;
}
internal void HandleClick()
{
Configuration config = Configuration.GetConfig();
ServiceElement service = config.Services[_tag];
UrlElement url = config.Urls[_tag];
ApplicationElement application = config.Applications[_tag];
if (service != null) { HandleService(service); }
if (url != null) { HandleUrl(url); }
if (application != null) { HandleApplication(application); }
}
private void HandleService(ServiceElement service)
{
ServiceHandler handler = new ServiceHandler();
handler.Handle(service.Name);
}
private void HandleUrl(UrlElement url)
{
UrlHandler handler = new UrlHandler(url);
handler.Handle();
}
private void HandleApplication(ApplicationElement application)
{
ApplicationHandler handler = new ApplicationHandler(application);
handler.Handle();
}
}
}