annotate Demo/WebServices/Client/WebClient/WebClientBaseT.cs @ 9:1e85f66cf767 default tip

update bltoolkit
author nickolay
date Thu, 05 Apr 2018 20:53:26 +0300
parents f990fcb411a9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
1 using BLToolkit.TypeBuilder;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
2
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
3 namespace Demo.WebServices.Client.WebClient
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
4 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
5 [System.Diagnostics.DebuggerStepThrough]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
6 [System.ComponentModel.DesignerCategory("Code")]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
7 public abstract class WebClientBase<T> : WebClientBase where T : WebClientBase /*<T> commented due to csc.exe bug */
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
8 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
9 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
10 /// Initializes a new instance of the <see cref="WebClientBase"/> class
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
11 /// using the namespace from WebServiceBinding attribute as url.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
12 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
13 protected WebClientBase()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
14 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
15 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
16
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
17 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
18 /// Initializes a new instance of the <see cref="WebClientBase"/> class.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
19 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
20 /// <param name="relativeUrl">Path to web service, relative to <see cref="WebClientBase.BaseUrl"/>.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
21 protected WebClientBase(string relativeUrl) : base(relativeUrl)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
22 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
23 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
24
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
25 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
26 /// Cached client instance.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
27 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
28 private static T _instance;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
29 public static T Instance
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
30 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
31 get { return _instance ?? (_instance = CreateInstance()); }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
32 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
33
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
34 protected static T CreateInstance()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
35 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
36 return TypeFactory.CreateInstance<T>();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
37 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
38 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
39 }