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

namespace RadTreeViewWithWCF.ServiceReference1 {
    using System.Runtime.Serialization;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.Runtime.Serialization.DataContractAttribute(Name="FoxTVSery", Namespace="http://schemas.datacontract.org/2004/07/RadTreeViewWithWCFWeb")]
    public partial class FoxTVSery : object, System.ComponentModel.INotifyPropertyChanged {
        
        private int NodeIDField;
        
        private System.Nullable<int> ParentIDField;
        
        private string NodeTextField;
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int NodeID {
            get {
                return this.NodeIDField;
            }
            set {
                if ((this.NodeIDField.Equals(value) != true)) {
                    this.NodeIDField = value;
                    this.RaisePropertyChanged("NodeID");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public System.Nullable<int> ParentID {
            get {
                return this.ParentIDField;
            }
            set {
                if ((this.ParentIDField.Equals(value) != true)) {
                    this.ParentIDField = value;
                    this.RaisePropertyChanged("ParentID");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=2)]
        public string NodeText {
            get {
                return this.NodeTextField;
            }
            set {
                if ((object.ReferenceEquals(this.NodeTextField, value) != true)) {
                    this.NodeTextField = value;
                    this.RaisePropertyChanged("NodeText");
                }
            }
        }
        
        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.ServiceModel.ServiceContractAttribute()]
    public interface IService1 {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IService1/GetTVSerie", ReplyAction="http://tempuri.org/IService1/GetTVSerieResponse")]
        System.IAsyncResult BeginGetTVSerie(System.AsyncCallback callback, object asyncState);
        
        System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery> EndGetTVSerie(System.IAsyncResult result);
    }
    
    public interface IService1Channel : RadTreeViewWithWCF.ServiceReference1.IService1, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    public partial class GetTVSerieCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetTVSerieCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery> Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery>)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    public partial class Service1Client : System.ServiceModel.ClientBase<RadTreeViewWithWCF.ServiceReference1.IService1>, RadTreeViewWithWCF.ServiceReference1.IService1 {
        
        private BeginOperationDelegate onBeginGetTVSerieDelegate;
        
        private EndOperationDelegate onEndGetTVSerieDelegate;
        
        private System.Threading.SendOrPostCallback onGetTVSerieCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public Service1Client() {
        }
        
        public Service1Client(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public Service1Client(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Service1Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public event System.EventHandler<GetTVSerieCompletedEventArgs> GetTVSerieCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
        
        System.IAsyncResult RadTreeViewWithWCF.ServiceReference1.IService1.BeginGetTVSerie(System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetTVSerie(callback, asyncState);
        }
        
        System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery> RadTreeViewWithWCF.ServiceReference1.IService1.EndGetTVSerie(System.IAsyncResult result) {
            return base.Channel.EndGetTVSerie(result);
        }
        
        private System.IAsyncResult OnBeginGetTVSerie(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((RadTreeViewWithWCF.ServiceReference1.IService1)(this)).BeginGetTVSerie(callback, asyncState);
        }
        
        private object[] OnEndGetTVSerie(System.IAsyncResult result) {
            System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery> retVal = ((RadTreeViewWithWCF.ServiceReference1.IService1)(this)).EndGetTVSerie(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetTVSerieCompleted(object state) {
            if ((this.GetTVSerieCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetTVSerieCompleted(this, new GetTVSerieCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetTVSerieAsync() {
            this.GetTVSerieAsync(null);
        }
        
        public void GetTVSerieAsync(object userState) {
            if ((this.onBeginGetTVSerieDelegate == null)) {
                this.onBeginGetTVSerieDelegate = new BeginOperationDelegate(this.OnBeginGetTVSerie);
            }
            if ((this.onEndGetTVSerieDelegate == null)) {
                this.onEndGetTVSerieDelegate = new EndOperationDelegate(this.OnEndGetTVSerie);
            }
            if ((this.onGetTVSerieCompletedDelegate == null)) {
                this.onGetTVSerieCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetTVSerieCompleted);
            }
            base.InvokeAsync(this.onBeginGetTVSerieDelegate, null, this.onEndGetTVSerieDelegate, this.onGetTVSerieCompletedDelegate, 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 RadTreeViewWithWCF.ServiceReference1.IService1 CreateChannel() {
            return new Service1ClientChannel(this);
        }
        
        private class Service1ClientChannel : ChannelBase<RadTreeViewWithWCF.ServiceReference1.IService1>, RadTreeViewWithWCF.ServiceReference1.IService1 {
            
            public Service1ClientChannel(System.ServiceModel.ClientBase<RadTreeViewWithWCF.ServiceReference1.IService1> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetTVSerie(System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[0];
                System.IAsyncResult _result = base.BeginInvoke("GetTVSerie", _args, callback, asyncState);
                return _result;
            }
            
            public System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery> EndGetTVSerie(System.IAsyncResult result) {
                object[] _args = new object[0];
                System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery> _result = ((System.Collections.ObjectModel.ObservableCollection<RadTreeViewWithWCF.ServiceReference1.FoxTVSery>)(base.EndInvoke("GetTVSerie", _args, result)));
                return _result;
            }
        }
    }
}
