//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     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 4.0.30319.42000.
// 
#pragma warning disable 1591

namespace KenticoSiteConfigurationGenerator.com.kentico.service {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.Xml.Serialization;
    using System.ComponentModel;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="CMSLicenseServiceSoap", Namespace="http://www.kentico.com/")]
    public partial class CMSLicenseService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback GetKeyOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetKeyGeneralOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetTrialKeyOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetFreeEditionKeyOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetFreeEditionKeyGeneralOperationCompleted;
        
        private System.Threading.SendOrPostCallback UserExistsOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public CMSLicenseService() {
            this.Url = global::KenticoSiteConfigurationGenerator.Properties.Settings.Default.WebServiceDemo_com_kentico_www_CMSLicenseService;
            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 GetKeyCompletedEventHandler GetKeyCompleted;
        
        /// <remarks/>
        public event GetKeyGeneralCompletedEventHandler GetKeyGeneralCompleted;
        
        /// <remarks/>
        public event GetTrialKeyCompletedEventHandler GetTrialKeyCompleted;
        
        /// <remarks/>
        public event GetFreeEditionKeyCompletedEventHandler GetFreeEditionKeyCompleted;
        
        /// <remarks/>
        public event GetFreeEditionKeyGeneralCompletedEventHandler GetFreeEditionKeyGeneralCompleted;
        
        /// <remarks/>
        public event UserExistsCompletedEventHandler UserExistsCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.kentico.com/GetKey", RequestNamespace="http://www.kentico.com/", ResponseNamespace="http://www.kentico.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetKey(string data) {
            object[] results = this.Invoke("GetKey", new object[] {
                        data});
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetKeyAsync(string data) {
            this.GetKeyAsync(data, null);
        }
        
        /// <remarks/>
        public void GetKeyAsync(string data, object userState) {
            if ((this.GetKeyOperationCompleted == null)) {
                this.GetKeyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetKeyOperationCompleted);
            }
            this.InvokeAsync("GetKey", new object[] {
                        data}, this.GetKeyOperationCompleted, userState);
        }
        
        private void OnGetKeyOperationCompleted(object arg) {
            if ((this.GetKeyCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetKeyCompleted(this, new GetKeyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.kentico.com/GetKeyGeneral", RequestNamespace="http://www.kentico.com/", ResponseNamespace="http://www.kentico.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetKeyGeneral(string data, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> version, LicenseKeyTypeEnum type, out string errorMessage) {
            object[] results = this.Invoke("GetKeyGeneral", new object[] {
                        data,
                        version,
                        type});
            errorMessage = ((string)(results[1]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetKeyGeneralAsync(string data, System.Nullable<int> version, LicenseKeyTypeEnum type) {
            this.GetKeyGeneralAsync(data, version, type, null);
        }
        
        /// <remarks/>
        public void GetKeyGeneralAsync(string data, System.Nullable<int> version, LicenseKeyTypeEnum type, object userState) {
            if ((this.GetKeyGeneralOperationCompleted == null)) {
                this.GetKeyGeneralOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetKeyGeneralOperationCompleted);
            }
            this.InvokeAsync("GetKeyGeneral", new object[] {
                        data,
                        version,
                        type}, this.GetKeyGeneralOperationCompleted, userState);
        }
        
        private void OnGetKeyGeneralOperationCompleted(object arg) {
            if ((this.GetKeyGeneralCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetKeyGeneralCompleted(this, new GetKeyGeneralCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.kentico.com/GetTrialKey", RequestNamespace="http://www.kentico.com/", ResponseNamespace="http://www.kentico.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetTrialKey() {
            object[] results = this.Invoke("GetTrialKey", new object[0]);
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetTrialKeyAsync() {
            this.GetTrialKeyAsync(null);
        }
        
        /// <remarks/>
        public void GetTrialKeyAsync(object userState) {
            if ((this.GetTrialKeyOperationCompleted == null)) {
                this.GetTrialKeyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetTrialKeyOperationCompleted);
            }
            this.InvokeAsync("GetTrialKey", new object[0], this.GetTrialKeyOperationCompleted, userState);
        }
        
        private void OnGetTrialKeyOperationCompleted(object arg) {
            if ((this.GetTrialKeyCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetTrialKeyCompleted(this, new GetTrialKeyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.kentico.com/GetFreeEditionKey", RequestNamespace="http://www.kentico.com/", ResponseNamespace="http://www.kentico.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetFreeEditionKey(string domainName, string firstUserName, string lastUserName, string userEmail, string password) {
            object[] results = this.Invoke("GetFreeEditionKey", new object[] {
                        domainName,
                        firstUserName,
                        lastUserName,
                        userEmail,
                        password});
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetFreeEditionKeyAsync(string domainName, string firstUserName, string lastUserName, string userEmail, string password) {
            this.GetFreeEditionKeyAsync(domainName, firstUserName, lastUserName, userEmail, password, null);
        }
        
        /// <remarks/>
        public void GetFreeEditionKeyAsync(string domainName, string firstUserName, string lastUserName, string userEmail, string password, object userState) {
            if ((this.GetFreeEditionKeyOperationCompleted == null)) {
                this.GetFreeEditionKeyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFreeEditionKeyOperationCompleted);
            }
            this.InvokeAsync("GetFreeEditionKey", new object[] {
                        domainName,
                        firstUserName,
                        lastUserName,
                        userEmail,
                        password}, this.GetFreeEditionKeyOperationCompleted, userState);
        }
        
        private void OnGetFreeEditionKeyOperationCompleted(object arg) {
            if ((this.GetFreeEditionKeyCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetFreeEditionKeyCompleted(this, new GetFreeEditionKeyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.kentico.com/GetFreeEditionKeyGeneral", RequestNamespace="http://www.kentico.com/", ResponseNamespace="http://www.kentico.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetFreeEditionKeyGeneral(string domainName, string firstName, string lastName, string userEmail, string password, int version) {
            object[] results = this.Invoke("GetFreeEditionKeyGeneral", new object[] {
                        domainName,
                        firstName,
                        lastName,
                        userEmail,
                        password,
                        version});
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GetFreeEditionKeyGeneralAsync(string domainName, string firstName, string lastName, string userEmail, string password, int version) {
            this.GetFreeEditionKeyGeneralAsync(domainName, firstName, lastName, userEmail, password, version, null);
        }
        
        /// <remarks/>
        public void GetFreeEditionKeyGeneralAsync(string domainName, string firstName, string lastName, string userEmail, string password, int version, object userState) {
            if ((this.GetFreeEditionKeyGeneralOperationCompleted == null)) {
                this.GetFreeEditionKeyGeneralOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFreeEditionKeyGeneralOperationCompleted);
            }
            this.InvokeAsync("GetFreeEditionKeyGeneral", new object[] {
                        domainName,
                        firstName,
                        lastName,
                        userEmail,
                        password,
                        version}, this.GetFreeEditionKeyGeneralOperationCompleted, userState);
        }
        
        private void OnGetFreeEditionKeyGeneralOperationCompleted(object arg) {
            if ((this.GetFreeEditionKeyGeneralCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetFreeEditionKeyGeneralCompleted(this, new GetFreeEditionKeyGeneralCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.kentico.com/UserExists", RequestNamespace="http://www.kentico.com/", ResponseNamespace="http://www.kentico.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public bool UserExists(string userName) {
            object[] results = this.Invoke("UserExists", new object[] {
                        userName});
            return ((bool)(results[0]));
        }
        
        /// <remarks/>
        public void UserExistsAsync(string userName) {
            this.UserExistsAsync(userName, null);
        }
        
        /// <remarks/>
        public void UserExistsAsync(string userName, object userState) {
            if ((this.UserExistsOperationCompleted == null)) {
                this.UserExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUserExistsOperationCompleted);
            }
            this.InvokeAsync("UserExists", new object[] {
                        userName}, this.UserExistsOperationCompleted, userState);
        }
        
        private void OnUserExistsOperationCompleted(object arg) {
            if ((this.UserExistsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.UserExistsCompleted(this, new UserExistsCompletedEventArgs(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.Xml", "4.8.3752.0")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.kentico.com/")]
    public enum LicenseKeyTypeEnum {
        
        /// <remarks/>
        Main,
        
        /// <remarks/>
        DomainAlias,
        
        /// <remarks/>
        DevTest,
        
        /// <remarks/>
        Staging,
        
        /// <remarks/>
        Free,
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    public delegate void GetKeyCompletedEventHandler(object sender, GetKeyCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetKeyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetKeyCompletedEventArgs(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", "4.8.3752.0")]
    public delegate void GetKeyGeneralCompletedEventHandler(object sender, GetKeyGeneralCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetKeyGeneralCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetKeyGeneralCompletedEventArgs(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/>
        public string errorMessage {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[1]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    public delegate void GetTrialKeyCompletedEventHandler(object sender, GetTrialKeyCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetTrialKeyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetTrialKeyCompletedEventArgs(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", "4.8.3752.0")]
    public delegate void GetFreeEditionKeyCompletedEventHandler(object sender, GetFreeEditionKeyCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetFreeEditionKeyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetFreeEditionKeyCompletedEventArgs(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", "4.8.3752.0")]
    public delegate void GetFreeEditionKeyGeneralCompletedEventHandler(object sender, GetFreeEditionKeyGeneralCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetFreeEditionKeyGeneralCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetFreeEditionKeyGeneralCompletedEventArgs(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", "4.8.3752.0")]
    public delegate void UserExistsCompletedEventHandler(object sender, UserExistsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class UserExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal UserExistsCompletedEventArgs(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]));
            }
        }
    }
}

#pragma warning restore 1591