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

namespace PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference {
    using System.Runtime.Serialization;
    using System;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="PersonalInformationRequest", Namespace="http://schemas.datacontract.org/2004/07/PersonalInformationService.Messages")]
    [System.SerializableAttribute()]
    public partial class PersonalInformationRequest : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
        
        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private int PersonIdField;
        
        [global::System.ComponentModel.BrowsableAttribute(false)]
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            get {
                return this.extensionDataField;
            }
            set {
                this.extensionDataField = value;
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int PersonId {
            get {
                return this.PersonIdField;
            }
            set {
                if ((this.PersonIdField.Equals(value) != true)) {
                    this.PersonIdField = value;
                    this.RaisePropertyChanged("PersonId");
                }
            }
        }
        
        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="PersonalInformationResponse", Namespace="http://schemas.datacontract.org/2004/07/PersonalInformationService.Messages")]
    [System.SerializableAttribute()]
    public partial class PersonalInformationResponse : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
        
        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.Person[] PersonsField;
        
        [global::System.ComponentModel.BrowsableAttribute(false)]
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            get {
                return this.extensionDataField;
            }
            set {
                this.extensionDataField = value;
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.Person[] Persons {
            get {
                return this.PersonsField;
            }
            set {
                if ((object.ReferenceEquals(this.PersonsField, value) != true)) {
                    this.PersonsField = value;
                    this.RaisePropertyChanged("Persons");
                }
            }
        }
        
        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="Person", Namespace="PersonalInformationService.Types")]
    [System.SerializableAttribute()]
    public partial class Person : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
        
        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.Gender GenderField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private int IdField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string NameField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string SurnameField;
        
        [global::System.ComponentModel.BrowsableAttribute(false)]
        public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            get {
                return this.extensionDataField;
            }
            set {
                this.extensionDataField = value;
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.Gender Gender {
            get {
                return this.GenderField;
            }
            set {
                if ((this.GenderField.Equals(value) != true)) {
                    this.GenderField = value;
                    this.RaisePropertyChanged("Gender");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int Id {
            get {
                return this.IdField;
            }
            set {
                if ((this.IdField.Equals(value) != true)) {
                    this.IdField = value;
                    this.RaisePropertyChanged("Id");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public string Name {
            get {
                return this.NameField;
            }
            set {
                if ((object.ReferenceEquals(this.NameField, value) != true)) {
                    this.NameField = value;
                    this.RaisePropertyChanged("Name");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public string Surname {
            get {
                return this.SurnameField;
            }
            set {
                if ((object.ReferenceEquals(this.SurnameField, value) != true)) {
                    this.SurnameField = value;
                    this.RaisePropertyChanged("Surname");
                }
            }
        }
        
        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.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Gender", Namespace="PersonalInformationService.Types")]
    public enum Gender : int {
        
        [System.Runtime.Serialization.EnumMemberAttribute()]
        Female = 0,
        
        [System.Runtime.Serialization.EnumMemberAttribute()]
        Male = 1,
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="IPersonalInformationServiceReference.IPersonalInformationService")]
    public interface IPersonalInformationService {
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IPersonalInformationService/GetPersonalInformation", ReplyAction="http://tempuri.org/IPersonalInformationService/GetPersonalInformationResponse")]
        PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse GetPersonalInformation(PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPersonalInformationService/GetPersonalInformation", ReplyAction="http://tempuri.org/IPersonalInformationService/GetPersonalInformationResponse")]
        System.IAsyncResult BeginGetPersonalInformation(PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request, System.AsyncCallback callback, object asyncState);
        
        PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse EndGetPersonalInformation(System.IAsyncResult result);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface IPersonalInformationServiceChannel : PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.IPersonalInformationService, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetPersonalInformationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetPersonalInformationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class PersonalInformationServiceClient : System.ServiceModel.ClientBase<PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.IPersonalInformationService>, PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.IPersonalInformationService {
        
        private BeginOperationDelegate onBeginGetPersonalInformationDelegate;
        
        private EndOperationDelegate onEndGetPersonalInformationDelegate;
        
        private System.Threading.SendOrPostCallback onGetPersonalInformationCompletedDelegate;
        
        public PersonalInformationServiceClient() {
        }
        
        public PersonalInformationServiceClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public PersonalInformationServiceClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public PersonalInformationServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public PersonalInformationServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public event System.EventHandler<GetPersonalInformationCompletedEventArgs> GetPersonalInformationCompleted;
        
        public PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse GetPersonalInformation(PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request) {
            return base.Channel.GetPersonalInformation(request);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        public System.IAsyncResult BeginGetPersonalInformation(PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetPersonalInformation(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        public PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse EndGetPersonalInformation(System.IAsyncResult result) {
            return base.Channel.EndGetPersonalInformation(result);
        }
        
        private System.IAsyncResult OnBeginGetPersonalInformation(object[] inValues, System.AsyncCallback callback, object asyncState) {
            PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request = ((PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest)(inValues[0]));
            return this.BeginGetPersonalInformation(request, callback, asyncState);
        }
        
        private object[] OnEndGetPersonalInformation(System.IAsyncResult result) {
            PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationResponse retVal = this.EndGetPersonalInformation(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetPersonalInformationCompleted(object state) {
            if ((this.GetPersonalInformationCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetPersonalInformationCompleted(this, new GetPersonalInformationCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetPersonalInformationAsync(PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request) {
            this.GetPersonalInformationAsync(request, null);
        }
        
        public void GetPersonalInformationAsync(PersonalInformationClients.AsyncClient.IPersonalInformationServiceReference.PersonalInformationRequest request, object userState) {
            if ((this.onBeginGetPersonalInformationDelegate == null)) {
                this.onBeginGetPersonalInformationDelegate = new BeginOperationDelegate(this.OnBeginGetPersonalInformation);
            }
            if ((this.onEndGetPersonalInformationDelegate == null)) {
                this.onEndGetPersonalInformationDelegate = new EndOperationDelegate(this.OnEndGetPersonalInformation);
            }
            if ((this.onGetPersonalInformationCompletedDelegate == null)) {
                this.onGetPersonalInformationCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetPersonalInformationCompleted);
            }
            base.InvokeAsync(this.onBeginGetPersonalInformationDelegate, new object[] {
                        request}, this.onEndGetPersonalInformationDelegate, this.onGetPersonalInformationCompletedDelegate, userState);
        }
    }
}
