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

namespace AsianOptions.AsianOptionsService {
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="AsianOptionsService.IService1")]
    public interface IService1 {
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/PriceAsianOptions", ReplyAction="http://tempuri.org/IService1/PriceAsianOptionsResponse")]
        AsianOptions.AsianOptionsService.PriceAsianOptionsResponse PriceAsianOptions(AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IService1/PriceAsianOptions", ReplyAction="http://tempuri.org/IService1/PriceAsianOptionsResponse")]
        System.IAsyncResult BeginPriceAsianOptions(AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request, System.AsyncCallback callback, object asyncState);
        
        AsianOptions.AsianOptionsService.PriceAsianOptionsResponse EndPriceAsianOptions(System.IAsyncResult result);
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(WrapperName="PriceAsianOptions", WrapperNamespace="http://tempuri.org/", IsWrapped=true)]
    public partial class PriceAsianOptionsRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]
        public double initial;
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)]
        public double exercise;
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=2)]
        public double up;
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=3)]
        public double down;
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=4)]
        public double interest;
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=5)]
        public int periods;
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=6)]
        public int runs;
        
        public PriceAsianOptionsRequest() {
        }
        
        public PriceAsianOptionsRequest(double initial, double exercise, double up, double down, double interest, int periods, int runs) {
            this.initial = initial;
            this.exercise = exercise;
            this.up = up;
            this.down = down;
            this.interest = interest;
            this.periods = periods;
            this.runs = runs;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(WrapperName="PriceAsianOptionsResponse", WrapperNamespace="http://tempuri.org/", IsWrapped=true)]
    public partial class PriceAsianOptionsResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]
        public double PriceAsianOptionsResult;
        
        public PriceAsianOptionsResponse() {
        }
        
        public PriceAsianOptionsResponse(double PriceAsianOptionsResult) {
            this.PriceAsianOptionsResult = PriceAsianOptionsResult;
        }
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public interface IService1Channel : AsianOptions.AsianOptionsService.IService1, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class PriceAsianOptionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public PriceAsianOptionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public AsianOptions.AsianOptionsService.PriceAsianOptionsResponse Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((AsianOptions.AsianOptionsService.PriceAsianOptionsResponse)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class Service1Client : System.ServiceModel.ClientBase<AsianOptions.AsianOptionsService.IService1>, AsianOptions.AsianOptionsService.IService1 {
        
        private BeginOperationDelegate onBeginPriceAsianOptionsDelegate;
        
        private EndOperationDelegate onEndPriceAsianOptionsDelegate;
        
        private System.Threading.SendOrPostCallback onPriceAsianOptionsCompletedDelegate;
        
        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<PriceAsianOptionsCompletedEventArgs> PriceAsianOptionsCompleted;
        
        public AsianOptions.AsianOptionsService.PriceAsianOptionsResponse PriceAsianOptions(AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request) {
            return base.Channel.PriceAsianOptions(request);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        public System.IAsyncResult BeginPriceAsianOptions(AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginPriceAsianOptions(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        public AsianOptions.AsianOptionsService.PriceAsianOptionsResponse EndPriceAsianOptions(System.IAsyncResult result) {
            return base.Channel.EndPriceAsianOptions(result);
        }
        
        private System.IAsyncResult OnBeginPriceAsianOptions(object[] inValues, System.AsyncCallback callback, object asyncState) {
            AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request = ((AsianOptions.AsianOptionsService.PriceAsianOptionsRequest)(inValues[0]));
            return this.BeginPriceAsianOptions(request, callback, asyncState);
        }
        
        private object[] OnEndPriceAsianOptions(System.IAsyncResult result) {
            AsianOptions.AsianOptionsService.PriceAsianOptionsResponse retVal = this.EndPriceAsianOptions(result);
            return new object[] {
                    retVal};
        }
        
        private void OnPriceAsianOptionsCompleted(object state) {
            if ((this.PriceAsianOptionsCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.PriceAsianOptionsCompleted(this, new PriceAsianOptionsCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void PriceAsianOptionsAsync(AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request) {
            this.PriceAsianOptionsAsync(request, null);
        }
        
        public void PriceAsianOptionsAsync(AsianOptions.AsianOptionsService.PriceAsianOptionsRequest request, object userState) {
            if ((this.onBeginPriceAsianOptionsDelegate == null)) {
                this.onBeginPriceAsianOptionsDelegate = new BeginOperationDelegate(this.OnBeginPriceAsianOptions);
            }
            if ((this.onEndPriceAsianOptionsDelegate == null)) {
                this.onEndPriceAsianOptionsDelegate = new EndOperationDelegate(this.OnEndPriceAsianOptions);
            }
            if ((this.onPriceAsianOptionsCompletedDelegate == null)) {
                this.onPriceAsianOptionsCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnPriceAsianOptionsCompleted);
            }
            base.InvokeAsync(this.onBeginPriceAsianOptionsDelegate, new object[] {
                        request}, this.onEndPriceAsianOptionsDelegate, this.onPriceAsianOptionsCompletedDelegate, userState);
        }
    }
}
