Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

270 lines
7.0 KiB

  1. using System;
  2. using System.Text;
  3. using System.Net;
  4. using System.IO;
  5. using System.Text.RegularExpressions;
  6. using System.Runtime.Remoting;
  7. using System.Globalization;
  8. using System.Security;
  9. using System.Security.Policy;
  10. using System.Security.Permissions;
  11. using System.Collections;
  12. using System.Runtime.InteropServices;
  13. using System.Reflection;
  14. using System.Configuration.Assemblies;
  15. using System.Threading;
  16. using System.Xml;
  17. using System.Xml.XPath;
  18. namespace Microsoft.Fusion.ADF
  19. {
  20. public enum FileType : int
  21. {
  22. Unknown = 0,
  23. RawFile = 1,
  24. ApplicationManifest = 2,
  25. ComponentManifest = 3
  26. }
  27. //----------------------------------------------------------
  28. // ApplicationMonikerRequest
  29. //----------------------------------------------------------
  30. public class ApplicationMonikerRequest : WebRequest
  31. {
  32. public FileType type;
  33. string _appStorePath;
  34. Uri _appBase;
  35. ApplicationMonikerResponse _appMonResponse;
  36. AsyncCallback _clientRespCallback;
  37. Uri _requestUri;
  38. //----------------------------------------------------------
  39. // Constructor
  40. //----------------------------------------------------------
  41. public static new WebRequest Create(System.Uri uri)
  42. {
  43. ApplicationMonikerRequest apm = new ApplicationMonikerRequest();
  44. return apm;
  45. }
  46. //----------------------------------------------------------
  47. // Constructor
  48. //----------------------------------------------------------
  49. public static WebRequest Create(Uri uri, Uri appBase, string appStorePath)
  50. {
  51. ApplicationMonikerRequest apm = new ApplicationMonikerRequest();
  52. apm._appStorePath = appStorePath;
  53. apm._appBase = appBase;
  54. apm._appMonResponse = new ApplicationMonikerResponse(uri, appBase, appStorePath);
  55. apm.type = FileType.Unknown;
  56. apm._requestUri = uri;
  57. return apm;
  58. }
  59. //----------------------------------------------------------
  60. // Abort
  61. //----------------------------------------------------------
  62. public override void Abort()
  63. {
  64. }
  65. //----------------------------------------------------------
  66. // BeginGetRequestStream
  67. //----------------------------------------------------------
  68. public override IAsyncResult BeginGetRequestStream(
  69. AsyncCallback callback,
  70. object state)
  71. {
  72. return null;
  73. }
  74. //----------------------------------------------------------
  75. // EndGetRequestStream
  76. //----------------------------------------------------------
  77. public override Stream EndGetRequestStream(
  78. IAsyncResult asyncResult)
  79. {
  80. return null;
  81. }
  82. //----------------------------------------------------------
  83. // BeginGetResponse
  84. //----------------------------------------------------------
  85. public override IAsyncResult BeginGetResponse(
  86. AsyncCallback callback,
  87. object state)
  88. {
  89. _clientRespCallback = callback;
  90. IAsyncResult ar = new AsyncResult(state, null, true, true);
  91. ResponseCallback(ar);
  92. return ar;
  93. }
  94. //----------------------------------------------------------
  95. // EndGetResponse
  96. //----------------------------------------------------------
  97. public override WebResponse EndGetResponse(
  98. IAsyncResult asyncResult)
  99. {
  100. return _appMonResponse;
  101. }
  102. //----------------------------------------------------------
  103. // BeginGetRequestStream
  104. //----------------------------------------------------------
  105. public override Stream GetRequestStream()
  106. {
  107. return null;
  108. }
  109. //----------------------------------------------------------
  110. // GetResponse
  111. //----------------------------------------------------------
  112. public override WebResponse GetResponse()
  113. {
  114. return _appMonResponse;
  115. }
  116. //-----------------------------------------------------------------------
  117. //----------------------------------------------------------
  118. // Response callback
  119. //----------------------------------------------------------
  120. private void ResponseCallback(IAsyncResult ar)
  121. {
  122. _clientRespCallback(ar);
  123. }
  124. //----------------------------------------------------------
  125. // Property methods
  126. //----------------------------------------------------------
  127. public override string ConnectionGroupName
  128. {
  129. get { return null; }
  130. set {}
  131. }
  132. //----------------------------------------------------------
  133. // ContentLength
  134. //----------------------------------------------------------
  135. public override long ContentLength
  136. {
  137. get
  138. { return 0; }
  139. set
  140. {}
  141. }
  142. //----------------------------------------------------------
  143. // ContentType
  144. //----------------------------------------------------------
  145. public override string ContentType
  146. {
  147. get
  148. { return null; }
  149. set
  150. { }
  151. }
  152. //----------------------------------------------------------
  153. // Credentials
  154. //----------------------------------------------------------
  155. public override ICredentials Credentials
  156. {
  157. get
  158. { return null; }
  159. set
  160. { }
  161. }
  162. //----------------------------------------------------------
  163. // Headers
  164. //----------------------------------------------------------
  165. public override WebHeaderCollection Headers
  166. {
  167. get
  168. { return null; }
  169. set
  170. { }
  171. }
  172. //----------------------------------------------------------
  173. // Method
  174. //----------------------------------------------------------
  175. public override string Method
  176. {
  177. get
  178. { return null;}
  179. set
  180. { }
  181. }
  182. //----------------------------------------------------------
  183. // PreAuthenticate
  184. //----------------------------------------------------------
  185. public override bool PreAuthenticate
  186. {
  187. get
  188. { return false; }
  189. set
  190. { }
  191. }
  192. //----------------------------------------------------------
  193. // Proxy
  194. //----------------------------------------------------------
  195. public override IWebProxy Proxy
  196. {
  197. get
  198. { return null;}
  199. set
  200. { }
  201. }
  202. //----------------------------------------------------------
  203. // RequestUri
  204. //----------------------------------------------------------
  205. public override Uri RequestUri
  206. {
  207. get
  208. { return _requestUri; }
  209. }
  210. //----------------------------------------------------------
  211. // Timeout
  212. //----------------------------------------------------------
  213. public override int Timeout
  214. {
  215. get
  216. { return 0; }
  217. set
  218. { }
  219. }
  220. //----------------------------------------------------------
  221. // CachedCopyExists
  222. //----------------------------------------------------------
  223. public bool CachedCopyExists()
  224. {
  225. return _appMonResponse.CachedCopyExists();
  226. }
  227. //----------------------------------------------------------
  228. // GetCacheFileSize
  229. //----------------------------------------------------------
  230. public long GetCacheFileSize()
  231. {
  232. return _appMonResponse.GetCacheFileSize();
  233. }
  234. //----------------------------------------------------------
  235. // Dispose
  236. //----------------------------------------------------------
  237. public void Dispose()
  238. {
  239. _appMonResponse.Dispose();
  240. }
  241. }
  242. }