1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using Com.Piwigo.Lib.Service; |
---|
6 | |
---|
7 | namespace Com.Piwigo.Lib.IService |
---|
8 | { |
---|
9 | public sealed class PwgServiceProvider |
---|
10 | { |
---|
11 | static readonly PwgServiceProviderBase _instance = new PwgServiceProviderBase(); |
---|
12 | |
---|
13 | // Explicit static constructor to tell C# compiler |
---|
14 | // not to mark type as beforefieldinit |
---|
15 | static PwgServiceProvider() |
---|
16 | { |
---|
17 | } |
---|
18 | |
---|
19 | public static PwgServiceProviderBase Instance |
---|
20 | { |
---|
21 | get |
---|
22 | { |
---|
23 | return _instance; |
---|
24 | } |
---|
25 | } |
---|
26 | |
---|
27 | public class PwgServiceProviderBase |
---|
28 | { |
---|
29 | private IPwgAlbumsService _pwgAlbumsService; |
---|
30 | public IPwgAlbumsService PwgAlbumsService |
---|
31 | { |
---|
32 | get |
---|
33 | { |
---|
34 | if (_pwgAlbumsService == null) |
---|
35 | { |
---|
36 | _pwgAlbumsService = new PwgAlbumsService(); |
---|
37 | } |
---|
38 | return _pwgAlbumsService; |
---|
39 | } |
---|
40 | } |
---|
41 | |
---|
42 | private IPwgSessionService _pwgSessionService; |
---|
43 | public IPwgSessionService PwgSessionService |
---|
44 | { |
---|
45 | get |
---|
46 | { |
---|
47 | if (_pwgSessionService == null) |
---|
48 | { |
---|
49 | _pwgSessionService = new PwgSessionService(); |
---|
50 | } |
---|
51 | return _pwgSessionService; |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | private IPwgTagsService _pwgTagsService; |
---|
57 | public IPwgTagsService PwgTagsService |
---|
58 | { |
---|
59 | get |
---|
60 | { |
---|
61 | if (_pwgTagsService == null) |
---|
62 | { |
---|
63 | _pwgTagsService = new PwgTagsService(); |
---|
64 | } |
---|
65 | return _pwgTagsService; |
---|
66 | } |
---|
67 | } |
---|
68 | |
---|
69 | private IPwgImagesService _pwgImagesService; |
---|
70 | public IPwgImagesService PwgImagesService |
---|
71 | { |
---|
72 | get |
---|
73 | { |
---|
74 | if (_pwgImagesService == null) |
---|
75 | { |
---|
76 | _pwgImagesService = new PwgImagesService(); |
---|
77 | } |
---|
78 | return _pwgImagesService; |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | private IPwgSetupService _pwgSetupService; |
---|
83 | public IPwgSetupService PwgSetupService |
---|
84 | { |
---|
85 | get |
---|
86 | { |
---|
87 | if (_pwgSetupService == null) |
---|
88 | { |
---|
89 | _pwgSetupService = new PwgSetupService(); |
---|
90 | } |
---|
91 | return _pwgSetupService; |
---|
92 | } |
---|
93 | } |
---|
94 | } |
---|
95 | |
---|
96 | } |
---|
97 | } |
---|