00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 using System;
00013 using System.Web.Services.Protocols;
00014 using Mcs.Epm.MicrosoftProject.mpFx.Proxies;
00015
00016 namespace Mcs.Epm.MicrosoftProject.mpFx
00017 {
00018 public class ProxyContainer
00019 {
00020
00021
00022
00023
00024
00025
00026 internal static string AppendPath(string url,
00027 string path)
00028 {
00029 if (!url.EndsWith("/", StringComparison.OrdinalIgnoreCase))
00030 {
00031 url = url + "/";
00032 }
00033
00034 return url + path;
00035 }
00036
00037 private readonly string _SSPBaseURL;
00038
00039 private StatusingProxy _StatusingProxy;
00040 private LoginWindowsProxy _LoginWindowsProxy;
00041
00042 public ProxyContainer(string sspBaseURL)
00043 {
00044 _SSPBaseURL = sspBaseURL;
00045 }
00046
00047 #region Private Methods
00048
00049 public StatusingProxy Statusing
00050 {
00051 get
00052 {
00053 if (_StatusingProxy == null)
00054 {
00055 _StatusingProxy = new StatusingProxy();
00056 ConfigureService(_StatusingProxy, LocalServicePaths.StatusingWebService);
00057 }
00058
00059 return _StatusingProxy;
00060
00061 }
00062 }
00063
00064 public LoginWindowsProxy LoginWindows
00065 {
00066 get
00067 {
00068 if (_LoginWindowsProxy == null)
00069 {
00070 _LoginWindowsProxy = new LoginWindowsProxy();
00071 ConfigureService(_LoginWindowsProxy, LocalServicePaths.WindowsLoginService);
00072 }
00073
00074 return _LoginWindowsProxy;
00075 }
00076 }
00077
00078
00079
00080
00081
00082
00083 private void ConfigureService(HttpWebClientProtocol service,
00084 string servicePath)
00085 {
00086 service.Url = AppendPath(_SSPBaseURL, servicePath);
00087 }
00088
00089 #endregion
00090 }
00091 }