//------------------------------------------------------------------------------
// <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 ReportViewerWithC1Report.C1ReportServiceReference {
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="C1ReportServiceReference.C1ReportService")]
    public interface C1ReportService {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="urn:C1ReportService/GetReportList", ReplyAction="urn:C1ReportService/GetReportListResponse")]
        System.IAsyncResult BeginGetReportList(System.AsyncCallback callback, object asyncState);
        
        System.Collections.ObjectModel.ObservableCollection<string> EndGetReportList(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="urn:C1ReportService/GetReport", ReplyAction="urn:C1ReportService/GetReportResponse")]
        System.IAsyncResult BeginGetReport(string reportName, System.AsyncCallback callback, object asyncState);
        
        byte[] EndGetReport(System.IAsyncResult result);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface C1ReportServiceChannel : ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetReportListCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetReportListCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public System.Collections.ObjectModel.ObservableCollection<string> Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((System.Collections.ObjectModel.ObservableCollection<string>)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetReportCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetReportCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public byte[] Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((byte[])(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class C1ReportServiceClient : System.ServiceModel.ClientBase<ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService>, ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService {
        
        private BeginOperationDelegate onBeginGetReportListDelegate;
        
        private EndOperationDelegate onEndGetReportListDelegate;
        
        private System.Threading.SendOrPostCallback onGetReportListCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetReportDelegate;
        
        private EndOperationDelegate onEndGetReportDelegate;
        
        private System.Threading.SendOrPostCallback onGetReportCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public C1ReportServiceClient() {
        }
        
        public C1ReportServiceClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public C1ReportServiceClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public C1ReportServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public C1ReportServiceClient(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<GetReportListCompletedEventArgs> GetReportListCompleted;
        
        public event System.EventHandler<GetReportCompletedEventArgs> GetReportCompleted;
        
        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 ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService.BeginGetReportList(System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetReportList(callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.Collections.ObjectModel.ObservableCollection<string> ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService.EndGetReportList(System.IAsyncResult result) {
            return base.Channel.EndGetReportList(result);
        }
        
        private System.IAsyncResult OnBeginGetReportList(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService)(this)).BeginGetReportList(callback, asyncState);
        }
        
        private object[] OnEndGetReportList(System.IAsyncResult result) {
            System.Collections.ObjectModel.ObservableCollection<string> retVal = ((ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService)(this)).EndGetReportList(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetReportListCompleted(object state) {
            if ((this.GetReportListCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetReportListCompleted(this, new GetReportListCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetReportListAsync() {
            this.GetReportListAsync(null);
        }
        
        public void GetReportListAsync(object userState) {
            if ((this.onBeginGetReportListDelegate == null)) {
                this.onBeginGetReportListDelegate = new BeginOperationDelegate(this.OnBeginGetReportList);
            }
            if ((this.onEndGetReportListDelegate == null)) {
                this.onEndGetReportListDelegate = new EndOperationDelegate(this.OnEndGetReportList);
            }
            if ((this.onGetReportListCompletedDelegate == null)) {
                this.onGetReportListCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetReportListCompleted);
            }
            base.InvokeAsync(this.onBeginGetReportListDelegate, null, this.onEndGetReportListDelegate, this.onGetReportListCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService.BeginGetReport(string reportName, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetReport(reportName, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        byte[] ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService.EndGetReport(System.IAsyncResult result) {
            return base.Channel.EndGetReport(result);
        }
        
        private System.IAsyncResult OnBeginGetReport(object[] inValues, System.AsyncCallback callback, object asyncState) {
            string reportName = ((string)(inValues[0]));
            return ((ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService)(this)).BeginGetReport(reportName, callback, asyncState);
        }
        
        private object[] OnEndGetReport(System.IAsyncResult result) {
            byte[] retVal = ((ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService)(this)).EndGetReport(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetReportCompleted(object state) {
            if ((this.GetReportCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetReportCompleted(this, new GetReportCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetReportAsync(string reportName) {
            this.GetReportAsync(reportName, null);
        }
        
        public void GetReportAsync(string reportName, object userState) {
            if ((this.onBeginGetReportDelegate == null)) {
                this.onBeginGetReportDelegate = new BeginOperationDelegate(this.OnBeginGetReport);
            }
            if ((this.onEndGetReportDelegate == null)) {
                this.onEndGetReportDelegate = new EndOperationDelegate(this.OnEndGetReport);
            }
            if ((this.onGetReportCompletedDelegate == null)) {
                this.onGetReportCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetReportCompleted);
            }
            base.InvokeAsync(this.onBeginGetReportDelegate, new object[] {
                        reportName}, this.onEndGetReportDelegate, this.onGetReportCompletedDelegate, 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 ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService CreateChannel() {
            return new C1ReportServiceClientChannel(this);
        }
        
        private class C1ReportServiceClientChannel : ChannelBase<ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService>, ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService {
            
            public C1ReportServiceClientChannel(System.ServiceModel.ClientBase<ReportViewerWithC1Report.C1ReportServiceReference.C1ReportService> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetReportList(System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[0];
                System.IAsyncResult _result = base.BeginInvoke("GetReportList", _args, callback, asyncState);
                return _result;
            }
            
            public System.Collections.ObjectModel.ObservableCollection<string> EndGetReportList(System.IAsyncResult result) {
                object[] _args = new object[0];
                System.Collections.ObjectModel.ObservableCollection<string> _result = ((System.Collections.ObjectModel.ObservableCollection<string>)(base.EndInvoke("GetReportList", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetReport(string reportName, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = reportName;
                System.IAsyncResult _result = base.BeginInvoke("GetReport", _args, callback, asyncState);
                return _result;
            }
            
            public byte[] EndGetReport(System.IAsyncResult result) {
                object[] _args = new object[0];
                byte[] _result = ((byte[])(base.EndInvoke("GetReport", _args, result)));
                return _result;
            }
        }
    }
}
