00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #pragma warning disable 1591
00015
00016 namespace Mcs.Epm.MicrosoftProject.mpFx.LoginFormsWebService {
00017 using System.Diagnostics;
00018 using System.Web.Services;
00019 using System.ComponentModel;
00020 using System.Web.Services.Protocols;
00021 using System;
00022 using System.Xml.Serialization;
00023
00024
00025
00026 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]
00027 [System.Diagnostics.DebuggerStepThroughAttribute()]
00028 [System.ComponentModel.DesignerCategoryAttribute("code")]
00029 [System.Web.Services.WebServiceBindingAttribute(Name="LoginFormsSoap", Namespace="http://schemas.microsoft.com/office/project/server/webservices/LoginForms/")]
00030 public partial class LoginForms : System.Web.Services.Protocols.SoapHttpClientProtocol {
00031
00032 private System.Threading.SendOrPostCallback LoginOperationCompleted;
00033
00034 private System.Threading.SendOrPostCallback LogoffOperationCompleted;
00035
00036 private bool useDefaultCredentialsSetExplicitly;
00037
00038
00039 public LoginForms() {
00040 this.Url = global::Mcs.Epm.MicrosoftProject.mpFx.Properties.Settings.Default.Mcs_Epm_ProjectServer_mpFx_LoginFormsWebService_LoginForms;
00041 if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
00042 this.UseDefaultCredentials = true;
00043 this.useDefaultCredentialsSetExplicitly = false;
00044 }
00045 else {
00046 this.useDefaultCredentialsSetExplicitly = true;
00047 }
00048 }
00049
00050 public new string Url {
00051 get {
00052 return base.Url;
00053 }
00054 set {
00055 if ((((this.IsLocalFileSystemWebService(base.Url) == true)
00056 && (this.useDefaultCredentialsSetExplicitly == false))
00057 && (this.IsLocalFileSystemWebService(value) == false))) {
00058 base.UseDefaultCredentials = false;
00059 }
00060 base.Url = value;
00061 }
00062 }
00063
00064 public new bool UseDefaultCredentials {
00065 get {
00066 return base.UseDefaultCredentials;
00067 }
00068 set {
00069 base.UseDefaultCredentials = value;
00070 this.useDefaultCredentialsSetExplicitly = true;
00071 }
00072 }
00073
00074
00075 public event LoginCompletedEventHandler LoginCompleted;
00076
00077
00078 public event LogoffCompletedEventHandler LogoffCompleted;
00079
00080
00081 [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/LoginForms/Login", RequestNamespace="http://schemas.microsoft.com/office/project/server/webservices/LoginForms/", ResponseNamespace="http://schemas.microsoft.com/office/project/server/webservices/LoginForms/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
00082 public bool Login(string username, string password) {
00083 object[] results = this.Invoke("Login", new object[] {
00084 username,
00085 password});
00086 return ((bool)(results[0]));
00087 }
00088
00089
00090 public void LoginAsync(string username, string password) {
00091 this.LoginAsync(username, password, null);
00092 }
00093
00094
00095 public void LoginAsync(string username, string password, object userState) {
00096 if ((this.LoginOperationCompleted == null)) {
00097 this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted);
00098 }
00099 this.InvokeAsync("Login", new object[] {
00100 username,
00101 password}, this.LoginOperationCompleted, userState);
00102 }
00103
00104 private void OnLoginOperationCompleted(object arg) {
00105 if ((this.LoginCompleted != null)) {
00106 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
00107 this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
00108 }
00109 }
00110
00111
00112 [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/LoginForms/Logoff", RequestNamespace="http://schemas.microsoft.com/office/project/server/webservices/LoginForms/", ResponseNamespace="http://schemas.microsoft.com/office/project/server/webservices/LoginForms/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
00113 public void Logoff() {
00114 this.Invoke("Logoff", new object[0]);
00115 }
00116
00117
00118 public void LogoffAsync() {
00119 this.LogoffAsync(null);
00120 }
00121
00122
00123 public void LogoffAsync(object userState) {
00124 if ((this.LogoffOperationCompleted == null)) {
00125 this.LogoffOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoffOperationCompleted);
00126 }
00127 this.InvokeAsync("Logoff", new object[0], this.LogoffOperationCompleted, userState);
00128 }
00129
00130 private void OnLogoffOperationCompleted(object arg) {
00131 if ((this.LogoffCompleted != null)) {
00132 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
00133 this.LogoffCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
00134 }
00135 }
00136
00137
00138 public new void CancelAsync(object userState) {
00139 base.CancelAsync(userState);
00140 }
00141
00142 private bool IsLocalFileSystemWebService(string url) {
00143 if (((url == null)
00144 || (url == string.Empty))) {
00145 return false;
00146 }
00147 System.Uri wsUri = new System.Uri(url);
00148 if (((wsUri.Port >= 1024)
00149 && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
00150 return true;
00151 }
00152 return false;
00153 }
00154 }
00155
00156
00157 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]
00158 public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e);
00159
00160
00161 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]
00162 [System.Diagnostics.DebuggerStepThroughAttribute()]
00163 [System.ComponentModel.DesignerCategoryAttribute("code")]
00164 public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
00165
00166 private object[] results;
00167
00168 internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
00169 base(exception, cancelled, userState) {
00170 this.results = results;
00171 }
00172
00173
00174 public bool Result {
00175 get {
00176 this.RaiseExceptionIfNecessary();
00177 return ((bool)(this.results[0]));
00178 }
00179 }
00180 }
00181
00182
00183 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")]
00184 public delegate void LogoffCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
00185 }
00186
00187 #pragma warning restore 1591