//------------------------------------------------------------------------------
// <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.Phone.ServiceReference, version 3.7.0.0
// 
namespace WPWCFClient.WcfServicePersonen {
    using System.Runtime.Serialization;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Person", Namespace="http://schemas.datacontract.org/2004/07/WcfServicePersonen")]
    public partial class Person : object, System.ComponentModel.INotifyPropertyChanged {
        
        private int AlterField;
        
        private string NameField;
        
        private string VornameField;
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int Alter {
            get {
                return this.AlterField;
            }
            set {
                if ((this.AlterField.Equals(value) != true)) {
                    this.AlterField = value;
                    this.RaisePropertyChanged("Alter");
                }
            }
        }
        
        [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 Vorname {
            get {
                return this.VornameField;
            }
            set {
                if ((object.ReferenceEquals(this.VornameField, value) != true)) {
                    this.VornameField = value;
                    this.RaisePropertyChanged("Vorname");
                }
            }
        }
        
        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", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="WcfServicePersonen.IPersonService")]
    public interface IPersonService {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPersonService/GetPersonen", ReplyAction="http://tempuri.org/IPersonService/GetPersonenResponse")]
        System.IAsyncResult BeginGetPersonen(System.AsyncCallback callback, object asyncState);
        
        System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person> EndGetPersonen(System.IAsyncResult result);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface IPersonServiceChannel : WPWCFClient.WcfServicePersonen.IPersonService, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetPersonenCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetPersonenCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person> Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person>)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class PersonServiceClient : System.ServiceModel.ClientBase<WPWCFClient.WcfServicePersonen.IPersonService>, WPWCFClient.WcfServicePersonen.IPersonService {
        
        private BeginOperationDelegate onBeginGetPersonenDelegate;
        
        private EndOperationDelegate onEndGetPersonenDelegate;
        
        private System.Threading.SendOrPostCallback onGetPersonenCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public PersonServiceClient() {
        }
        
        public PersonServiceClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public PersonServiceClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public PersonServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public PersonServiceClient(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<GetPersonenCompletedEventArgs> GetPersonenCompleted;
        
        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 WPWCFClient.WcfServicePersonen.IPersonService.BeginGetPersonen(System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetPersonen(callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person> WPWCFClient.WcfServicePersonen.IPersonService.EndGetPersonen(System.IAsyncResult result) {
            return base.Channel.EndGetPersonen(result);
        }
        
        private System.IAsyncResult OnBeginGetPersonen(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((WPWCFClient.WcfServicePersonen.IPersonService)(this)).BeginGetPersonen(callback, asyncState);
        }
        
        private object[] OnEndGetPersonen(System.IAsyncResult result) {
            System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person> retVal = ((WPWCFClient.WcfServicePersonen.IPersonService)(this)).EndGetPersonen(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetPersonenCompleted(object state) {
            if ((this.GetPersonenCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetPersonenCompleted(this, new GetPersonenCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetPersonenAsync() {
            this.GetPersonenAsync(null);
        }
        
        public void GetPersonenAsync(object userState) {
            if ((this.onBeginGetPersonenDelegate == null)) {
                this.onBeginGetPersonenDelegate = new BeginOperationDelegate(this.OnBeginGetPersonen);
            }
            if ((this.onEndGetPersonenDelegate == null)) {
                this.onEndGetPersonenDelegate = new EndOperationDelegate(this.OnEndGetPersonen);
            }
            if ((this.onGetPersonenCompletedDelegate == null)) {
                this.onGetPersonenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetPersonenCompleted);
            }
            base.InvokeAsync(this.onBeginGetPersonenDelegate, null, this.onEndGetPersonenDelegate, this.onGetPersonenCompletedDelegate, 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 WPWCFClient.WcfServicePersonen.IPersonService CreateChannel() {
            return new PersonServiceClientChannel(this);
        }
        
        private class PersonServiceClientChannel : ChannelBase<WPWCFClient.WcfServicePersonen.IPersonService>, WPWCFClient.WcfServicePersonen.IPersonService {
            
            public PersonServiceClientChannel(System.ServiceModel.ClientBase<WPWCFClient.WcfServicePersonen.IPersonService> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetPersonen(System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[0];
                System.IAsyncResult _result = base.BeginInvoke("GetPersonen", _args, callback, asyncState);
                return _result;
            }
            
            public System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person> EndGetPersonen(System.IAsyncResult result) {
                object[] _args = new object[0];
                System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person> _result = ((System.Collections.ObjectModel.ObservableCollection<WPWCFClient.WcfServicePersonen.Person>)(base.EndInvoke("GetPersonen", _args, result)));
                return _result;
            }
        }
    }
}
