//------------------------------------------------------------------------------
// 
//     此代码由工具生成。
//     运行时版本:4.0.30319.42000
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// 
//------------------------------------------------------------------------------
// 
// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。
// 
#pragma warning disable 1591
namespace FactorySystemBll.WeChatMsg {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.Xml.Serialization;
    using System.ComponentModel;
    
    
    /// 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="SendPLMMsgInterfaceSoap", Namespace="http://tempuri.org/")]
    public partial class SendPLMMsgInterface : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback SendMsgOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// 
        public SendPLMMsgInterface() {
            this.Url = global::FactorySystemBll.Properties.Settings.Default.WeChatMsg;
            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;
            }
        }
        
        /// 
        public event SendMsgCompletedEventHandler SendMsgCompleted;
        
        /// 
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendMsg", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string SendMsg(string userid, string message, string send_system) {
            object[] results = this.Invoke("SendMsg", new object[] {
                        userid,
                        message,
                        send_system});
            return ((string)(results[0]));
        }
        
        /// 
        public void SendMsgAsync(string userid, string message, string send_system) {
            this.SendMsgAsync(userid, message, send_system, null);
        }
        
        /// 
        public void SendMsgAsync(string userid, string message, string send_system, object userState) {
            if ((this.SendMsgOperationCompleted == null)) {
                this.SendMsgOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendMsgOperationCompleted);
            }
            this.InvokeAsync("SendMsg", new object[] {
                        userid,
                        message,
                        send_system}, this.SendMsgOperationCompleted, userState);
        }
        
        private void OnSendMsgOperationCompleted(object arg) {
            if ((this.SendMsgCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SendMsgCompleted(this, new SendMsgCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// 
        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;
        }
    }
    
    /// 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
    public delegate void SendMsgCompletedEventHandler(object sender, SendMsgCompletedEventArgs e);
    
    /// 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SendMsgCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SendMsgCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// 
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
}
#pragma warning restore 1591