//------------------------------------------------------------------------------
// <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.BlackhawkSMSService {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    using System.Data;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="SMSServiceSoap", Namespace="http://www.theblackhawk.co.nz/")]
    public partial class SMSService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback PostSMSOperationCompleted;
        
        private System.Threading.SendOrPostCallback FindSMSFromNumberOperationCompleted;
        
        private System.Threading.SendOrPostCallback FindSMSMatchOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetLastErrorOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public SMSService() {
            this.Url = global::EQTrack.Properties.Settings.Default.EQTrack_BlackhawkSMSService_SMSService;
            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 PostSMSCompletedEventHandler PostSMSCompleted;
        
        /// <remarks/>
        public event FindSMSFromNumberCompletedEventHandler FindSMSFromNumberCompleted;
        
        /// <remarks/>
        public event FindSMSMatchCompletedEventHandler FindSMSMatchCompleted;
        
        /// <remarks/>
        public event GetLastErrorCompletedEventHandler GetLastErrorCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/PostSMS", 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 PostSMS(string Number, string Text, string schedule, int DeviceSet) {
            object[] results = this.Invoke("PostSMS", new object[] {
                        Number,
                        Text,
                        schedule,
                        DeviceSet});
            return ((int)(results[0]));
        }
        
        /// <remarks/>
        public void PostSMSAsync(string Number, string Text, string schedule, int DeviceSet) {
            this.PostSMSAsync(Number, Text, schedule, DeviceSet, null);
        }
        
        /// <remarks/>
        public void PostSMSAsync(string Number, string Text, string schedule, int DeviceSet, object userState) {
            if ((this.PostSMSOperationCompleted == null)) {
                this.PostSMSOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPostSMSOperationCompleted);
            }
            this.InvokeAsync("PostSMS", new object[] {
                        Number,
                        Text,
                        schedule,
                        DeviceSet}, this.PostSMSOperationCompleted, userState);
        }
        
        private void OnPostSMSOperationCompleted(object arg) {
            if ((this.PostSMSCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.PostSMSCompleted(this, new PostSMSCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/FindSMSFromNumber", 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 System.Data.DataTable FindSMSFromNumber(string Number) {
            object[] results = this.Invoke("FindSMSFromNumber", new object[] {
                        Number});
            return ((System.Data.DataTable)(results[0]));
        }
        
        /// <remarks/>
        public void FindSMSFromNumberAsync(string Number) {
            this.FindSMSFromNumberAsync(Number, null);
        }
        
        /// <remarks/>
        public void FindSMSFromNumberAsync(string Number, object userState) {
            if ((this.FindSMSFromNumberOperationCompleted == null)) {
                this.FindSMSFromNumberOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindSMSFromNumberOperationCompleted);
            }
            this.InvokeAsync("FindSMSFromNumber", new object[] {
                        Number}, this.FindSMSFromNumberOperationCompleted, userState);
        }
        
        private void OnFindSMSFromNumberOperationCompleted(object arg) {
            if ((this.FindSMSFromNumberCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.FindSMSFromNumberCompleted(this, new FindSMSFromNumberCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/FindSMSMatch", 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 System.Data.DataTable FindSMSMatch(string match) {
            object[] results = this.Invoke("FindSMSMatch", new object[] {
                        match});
            return ((System.Data.DataTable)(results[0]));
        }
        
        /// <remarks/>
        public void FindSMSMatchAsync(string match) {
            this.FindSMSMatchAsync(match, null);
        }
        
        /// <remarks/>
        public void FindSMSMatchAsync(string match, object userState) {
            if ((this.FindSMSMatchOperationCompleted == null)) {
                this.FindSMSMatchOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindSMSMatchOperationCompleted);
            }
            this.InvokeAsync("FindSMSMatch", new object[] {
                        match}, this.FindSMSMatchOperationCompleted, userState);
        }
        
        private void OnFindSMSMatchOperationCompleted(object arg) {
            if ((this.FindSMSMatchCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.FindSMSMatchCompleted(this, new FindSMSMatchCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetLastError", 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 GetLastError() {
            object[] results = this.Invoke("GetLastError", new object[0]);
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetLastErrorAsync() {
            this.GetLastErrorAsync(null);
        }
        
        /// <remarks/>
        public void GetLastErrorAsync(object userState) {
            if ((this.GetLastErrorOperationCompleted == null)) {
                this.GetLastErrorOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLastErrorOperationCompleted);
            }
            this.InvokeAsync("GetLastError", new object[0], this.GetLastErrorOperationCompleted, userState);
        }
        
        private void OnGetLastErrorOperationCompleted(object arg) {
            if ((this.GetLastErrorCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetLastErrorCompleted(this, new GetLastErrorCompletedEventArgs(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 PostSMSCompletedEventHandler(object sender, PostSMSCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class PostSMSCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal PostSMSCompletedEventArgs(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 FindSMSFromNumberCompletedEventHandler(object sender, FindSMSFromNumberCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class FindSMSFromNumberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal FindSMSFromNumberCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public System.Data.DataTable Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataTable)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void FindSMSMatchCompletedEventHandler(object sender, FindSMSMatchCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class FindSMSMatchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal FindSMSMatchCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public System.Data.DataTable Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataTable)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetLastErrorCompletedEventHandler(object sender, GetLastErrorCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetLastErrorCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetLastErrorCompletedEventArgs(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