//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1433
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.1433.
// 
#pragma warning disable 1591

namespace EQTrack.BlackhawkLoginService {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="CorporateLoginSoap", Namespace="http://www.theblackhawk.co.nz/")]
    public partial class CorporateLogin : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback VersionOperationCompleted;
        
        private System.Threading.SendOrPostCallback LoginOperationCompleted;
        
        private System.Threading.SendOrPostCallback LogoutOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetUsersOnlineOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetUserNameByEmailOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetMyInfoOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public CorporateLogin() {
            this.Url = global::EQTrack.Properties.Settings.Default.EQTrack_BlackhawkLoginService_BlackhawkLogin;
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event VersionCompletedEventHandler VersionCompleted;
        
        /// <remarks/>
        public event LoginCompletedEventHandler LoginCompleted;
        
        /// <remarks/>
        public event LogoutCompletedEventHandler LogoutCompleted;
        
        /// <remarks/>
        public event GetUsersOnlineCompletedEventHandler GetUsersOnlineCompleted;
        
        /// <remarks/>
        public event GetUserNameByEmailCompletedEventHandler GetUserNameByEmailCompleted;
        
        /// <remarks/>
        public event GetMyInfoCompletedEventHandler GetMyInfoCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/Version", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string Version() {
            object[] results = this.Invoke("Version", new object[0]);
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void VersionAsync() {
            this.VersionAsync(null);
        }
        
        /// <remarks/>
        public void VersionAsync(object userState) {
            if ((this.VersionOperationCompleted == null)) {
                this.VersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnVersionOperationCompleted);
            }
            this.InvokeAsync("Version", new object[0], this.VersionOperationCompleted, userState);
        }
        
        private void OnVersionOperationCompleted(object arg) {
            if ((this.VersionCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.VersionCompleted(this, new VersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/Login", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public bool Login(string Username, string Password) {
            object[] results = this.Invoke("Login", new object[] {
                        Username,
                        Password});
            return ((bool)(results[0]));
        }
        
        /// <remarks/>
        public void LoginAsync(string Username, string Password) {
            this.LoginAsync(Username, Password, null);
        }
        
        /// <remarks/>
        public void LoginAsync(string Username, string Password, object userState) {
            if ((this.LoginOperationCompleted == null)) {
                this.LoginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoginOperationCompleted);
            }
            this.InvokeAsync("Login", new object[] {
                        Username,
                        Password}, this.LoginOperationCompleted, userState);
        }
        
        private void OnLoginOperationCompleted(object arg) {
            if ((this.LoginCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.LoginCompleted(this, new LoginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/Logout", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public void Logout() {
            this.Invoke("Logout", new object[0]);
        }
        
        /// <remarks/>
        public void LogoutAsync() {
            this.LogoutAsync(null);
        }
        
        /// <remarks/>
        public void LogoutAsync(object userState) {
            if ((this.LogoutOperationCompleted == null)) {
                this.LogoutOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogoutOperationCompleted);
            }
            this.InvokeAsync("Logout", new object[0], this.LogoutOperationCompleted, userState);
        }
        
        private void OnLogoutOperationCompleted(object arg) {
            if ((this.LogoutCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.LogoutCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetUsersOnline", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public int GetUsersOnline() {
            object[] results = this.Invoke("GetUsersOnline", new object[0]);
            return ((int)(results[0]));
        }
        
        /// <remarks/>
        public void GetUsersOnlineAsync() {
            this.GetUsersOnlineAsync(null);
        }
        
        /// <remarks/>
        public void GetUsersOnlineAsync(object userState) {
            if ((this.GetUsersOnlineOperationCompleted == null)) {
                this.GetUsersOnlineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUsersOnlineOperationCompleted);
            }
            this.InvokeAsync("GetUsersOnline", new object[0], this.GetUsersOnlineOperationCompleted, userState);
        }
        
        private void OnGetUsersOnlineOperationCompleted(object arg) {
            if ((this.GetUsersOnlineCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetUsersOnlineCompleted(this, new GetUsersOnlineCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetUserNameByEmail", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetUserNameByEmail(string email) {
            object[] results = this.Invoke("GetUserNameByEmail", new object[] {
                        email});
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetUserNameByEmailAsync(string email) {
            this.GetUserNameByEmailAsync(email, null);
        }
        
        /// <remarks/>
        public void GetUserNameByEmailAsync(string email, object userState) {
            if ((this.GetUserNameByEmailOperationCompleted == null)) {
                this.GetUserNameByEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserNameByEmailOperationCompleted);
            }
            this.InvokeAsync("GetUserNameByEmail", new object[] {
                        email}, this.GetUserNameByEmailOperationCompleted, userState);
        }
        
        private void OnGetUserNameByEmailOperationCompleted(object arg) {
            if ((this.GetUserNameByEmailCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetUserNameByEmailCompleted(this, new GetUserNameByEmailCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetMyInfo", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetMyInfo() {
            object[] results = this.Invoke("GetMyInfo", new object[0]);
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetMyInfoAsync() {
            this.GetMyInfoAsync(null);
        }
        
        /// <remarks/>
        public void GetMyInfoAsync(object userState) {
            if ((this.GetMyInfoOperationCompleted == null)) {
                this.GetMyInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMyInfoOperationCompleted);
            }
            this.InvokeAsync("GetMyInfo", new object[0], this.GetMyInfoOperationCompleted, userState);
        }
        
        private void OnGetMyInfoOperationCompleted(object arg) {
            if ((this.GetMyInfoCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetMyInfoCompleted(this, new GetMyInfoCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void VersionCompletedEventHandler(object sender, VersionCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class VersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal VersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void LoginCompletedEventHandler(object sender, LoginCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class LoginCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal LoginCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public bool Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((bool)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void LogoutCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetUsersOnlineCompletedEventHandler(object sender, GetUsersOnlineCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetUsersOnlineCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetUsersOnlineCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public int Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((int)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetUserNameByEmailCompletedEventHandler(object sender, GetUserNameByEmailCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetUserNameByEmailCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetUserNameByEmailCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetMyInfoCompletedEventHandler(object sender, GetMyInfoCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetMyInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetMyInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591