コード例 #1
0
ファイル: ActivityContext.cs プロジェクト: wforney/corewf
        //[SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters, Justification = "Generic needed for type inference")]
        /// <summary>
        /// Gets the value.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="argument">The argument.</param>
        /// <returns>T.</returns>
        /// <remarks>
        /// Soft-Link: This method is referenced through reflection by ExpressionUtilities.TryRewriteLambdaExpression. Update that file if the signature changes.
        /// </remarks>
        public T GetValue <T>(OutArgument <T> argument)
        {
            this.ThrowIfDisposed();

            if (argument == null)
            {
                throw FxTrace.Exception.ArgumentNull(nameof(argument));
            }

            argument.ThrowIfNotInTree();

            return(this.GetValueCore <T>(argument.RuntimeArgument));
        }
コード例 #2
0
ファイル: ActivityContext.cs プロジェクト: x-strong/CoreWF
        //[SuppressMessage(FxCop.Category.Design, FxCop.Rule.ConsiderPassingBaseTypesAsParameters,
        //    Justification = "Generic needed for type inference")]
        public void SetValue <T>(OutArgument <T> argument, T value)
        {
            ThrowIfDisposed();

            if (argument == null)
            {
                // We want to shortcut if the argument is null
                return;
            }

            argument.ThrowIfNotInTree();

            SetValueCore(argument.RuntimeArgument, value);
        }