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

// 
// This code was auto-generated by Microsoft.Silverlight.ServiceReference, version 4.0.50401.0
// 
namespace SilverlightApplication1.ServiceReference1 {
    using System.Runtime.Serialization;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="ResultDataOfCustomer", Namespace="http://tempuri.org/")]
    public partial class ResultDataOfCustomer : object, System.ComponentModel.INotifyPropertyChanged {
        
        private int CountField;
        
        private System.Collections.ObjectModel.ObservableCollection<SilverlightApplication1.ServiceReference1.Customer> DataField;
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public int Count {
            get {
                return this.CountField;
            }
            set {
                if ((this.CountField.Equals(value) != true)) {
                    this.CountField = value;
                    this.RaisePropertyChanged("Count");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public System.Collections.ObjectModel.ObservableCollection<SilverlightApplication1.ServiceReference1.Customer> Data {
            get {
                return this.DataField;
            }
            set {
                if ((object.ReferenceEquals(this.DataField, value) != true)) {
                    this.DataField = value;
                    this.RaisePropertyChanged("Data");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Customer", Namespace="http://tempuri.org/")]
    public partial class Customer : object, System.ComponentModel.INotifyPropertyChanged {
        
        private string CustomerIDField;
        
        private string CompanyNameField;
        
        private string ContactNameField;
        
        private string ContactTitleField;
        
        private string AddressField;
        
        private string CityField;
        
        private string RegionField;
        
        private string PostalCodeField;
        
        private string CountryField;
        
        private string PhoneField;
        
        private string FaxField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public string CustomerID {
            get {
                return this.CustomerIDField;
            }
            set {
                if ((object.ReferenceEquals(this.CustomerIDField, value) != true)) {
                    this.CustomerIDField = value;
                    this.RaisePropertyChanged("CustomerID");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)]
        public string CompanyName {
            get {
                return this.CompanyNameField;
            }
            set {
                if ((object.ReferenceEquals(this.CompanyNameField, value) != true)) {
                    this.CompanyNameField = value;
                    this.RaisePropertyChanged("CompanyName");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)]
        public string ContactName {
            get {
                return this.ContactNameField;
            }
            set {
                if ((object.ReferenceEquals(this.ContactNameField, value) != true)) {
                    this.ContactNameField = value;
                    this.RaisePropertyChanged("ContactName");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=3)]
        public string ContactTitle {
            get {
                return this.ContactTitleField;
            }
            set {
                if ((object.ReferenceEquals(this.ContactTitleField, value) != true)) {
                    this.ContactTitleField = value;
                    this.RaisePropertyChanged("ContactTitle");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=4)]
        public string Address {
            get {
                return this.AddressField;
            }
            set {
                if ((object.ReferenceEquals(this.AddressField, value) != true)) {
                    this.AddressField = value;
                    this.RaisePropertyChanged("Address");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=5)]
        public string City {
            get {
                return this.CityField;
            }
            set {
                if ((object.ReferenceEquals(this.CityField, value) != true)) {
                    this.CityField = value;
                    this.RaisePropertyChanged("City");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=6)]
        public string Region {
            get {
                return this.RegionField;
            }
            set {
                if ((object.ReferenceEquals(this.RegionField, value) != true)) {
                    this.RegionField = value;
                    this.RaisePropertyChanged("Region");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=7)]
        public string PostalCode {
            get {
                return this.PostalCodeField;
            }
            set {
                if ((object.ReferenceEquals(this.PostalCodeField, value) != true)) {
                    this.PostalCodeField = value;
                    this.RaisePropertyChanged("PostalCode");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=8)]
        public string Country {
            get {
                return this.CountryField;
            }
            set {
                if ((object.ReferenceEquals(this.CountryField, value) != true)) {
                    this.CountryField = value;
                    this.RaisePropertyChanged("Country");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=9)]
        public string Phone {
            get {
                return this.PhoneField;
            }
            set {
                if ((object.ReferenceEquals(this.PhoneField, value) != true)) {
                    this.PhoneField = value;
                    this.RaisePropertyChanged("Phone");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=10)]
        public string Fax {
            get {
                return this.FaxField;
            }
            set {
                if ((object.ReferenceEquals(this.FaxField, value) != true)) {
                    this.FaxField = value;
                    this.RaisePropertyChanged("Fax");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.CollectionDataContractAttribute(Name="ArrayOfAnyType", Namespace="http://tempuri.org/", ItemName="anyType")]
    public class ArrayOfAnyType : System.Collections.ObjectModel.ObservableCollection<object> {
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference1.NorthwindServiceSoap")]
    public interface NorthwindServiceSoap {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/GetCustomers", ReplyAction="*")]
        System.IAsyncResult BeginGetCustomers(SilverlightApplication1.ServiceReference1.GetCustomersRequest request, System.AsyncCallback callback, object asyncState);
        
        SilverlightApplication1.ServiceReference1.GetCustomersResponse EndGetCustomers(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/GetDistinctValues", ReplyAction="*")]
        System.IAsyncResult BeginGetDistinctValues(SilverlightApplication1.ServiceReference1.GetDistinctValuesRequest request, System.AsyncCallback callback, object asyncState);
        
        SilverlightApplication1.ServiceReference1.GetDistinctValuesResponse EndGetDistinctValues(System.IAsyncResult result);
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetCustomersRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetCustomers", Namespace="http://tempuri.org/", Order=0)]
        public SilverlightApplication1.ServiceReference1.GetCustomersRequestBody Body;
        
        public GetCustomersRequest() {
        }
        
        public GetCustomersRequest(SilverlightApplication1.ServiceReference1.GetCustomersRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetCustomersRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=0)]
        public int startRowIndex;
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=1)]
        public int maximumRows;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)]
        public string sortExpression;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=3)]
        public string filterExpression;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=4)]
        public string groupExpression;
        
        public GetCustomersRequestBody() {
        }
        
        public GetCustomersRequestBody(int startRowIndex, int maximumRows, string sortExpression, string filterExpression, string groupExpression) {
            this.startRowIndex = startRowIndex;
            this.maximumRows = maximumRows;
            this.sortExpression = sortExpression;
            this.filterExpression = filterExpression;
            this.groupExpression = groupExpression;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetCustomersResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetCustomersResponse", Namespace="http://tempuri.org/", Order=0)]
        public SilverlightApplication1.ServiceReference1.GetCustomersResponseBody Body;
        
        public GetCustomersResponse() {
        }
        
        public GetCustomersResponse(SilverlightApplication1.ServiceReference1.GetCustomersResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetCustomersResponseBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public SilverlightApplication1.ServiceReference1.ResultDataOfCustomer GetCustomersResult;
        
        public GetCustomersResponseBody() {
        }
        
        public GetCustomersResponseBody(SilverlightApplication1.ServiceReference1.ResultDataOfCustomer GetCustomersResult) {
            this.GetCustomersResult = GetCustomersResult;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetDistinctValuesRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetDistinctValues", Namespace="http://tempuri.org/", Order=0)]
        public SilverlightApplication1.ServiceReference1.GetDistinctValuesRequestBody Body;
        
        public GetDistinctValuesRequest() {
        }
        
        public GetDistinctValuesRequest(SilverlightApplication1.ServiceReference1.GetDistinctValuesRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetDistinctValuesRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public string fieldName;
        
        public GetDistinctValuesRequestBody() {
        }
        
        public GetDistinctValuesRequestBody(string fieldName) {
            this.fieldName = fieldName;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetDistinctValuesResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetDistinctValuesResponse", Namespace="http://tempuri.org/", Order=0)]
        public SilverlightApplication1.ServiceReference1.GetDistinctValuesResponseBody Body;
        
        public GetDistinctValuesResponse() {
        }
        
        public GetDistinctValuesResponse(SilverlightApplication1.ServiceReference1.GetDistinctValuesResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetDistinctValuesResponseBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public SilverlightApplication1.ServiceReference1.ArrayOfAnyType GetDistinctValuesResult;
        
        public GetDistinctValuesResponseBody() {
        }
        
        public GetDistinctValuesResponseBody(SilverlightApplication1.ServiceReference1.ArrayOfAnyType GetDistinctValuesResult) {
            this.GetDistinctValuesResult = GetDistinctValuesResult;
        }
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface NorthwindServiceSoapChannel : SilverlightApplication1.ServiceReference1.NorthwindServiceSoap, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetCustomersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetCustomersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public SilverlightApplication1.ServiceReference1.ResultDataOfCustomer Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((SilverlightApplication1.ServiceReference1.ResultDataOfCustomer)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetDistinctValuesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetDistinctValuesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public SilverlightApplication1.ServiceReference1.ArrayOfAnyType Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((SilverlightApplication1.ServiceReference1.ArrayOfAnyType)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class NorthwindServiceSoapClient : System.ServiceModel.ClientBase<SilverlightApplication1.ServiceReference1.NorthwindServiceSoap>, SilverlightApplication1.ServiceReference1.NorthwindServiceSoap {
        
        private BeginOperationDelegate onBeginGetCustomersDelegate;
        
        private EndOperationDelegate onEndGetCustomersDelegate;
        
        private System.Threading.SendOrPostCallback onGetCustomersCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetDistinctValuesDelegate;
        
        private EndOperationDelegate onEndGetDistinctValuesDelegate;
        
        private System.Threading.SendOrPostCallback onGetDistinctValuesCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public NorthwindServiceSoapClient() {
        }
        
        public NorthwindServiceSoapClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public NorthwindServiceSoapClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public NorthwindServiceSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public NorthwindServiceSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public System.Net.CookieContainer CookieContainer {
            get {
                System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
                if ((httpCookieContainerManager != null)) {
                    return httpCookieContainerManager.CookieContainer;
                }
                else {
                    return null;
                }
            }
            set {
                System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
                if ((httpCookieContainerManager != null)) {
                    httpCookieContainerManager.CookieContainer = value;
                }
                else {
                    throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
                            "ookieContainerBindingElement.");
                }
            }
        }
        
        public event System.EventHandler<GetCustomersCompletedEventArgs> GetCustomersCompleted;
        
        public event System.EventHandler<GetDistinctValuesCompletedEventArgs> GetDistinctValuesCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult SilverlightApplication1.ServiceReference1.NorthwindServiceSoap.BeginGetCustomers(SilverlightApplication1.ServiceReference1.GetCustomersRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetCustomers(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginGetCustomers(int startRowIndex, int maximumRows, string sortExpression, string filterExpression, string groupExpression, System.AsyncCallback callback, object asyncState) {
            SilverlightApplication1.ServiceReference1.GetCustomersRequest inValue = new SilverlightApplication1.ServiceReference1.GetCustomersRequest();
            inValue.Body = new SilverlightApplication1.ServiceReference1.GetCustomersRequestBody();
            inValue.Body.startRowIndex = startRowIndex;
            inValue.Body.maximumRows = maximumRows;
            inValue.Body.sortExpression = sortExpression;
            inValue.Body.filterExpression = filterExpression;
            inValue.Body.groupExpression = groupExpression;
            return ((SilverlightApplication1.ServiceReference1.NorthwindServiceSoap)(this)).BeginGetCustomers(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        SilverlightApplication1.ServiceReference1.GetCustomersResponse SilverlightApplication1.ServiceReference1.NorthwindServiceSoap.EndGetCustomers(System.IAsyncResult result) {
            return base.Channel.EndGetCustomers(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private SilverlightApplication1.ServiceReference1.ResultDataOfCustomer EndGetCustomers(System.IAsyncResult result) {
            SilverlightApplication1.ServiceReference1.GetCustomersResponse retVal = ((SilverlightApplication1.ServiceReference1.NorthwindServiceSoap)(this)).EndGetCustomers(result);
            return retVal.Body.GetCustomersResult;
        }
        
        private System.IAsyncResult OnBeginGetCustomers(object[] inValues, System.AsyncCallback callback, object asyncState) {
            int startRowIndex = ((int)(inValues[0]));
            int maximumRows = ((int)(inValues[1]));
            string sortExpression = ((string)(inValues[2]));
            string filterExpression = ((string)(inValues[3]));
            string groupExpression = ((string)(inValues[4]));
            return this.BeginGetCustomers(startRowIndex, maximumRows, sortExpression, filterExpression, groupExpression, callback, asyncState);
        }
        
        private object[] OnEndGetCustomers(System.IAsyncResult result) {
            SilverlightApplication1.ServiceReference1.ResultDataOfCustomer retVal = this.EndGetCustomers(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetCustomersCompleted(object state) {
            if ((this.GetCustomersCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetCustomersCompleted(this, new GetCustomersCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetCustomersAsync(int startRowIndex, int maximumRows, string sortExpression, string filterExpression, string groupExpression) {
            this.GetCustomersAsync(startRowIndex, maximumRows, sortExpression, filterExpression, groupExpression, null);
        }
        
        public void GetCustomersAsync(int startRowIndex, int maximumRows, string sortExpression, string filterExpression, string groupExpression, object userState) {
            if ((this.onBeginGetCustomersDelegate == null)) {
                this.onBeginGetCustomersDelegate = new BeginOperationDelegate(this.OnBeginGetCustomers);
            }
            if ((this.onEndGetCustomersDelegate == null)) {
                this.onEndGetCustomersDelegate = new EndOperationDelegate(this.OnEndGetCustomers);
            }
            if ((this.onGetCustomersCompletedDelegate == null)) {
                this.onGetCustomersCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetCustomersCompleted);
            }
            base.InvokeAsync(this.onBeginGetCustomersDelegate, new object[] {
                        startRowIndex,
                        maximumRows,
                        sortExpression,
                        filterExpression,
                        groupExpression}, this.onEndGetCustomersDelegate, this.onGetCustomersCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult SilverlightApplication1.ServiceReference1.NorthwindServiceSoap.BeginGetDistinctValues(SilverlightApplication1.ServiceReference1.GetDistinctValuesRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetDistinctValues(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginGetDistinctValues(string fieldName, System.AsyncCallback callback, object asyncState) {
            SilverlightApplication1.ServiceReference1.GetDistinctValuesRequest inValue = new SilverlightApplication1.ServiceReference1.GetDistinctValuesRequest();
            inValue.Body = new SilverlightApplication1.ServiceReference1.GetDistinctValuesRequestBody();
            inValue.Body.fieldName = fieldName;
            return ((SilverlightApplication1.ServiceReference1.NorthwindServiceSoap)(this)).BeginGetDistinctValues(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        SilverlightApplication1.ServiceReference1.GetDistinctValuesResponse SilverlightApplication1.ServiceReference1.NorthwindServiceSoap.EndGetDistinctValues(System.IAsyncResult result) {
            return base.Channel.EndGetDistinctValues(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private SilverlightApplication1.ServiceReference1.ArrayOfAnyType EndGetDistinctValues(System.IAsyncResult result) {
            SilverlightApplication1.ServiceReference1.GetDistinctValuesResponse retVal = ((SilverlightApplication1.ServiceReference1.NorthwindServiceSoap)(this)).EndGetDistinctValues(result);
            return retVal.Body.GetDistinctValuesResult;
        }
        
        private System.IAsyncResult OnBeginGetDistinctValues(object[] inValues, System.AsyncCallback callback, object asyncState) {
            string fieldName = ((string)(inValues[0]));
            return this.BeginGetDistinctValues(fieldName, callback, asyncState);
        }
        
        private object[] OnEndGetDistinctValues(System.IAsyncResult result) {
            SilverlightApplication1.ServiceReference1.ArrayOfAnyType retVal = this.EndGetDistinctValues(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetDistinctValuesCompleted(object state) {
            if ((this.GetDistinctValuesCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetDistinctValuesCompleted(this, new GetDistinctValuesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetDistinctValuesAsync(string fieldName) {
            this.GetDistinctValuesAsync(fieldName, null);
        }
        
        public void GetDistinctValuesAsync(string fieldName, object userState) {
            if ((this.onBeginGetDistinctValuesDelegate == null)) {
                this.onBeginGetDistinctValuesDelegate = new BeginOperationDelegate(this.OnBeginGetDistinctValues);
            }
            if ((this.onEndGetDistinctValuesDelegate == null)) {
                this.onEndGetDistinctValuesDelegate = new EndOperationDelegate(this.OnEndGetDistinctValues);
            }
            if ((this.onGetDistinctValuesCompletedDelegate == null)) {
                this.onGetDistinctValuesCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetDistinctValuesCompleted);
            }
            base.InvokeAsync(this.onBeginGetDistinctValuesDelegate, new object[] {
                        fieldName}, this.onEndGetDistinctValuesDelegate, this.onGetDistinctValuesCompletedDelegate, userState);
        }
        
        private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
        }
        
        private object[] OnEndOpen(System.IAsyncResult result) {
            ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
            return null;
        }
        
        private void OnOpenCompleted(object state) {
            if ((this.OpenCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void OpenAsync() {
            this.OpenAsync(null);
        }
        
        public void OpenAsync(object userState) {
            if ((this.onBeginOpenDelegate == null)) {
                this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
            }
            if ((this.onEndOpenDelegate == null)) {
                this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
            }
            if ((this.onOpenCompletedDelegate == null)) {
                this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
            }
            base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
        }
        
        private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
        }
        
        private object[] OnEndClose(System.IAsyncResult result) {
            ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
            return null;
        }
        
        private void OnCloseCompleted(object state) {
            if ((this.CloseCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void CloseAsync() {
            this.CloseAsync(null);
        }
        
        public void CloseAsync(object userState) {
            if ((this.onBeginCloseDelegate == null)) {
                this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
            }
            if ((this.onEndCloseDelegate == null)) {
                this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
            }
            if ((this.onCloseCompletedDelegate == null)) {
                this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
            }
            base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
        }
        
        protected override SilverlightApplication1.ServiceReference1.NorthwindServiceSoap CreateChannel() {
            return new NorthwindServiceSoapClientChannel(this);
        }
        
        private class NorthwindServiceSoapClientChannel : ChannelBase<SilverlightApplication1.ServiceReference1.NorthwindServiceSoap>, SilverlightApplication1.ServiceReference1.NorthwindServiceSoap {
            
            public NorthwindServiceSoapClientChannel(System.ServiceModel.ClientBase<SilverlightApplication1.ServiceReference1.NorthwindServiceSoap> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetCustomers(SilverlightApplication1.ServiceReference1.GetCustomersRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("GetCustomers", _args, callback, asyncState);
                return _result;
            }
            
            public SilverlightApplication1.ServiceReference1.GetCustomersResponse EndGetCustomers(System.IAsyncResult result) {
                object[] _args = new object[0];
                SilverlightApplication1.ServiceReference1.GetCustomersResponse _result = ((SilverlightApplication1.ServiceReference1.GetCustomersResponse)(base.EndInvoke("GetCustomers", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetDistinctValues(SilverlightApplication1.ServiceReference1.GetDistinctValuesRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("GetDistinctValues", _args, callback, asyncState);
                return _result;
            }
            
            public SilverlightApplication1.ServiceReference1.GetDistinctValuesResponse EndGetDistinctValues(System.IAsyncResult result) {
                object[] _args = new object[0];
                SilverlightApplication1.ServiceReference1.GetDistinctValuesResponse _result = ((SilverlightApplication1.ServiceReference1.GetDistinctValuesResponse)(base.EndInvoke("GetDistinctValues", _args, result)));
                return _result;
            }
        }
    }
}
