Exemplo n.º 1
0
        /// <summary>
        /// NOTE: This constructor is not CLS-Compliant
        /// </summary>
        public AutoDataAttribute(IParameterValueProvider parameterValueProvider)
        {
            this.RunState   = RunState.Runnable;
            this.Properties = new PropertyBag();

            this.parameterValueProvider = parameterValueProvider;
        }
        /// <summary>
        /// NOTE: This constructor is not CLS-Compliant
        /// </summary>
        public AutoDataAttribute(IParameterValueProvider parameterValueProvider)
        {
            this.RunState = RunState.Runnable;
            this.Properties = new PropertyBag();

            this.parameterValueProvider = parameterValueProvider;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceMethodInvoker"/> class.
        /// </summary>
        /// <param name="behaviorInvoker">The service behavior invoker.</param>
        /// <param name="parameterValueProvider">The parameter value provider.</param>
        /// <param name="resultWrapper">The service method result wrapper.</param>
        public ServiceMethodInvoker(IServiceBehaviorInvoker behaviorInvoker, IParameterValueProvider parameterValueProvider, IResultWrapper resultWrapper)
        {
            if (behaviorInvoker == null)
            {
                throw new ArgumentNullException("behaviorInvoker");
            }

            if (parameterValueProvider == null)
            {
                throw new ArgumentNullException("parameterValueProvider");
            }

            if (resultWrapper == null)
            {
                throw new ArgumentNullException("resultWrapper");
            }

            m_behaviorInvoker = behaviorInvoker;
            m_parameterValueProvider = parameterValueProvider;
            m_resultWrapper = resultWrapper;
        }
Exemplo n.º 4
0
 public OutputParameter(string name, IParameterValueProvider valueProvider) : base(name, valueProvider)
 {
 }
Exemplo n.º 5
0
 public ExternalTaskActivityBehavior(string topicName, IParameterValueProvider paramValueProvider)
 {
     this.TopicName        = topicName;
     priorityValueProvider = paramValueProvider;
 }
Exemplo n.º 6
0
 public IoParameter(string name, IParameterValueProvider valueProvider)
 {
     this.name          = name;
     this.valueProvider = valueProvider;
 }
Exemplo n.º 7
0
        /// <summary>
        ///     Evaluates a given value provider with the given execution entity to determine
        ///     the correct value. The error message heading is used for the error message
        ///     if the validation fails because the value is no valid priority.
        /// </summary>
        /// <param name="valueProvider"> the provider which contains the value </param>
        /// <param name="execution"> the execution entity </param>
        /// <param name="errorMessageHeading"> the heading which is used for the error message </param>
        /// <returns> the valid priority value </returns>
        protected internal virtual long EvaluateValueProvider(IParameterValueProvider valueProvider,
                                                              ExecutionEntity execution, string errorMessageHeading)
        {
            object value;

            try
            {
                value = valueProvider.GetValue(execution);
            }
            catch (ProcessEngineException e)
            {
                if (Context.ProcessEngineConfiguration.EnableGracefulDegradationOnContextSwitchFailure &&
                    IsSymptomOfContextSwitchFailure(e, execution))
                {
                    value = DefaultPriorityOnResolutionFailure;
                    LogNotDeterminingPriority(execution, value, e);
                }
                else
                {
                    throw e;
                }
            }

            long numberValue;

            try
            {
                numberValue = long.Parse(value.ToString());
                return(numberValue);
            }
            catch (System.Exception ex)
            {
                throw new ProcessEngineException(errorMessageHeading + " " + ex.Message + ": Priority value is not an Integer," + value);
            }



            //long numberValue;
            ////if (!(value is int||value is decimal))
            //try
            //{
            //    numberValue = long.Parse(value.ToString());
            //    return numberValue;
            //}
            //catch (Exception e)
            //{
            //    throw new ProcessEngineException(errorMessageHeading + " " + e.Message + ": Priority value is not an Integer," + value);
            //}
            //else
            //{
            //decimal numberValue = (decimal)value;
            //if (IsValidLongValue(numberValue))
            //{
            //    return (long?)numberValue;
            //}
            //else
            //{
            //    throw new ProcessEngineException(errorMessageHeading + ": Priority value must be either Short, Integer, or Long");
            //}
            //}
        }