//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50215.44
//
//     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.50215.44.
// 
namespace CarsSalesInfoClient.localhost {
    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.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="CarSalesInfoWSSoap", Namespace="http://IntertechTraining.com/")]
    public partial class CarSalesInfoWS : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback GetSalesTagLinesOperationCompleted;
        
        private System.Threading.SendOrPostCallback SortCarMakesOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetSalesInfoDetailsOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCurrentInventoryOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public CarSalesInfoWS() {
            this.Url = CarsSalesInfoClient.Properties.Settings.Default.CarsSalesInfoClient_localhost_CarSalesInfoWS;
            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 GetSalesTagLinesCompletedEventHandler GetSalesTagLinesCompleted;
        
        /// <remarks/>
        public event SortCarMakesCompletedEventHandler SortCarMakesCompleted;
        
        /// <remarks/>
        public event GetSalesInfoDetailsCompletedEventHandler GetSalesInfoDetailsCompleted;
        
        /// <remarks/>
        public event GetCurrentInventoryCompletedEventHandler GetCurrentInventoryCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://IntertechTraining.com/GetSalesTagLines", RequestNamespace="http://IntertechTraining.com/", ResponseNamespace="http://IntertechTraining.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string[] GetSalesTagLines() {
            object[] results = this.Invoke("GetSalesTagLines", new object[0]);
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public void GetSalesTagLinesAsync() {
            this.GetSalesTagLinesAsync(null);
        }
        
        /// <remarks/>
        public void GetSalesTagLinesAsync(object userState) {
            if ((this.GetSalesTagLinesOperationCompleted == null)) {
                this.GetSalesTagLinesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSalesTagLinesOperationCompleted);
            }
            this.InvokeAsync("GetSalesTagLines", new object[0], this.GetSalesTagLinesOperationCompleted, userState);
        }
        
        private void OnGetSalesTagLinesOperationCompleted(object arg) {
            if ((this.GetSalesTagLinesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetSalesTagLinesCompleted(this, new GetSalesTagLinesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://IntertechTraining.com/SortCarMakes", RequestNamespace="http://IntertechTraining.com/", ResponseNamespace="http://IntertechTraining.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string[] SortCarMakes(string[] theCarsToSort) {
            object[] results = this.Invoke("SortCarMakes", new object[] {
                        theCarsToSort});
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public void SortCarMakesAsync(string[] theCarsToSort) {
            this.SortCarMakesAsync(theCarsToSort, null);
        }
        
        /// <remarks/>
        public void SortCarMakesAsync(string[] theCarsToSort, object userState) {
            if ((this.SortCarMakesOperationCompleted == null)) {
                this.SortCarMakesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSortCarMakesOperationCompleted);
            }
            this.InvokeAsync("SortCarMakes", new object[] {
                        theCarsToSort}, this.SortCarMakesOperationCompleted, userState);
        }
        
        private void OnSortCarMakesOperationCompleted(object arg) {
            if ((this.SortCarMakesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SortCarMakesCompleted(this, new SortCarMakesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://IntertechTraining.com/GetSalesInfoDetails", RequestNamespace="http://IntertechTraining.com/", ResponseNamespace="http://IntertechTraining.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
        public SalesInfoDetails[] GetSalesInfoDetails() {
            object[] results = this.Invoke("GetSalesInfoDetails", new object[0]);
            return ((SalesInfoDetails[])(results[0]));
        }
        
        /// <remarks/>
        public void GetSalesInfoDetailsAsync() {
            this.GetSalesInfoDetailsAsync(null);
        }
        
        /// <remarks/>
        public void GetSalesInfoDetailsAsync(object userState) {
            if ((this.GetSalesInfoDetailsOperationCompleted == null)) {
                this.GetSalesInfoDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSalesInfoDetailsOperationCompleted);
            }
            this.InvokeAsync("GetSalesInfoDetails", new object[0], this.GetSalesInfoDetailsOperationCompleted, userState);
        }
        
        private void OnGetSalesInfoDetailsOperationCompleted(object arg) {
            if ((this.GetSalesInfoDetailsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetSalesInfoDetailsCompleted(this, new GetSalesInfoDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://IntertechTraining.com/GetCurrentInventory", RequestNamespace="http://IntertechTraining.com/", ResponseNamespace="http://IntertechTraining.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public System.Data.DataSet GetCurrentInventory() {
            object[] results = this.Invoke("GetCurrentInventory", new object[0]);
            return ((System.Data.DataSet)(results[0]));
        }
        
        /// <remarks/>
        public void GetCurrentInventoryAsync() {
            this.GetCurrentInventoryAsync(null);
        }
        
        /// <remarks/>
        public void GetCurrentInventoryAsync(object userState) {
            if ((this.GetCurrentInventoryOperationCompleted == null)) {
                this.GetCurrentInventoryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCurrentInventoryOperationCompleted);
            }
            this.InvokeAsync("GetCurrentInventory", new object[0], this.GetCurrentInventoryOperationCompleted, userState);
        }
        
        private void OnGetCurrentInventoryOperationCompleted(object arg) {
            if ((this.GetCurrentInventoryCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCurrentInventoryCompleted(this, new GetCurrentInventoryCompletedEventArgs(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) 
                        && (wsUri.Port <= 5000)) 
                        && (string.Compare(wsUri.Host, "localHost", true) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://IntertechTraining.com/")]
    public partial class SalesInfoDetails {
        
        private string infoField;
        
        private string urlField;
        
        private System.DateTime dateExpiredField;
        
        /// <remarks/>
        public string info {
            get {
                return this.infoField;
            }
            set {
                this.infoField = value;
            }
        }
        
        /// <remarks/>
        public string Url {
            get {
                return this.urlField;
            }
            set {
                this.urlField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        public System.DateTime dateExpired {
            get {
                return this.dateExpiredField;
            }
            set {
                this.dateExpiredField = value;
            }
        }
    }
    
    /// <remarks/>
    public delegate void GetSalesTagLinesCompletedEventHandler(object sender, GetSalesTagLinesCompletedEventArgs e);
    
    /// <remarks/>
    public partial class GetSalesTagLinesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetSalesTagLinesCompletedEventArgs(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 delegate void SortCarMakesCompletedEventHandler(object sender, SortCarMakesCompletedEventArgs e);
    
    /// <remarks/>
    public partial class SortCarMakesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SortCarMakesCompletedEventArgs(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 delegate void GetSalesInfoDetailsCompletedEventHandler(object sender, GetSalesInfoDetailsCompletedEventArgs e);
    
    /// <remarks/>
    public partial class GetSalesInfoDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetSalesInfoDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public SalesInfoDetails[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((SalesInfoDetails[])(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    public delegate void GetCurrentInventoryCompletedEventHandler(object sender, GetCurrentInventoryCompletedEventArgs e);
    
    /// <remarks/>
    public partial class GetCurrentInventoryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCurrentInventoryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public System.Data.DataSet Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataSet)(this.results[0]));
            }
        }
    }
}
