//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.235
//
//     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.50826.0
// 
namespace FDOT.GIS.Framework.Examples.ContentService {
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ContentService.IContentService")]
    public interface IContentService {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IContentService/GetContent", ReplyAction="http://tempuri.org/IContentService/GetContentResponse")]
        System.IAsyncResult BeginGetContent(System.Collections.ObjectModel.ObservableCollection<string> keys, System.AsyncCallback callback, object asyncState);
        
        System.Collections.Generic.Dictionary<string, string> EndGetContent(System.IAsyncResult result);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface IContentServiceChannel : FDOT.GIS.Framework.Examples.ContentService.IContentService, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetContentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetContentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public System.Collections.Generic.Dictionary<string, string> Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((System.Collections.Generic.Dictionary<string, string>)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class ContentServiceClient : System.ServiceModel.ClientBase<FDOT.GIS.Framework.Examples.ContentService.IContentService>, FDOT.GIS.Framework.Examples.ContentService.IContentService {
        
        private BeginOperationDelegate onBeginGetContentDelegate;
        
        private EndOperationDelegate onEndGetContentDelegate;
        
        private System.Threading.SendOrPostCallback onGetContentCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public ContentServiceClient() {
        }
        
        public ContentServiceClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public ContentServiceClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public ContentServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public ContentServiceClient(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<GetContentCompletedEventArgs> GetContentCompleted;
        
        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 FDOT.GIS.Framework.Examples.ContentService.IContentService.BeginGetContent(System.Collections.ObjectModel.ObservableCollection<string> keys, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetContent(keys, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.Collections.Generic.Dictionary<string, string> FDOT.GIS.Framework.Examples.ContentService.IContentService.EndGetContent(System.IAsyncResult result) {
            return base.Channel.EndGetContent(result);
        }
        
        private System.IAsyncResult OnBeginGetContent(object[] inValues, System.AsyncCallback callback, object asyncState) {
            System.Collections.ObjectModel.ObservableCollection<string> keys = ((System.Collections.ObjectModel.ObservableCollection<string>)(inValues[0]));
            return ((FDOT.GIS.Framework.Examples.ContentService.IContentService)(this)).BeginGetContent(keys, callback, asyncState);
        }
        
        private object[] OnEndGetContent(System.IAsyncResult result) {
            System.Collections.Generic.Dictionary<string, string> retVal = ((FDOT.GIS.Framework.Examples.ContentService.IContentService)(this)).EndGetContent(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetContentCompleted(object state) {
            if ((this.GetContentCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetContentCompleted(this, new GetContentCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetContentAsync(System.Collections.ObjectModel.ObservableCollection<string> keys) {
            this.GetContentAsync(keys, null);
        }
        
        public void GetContentAsync(System.Collections.ObjectModel.ObservableCollection<string> keys, object userState) {
            if ((this.onBeginGetContentDelegate == null)) {
                this.onBeginGetContentDelegate = new BeginOperationDelegate(this.OnBeginGetContent);
            }
            if ((this.onEndGetContentDelegate == null)) {
                this.onEndGetContentDelegate = new EndOperationDelegate(this.OnEndGetContent);
            }
            if ((this.onGetContentCompletedDelegate == null)) {
                this.onGetContentCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetContentCompleted);
            }
            base.InvokeAsync(this.onBeginGetContentDelegate, new object[] {
                        keys}, this.onEndGetContentDelegate, this.onGetContentCompletedDelegate, 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 FDOT.GIS.Framework.Examples.ContentService.IContentService CreateChannel() {
            return new ContentServiceClientChannel(this);
        }
        
        private class ContentServiceClientChannel : ChannelBase<FDOT.GIS.Framework.Examples.ContentService.IContentService>, FDOT.GIS.Framework.Examples.ContentService.IContentService {
            
            public ContentServiceClientChannel(System.ServiceModel.ClientBase<FDOT.GIS.Framework.Examples.ContentService.IContentService> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginGetContent(System.Collections.ObjectModel.ObservableCollection<string> keys, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = keys;
                System.IAsyncResult _result = base.BeginInvoke("GetContent", _args, callback, asyncState);
                return _result;
            }
            
            public System.Collections.Generic.Dictionary<string, string> EndGetContent(System.IAsyncResult result) {
                object[] _args = new object[0];
                System.Collections.Generic.Dictionary<string, string> _result = ((System.Collections.Generic.Dictionary<string, string>)(base.EndInvoke("GetContent", _args, result)));
                return _result;
            }
        }
    }
}
