//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.4927
//
//     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 3.0.40818.0
// 
namespace CloudDBSilverlight.cloudDBService {
    using System.Runtime.Serialization;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
    [System.Runtime.Serialization.CollectionDataContractAttribute(Name="ArrayOfMessagesEntity", Namespace="http://OpenLightGroup.net/", ItemName="MessagesEntity")]
    public class ArrayOfMessagesEntity : System.Collections.ObjectModel.ObservableCollection<CloudDBSilverlight.cloudDBService.MessagesEntity> {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="MessagesEntity", Namespace="http://CloudDB.com/")]
    public partial class MessagesEntity : object, System.ComponentModel.INotifyPropertyChanged {
        
        private int EntityID_11056Field;
        
        private int CloudDBPKField;
        
        private string CloudDB_aliasField;
        
        private long CloudDB_userWhoUpdatedField;
        
        private System.DateTime CloudDB_whenLastModifiedField;
        
        private string nameTextField;
        
        private string messageTextField;
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public int EntityID_11056 {
            get {
                return this.EntityID_11056Field;
            }
            set {
                if ((this.EntityID_11056Field.Equals(value) != true)) {
                    this.EntityID_11056Field = value;
                    this.RaisePropertyChanged("EntityID_11056");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true, Order=1)]
        public int CloudDBPK {
            get {
                return this.CloudDBPKField;
            }
            set {
                if ((this.CloudDBPKField.Equals(value) != true)) {
                    this.CloudDBPKField = value;
                    this.RaisePropertyChanged("CloudDBPK");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)]
        public string CloudDB_alias {
            get {
                return this.CloudDB_aliasField;
            }
            set {
                if ((object.ReferenceEquals(this.CloudDB_aliasField, value) != true)) {
                    this.CloudDB_aliasField = value;
                    this.RaisePropertyChanged("CloudDB_alias");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true, Order=3)]
        public long CloudDB_userWhoUpdated {
            get {
                return this.CloudDB_userWhoUpdatedField;
            }
            set {
                if ((this.CloudDB_userWhoUpdatedField.Equals(value) != true)) {
                    this.CloudDB_userWhoUpdatedField = value;
                    this.RaisePropertyChanged("CloudDB_userWhoUpdated");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true, Order=4)]
        public System.DateTime CloudDB_whenLastModified {
            get {
                return this.CloudDB_whenLastModifiedField;
            }
            set {
                if ((this.CloudDB_whenLastModifiedField.Equals(value) != true)) {
                    this.CloudDB_whenLastModifiedField = value;
                    this.RaisePropertyChanged("CloudDB_whenLastModified");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=5)]
        public string nameText {
            get {
                return this.nameTextField;
            }
            set {
                if ((object.ReferenceEquals(this.nameTextField, value) != true)) {
                    this.nameTextField = value;
                    this.RaisePropertyChanged("nameText");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=6)]
        public string messageText {
            get {
                return this.messageTextField;
            }
            set {
                if ((object.ReferenceEquals(this.messageTextField, value) != true)) {
                    this.messageTextField = value;
                    this.RaisePropertyChanged("messageText");
                }
            }
        }
        
        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.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="http://OpenLightGroup.net/", ConfigurationName="cloudDBService.WebServiceSoap")]
    public interface WebServiceSoap {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://OpenLightGroup.net/GetRecords", ReplyAction="*")]
        System.IAsyncResult BeginGetRecords(CloudDBSilverlight.cloudDBService.GetRecordsRequest request, System.AsyncCallback callback, object asyncState);
        
        CloudDBSilverlight.cloudDBService.GetRecordsResponse EndGetRecords(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://OpenLightGroup.net/SaveRecord", ReplyAction="*")]
        System.IAsyncResult BeginSaveRecord(CloudDBSilverlight.cloudDBService.SaveRecordRequest request, System.AsyncCallback callback, object asyncState);
        
        CloudDBSilverlight.cloudDBService.SaveRecordResponse EndSaveRecord(System.IAsyncResult result);
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetRecordsRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetRecords", Namespace="http://OpenLightGroup.net/", Order=0)]
        public CloudDBSilverlight.cloudDBService.GetRecordsRequestBody Body;
        
        public GetRecordsRequest() {
        }
        
        public GetRecordsRequest(CloudDBSilverlight.cloudDBService.GetRecordsRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://OpenLightGroup.net/")]
    public partial class GetRecordsRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=0)]
        public int pageNumber;
        
        public GetRecordsRequestBody() {
        }
        
        public GetRecordsRequestBody(int pageNumber) {
            this.pageNumber = pageNumber;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetRecordsResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetRecordsResponse", Namespace="http://OpenLightGroup.net/", Order=0)]
        public CloudDBSilverlight.cloudDBService.GetRecordsResponseBody Body;
        
        public GetRecordsResponse() {
        }
        
        public GetRecordsResponse(CloudDBSilverlight.cloudDBService.GetRecordsResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://OpenLightGroup.net/")]
    public partial class GetRecordsResponseBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public CloudDBSilverlight.cloudDBService.ArrayOfMessagesEntity GetRecordsResult;
        
        public GetRecordsResponseBody() {
        }
        
        public GetRecordsResponseBody(CloudDBSilverlight.cloudDBService.ArrayOfMessagesEntity GetRecordsResult) {
            this.GetRecordsResult = GetRecordsResult;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class SaveRecordRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="SaveRecord", Namespace="http://OpenLightGroup.net/", Order=0)]
        public CloudDBSilverlight.cloudDBService.SaveRecordRequestBody Body;
        
        public SaveRecordRequest() {
        }
        
        public SaveRecordRequest(CloudDBSilverlight.cloudDBService.SaveRecordRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://OpenLightGroup.net/")]
    public partial class SaveRecordRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public string Name;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)]
        public string Message;
        
        public SaveRecordRequestBody() {
        }
        
        public SaveRecordRequestBody(string Name, string Message) {
            this.Name = Name;
            this.Message = Message;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class SaveRecordResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="SaveRecordResponse", Namespace="http://OpenLightGroup.net/", Order=0)]
        public CloudDBSilverlight.cloudDBService.SaveRecordResponseBody Body;
        
        public SaveRecordResponse() {
        }
        
        public SaveRecordResponse(CloudDBSilverlight.cloudDBService.SaveRecordResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class SaveRecordResponseBody {
        
        public SaveRecordResponseBody() {
        }
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public interface WebServiceSoapChannel : CloudDBSilverlight.cloudDBService.WebServiceSoap, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class GetRecordsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetRecordsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public CloudDBSilverlight.cloudDBService.ArrayOfMessagesEntity Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((CloudDBSilverlight.cloudDBService.ArrayOfMessagesEntity)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class WebServiceSoapClient : System.ServiceModel.ClientBase<CloudDBSilverlight.cloudDBService.WebServiceSoap>, CloudDBSilverlight.cloudDBService.WebServiceSoap {
        
        private BeginOperationDelegate onBeginGetRecordsDelegate;
        
        private EndOperationDelegate onEndGetRecordsDelegate;
        
        private System.Threading.SendOrPostCallback onGetRecordsCompletedDelegate;
        
        private BeginOperationDelegate onBeginSaveRecordDelegate;
        
        private EndOperationDelegate onEndSaveRecordDelegate;
        
        private System.Threading.SendOrPostCallback onSaveRecordCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public WebServiceSoapClient() {
        }
        
        public WebServiceSoapClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public WebServiceSoapClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public WebServiceSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public WebServiceSoapClient(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<GetRecordsCompletedEventArgs> GetRecordsCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> SaveRecordCompleted;
        
        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 CloudDBSilverlight.cloudDBService.WebServiceSoap.BeginGetRecords(CloudDBSilverlight.cloudDBService.GetRecordsRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetRecords(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginGetRecords(int pageNumber, System.AsyncCallback callback, object asyncState) {
            CloudDBSilverlight.cloudDBService.GetRecordsRequest inValue = new CloudDBSilverlight.cloudDBService.GetRecordsRequest();
            inValue.Body = new CloudDBSilverlight.cloudDBService.GetRecordsRequestBody();
            inValue.Body.pageNumber = pageNumber;
            return ((CloudDBSilverlight.cloudDBService.WebServiceSoap)(this)).BeginGetRecords(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        CloudDBSilverlight.cloudDBService.GetRecordsResponse CloudDBSilverlight.cloudDBService.WebServiceSoap.EndGetRecords(System.IAsyncResult result) {
            return base.Channel.EndGetRecords(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private CloudDBSilverlight.cloudDBService.ArrayOfMessagesEntity EndGetRecords(System.IAsyncResult result) {
            CloudDBSilverlight.cloudDBService.GetRecordsResponse retVal = ((CloudDBSilverlight.cloudDBService.WebServiceSoap)(this)).EndGetRecords(result);
            return retVal.Body.GetRecordsResult;
        }
        
        private System.IAsyncResult OnBeginGetRecords(object[] inValues, System.AsyncCallback callback, object asyncState) {
            int pageNumber = ((int)(inValues[0]));
            return this.BeginGetRecords(pageNumber, callback, asyncState);
        }
        
        private object[] OnEndGetRecords(System.IAsyncResult result) {
            CloudDBSilverlight.cloudDBService.ArrayOfMessagesEntity retVal = this.EndGetRecords(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetRecordsCompleted(object state) {
            if ((this.GetRecordsCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetRecordsCompleted(this, new GetRecordsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetRecordsAsync(int pageNumber) {
            this.GetRecordsAsync(pageNumber, null);
        }
        
        public void GetRecordsAsync(int pageNumber, object userState) {
            if ((this.onBeginGetRecordsDelegate == null)) {
                this.onBeginGetRecordsDelegate = new BeginOperationDelegate(this.OnBeginGetRecords);
            }
            if ((this.onEndGetRecordsDelegate == null)) {
                this.onEndGetRecordsDelegate = new EndOperationDelegate(this.OnEndGetRecords);
            }
            if ((this.onGetRecordsCompletedDelegate == null)) {
                this.onGetRecordsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetRecordsCompleted);
            }
            base.InvokeAsync(this.onBeginGetRecordsDelegate, new object[] {
                        pageNumber}, this.onEndGetRecordsDelegate, this.onGetRecordsCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult CloudDBSilverlight.cloudDBService.WebServiceSoap.BeginSaveRecord(CloudDBSilverlight.cloudDBService.SaveRecordRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginSaveRecord(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginSaveRecord(string Name, string Message, System.AsyncCallback callback, object asyncState) {
            CloudDBSilverlight.cloudDBService.SaveRecordRequest inValue = new CloudDBSilverlight.cloudDBService.SaveRecordRequest();
            inValue.Body = new CloudDBSilverlight.cloudDBService.SaveRecordRequestBody();
            inValue.Body.Name = Name;
            inValue.Body.Message = Message;
            return ((CloudDBSilverlight.cloudDBService.WebServiceSoap)(this)).BeginSaveRecord(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        CloudDBSilverlight.cloudDBService.SaveRecordResponse CloudDBSilverlight.cloudDBService.WebServiceSoap.EndSaveRecord(System.IAsyncResult result) {
            return base.Channel.EndSaveRecord(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private void EndSaveRecord(System.IAsyncResult result) {
            CloudDBSilverlight.cloudDBService.SaveRecordResponse retVal = ((CloudDBSilverlight.cloudDBService.WebServiceSoap)(this)).EndSaveRecord(result);
        }
        
        private System.IAsyncResult OnBeginSaveRecord(object[] inValues, System.AsyncCallback callback, object asyncState) {
            string Name = ((string)(inValues[0]));
            string Message = ((string)(inValues[1]));
            return this.BeginSaveRecord(Name, Message, callback, asyncState);
        }
        
        private object[] OnEndSaveRecord(System.IAsyncResult result) {
            this.EndSaveRecord(result);
            return null;
        }
        
        private void OnSaveRecordCompleted(object state) {
            if ((this.SaveRecordCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.SaveRecordCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void SaveRecordAsync(string Name, string Message) {
            this.SaveRecordAsync(Name, Message, null);
        }
        
        public void SaveRecordAsync(string Name, string Message, object userState) {
            if ((this.onBeginSaveRecordDelegate == null)) {
                this.onBeginSaveRecordDelegate = new BeginOperationDelegate(this.OnBeginSaveRecord);
            }
            if ((this.onEndSaveRecordDelegate == null)) {
                this.onEndSaveRecordDelegate = new EndOperationDelegate(this.OnEndSaveRecord);
            }
            if ((this.onSaveRecordCompletedDelegate == null)) {
                this.onSaveRecordCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSaveRecordCompleted);
            }
            base.InvokeAsync(this.onBeginSaveRecordDelegate, new object[] {
                        Name,
                        Message}, this.onEndSaveRecordDelegate, this.onSaveRecordCompletedDelegate, 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 CloudDBSilverlight.cloudDBService.WebServiceSoap CreateChannel() {
            return new WebServiceSoapClientChannel(this);
        }
        
        private class WebServiceSoapClientChannel : ChannelBase<CloudDBSilverlight.cloudDBService.WebServiceSoap>, CloudDBSilverlight.cloudDBService.WebServiceSoap {
            
            public WebServiceSoapClientChannel(System.ServiceModel.ClientBase<CloudDBSilverlight.cloudDBService.WebServiceSoap> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetRecords(CloudDBSilverlight.cloudDBService.GetRecordsRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("GetRecords", _args, callback, asyncState);
                return _result;
            }
            
            public CloudDBSilverlight.cloudDBService.GetRecordsResponse EndGetRecords(System.IAsyncResult result) {
                object[] _args = new object[0];
                CloudDBSilverlight.cloudDBService.GetRecordsResponse _result = ((CloudDBSilverlight.cloudDBService.GetRecordsResponse)(base.EndInvoke("GetRecords", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginSaveRecord(CloudDBSilverlight.cloudDBService.SaveRecordRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("SaveRecord", _args, callback, asyncState);
                return _result;
            }
            
            public CloudDBSilverlight.cloudDBService.SaveRecordResponse EndSaveRecord(System.IAsyncResult result) {
                object[] _args = new object[0];
                CloudDBSilverlight.cloudDBService.SaveRecordResponse _result = ((CloudDBSilverlight.cloudDBService.SaveRecordResponse)(base.EndInvoke("SaveRecord", _args, result)));
                return _result;
            }
        }
    }
}
