Пример #1
0
        protected override void CacheMetadata(CodeActivityMetadata metadata)
        {
            UnaryExpressionHelper.OnGetArguments(metadata, this.Operand);

            if (operationFunction == null)
            {
                if (!UnaryExpressionHelper.TryGenerateLinqDelegate(ExpressionType.Not, out operationFunction, out ValidationError validationError))
                {
                    metadata.AddValidationError(validationError);
                }
            }
        }
Пример #2
0
        protected override void CacheMetadata(CodeActivityMetadata metadata)
        {
            UnaryExpressionHelper.OnGetArguments(metadata, this.Operand);

            if (this.checkedOperation)
            {
                EnsureOperationFunction(metadata, ref checkedOperationFunction, ExpressionType.ConvertChecked);
            }
            else
            {
                EnsureOperationFunction(metadata, ref uncheckedOperationFunction, ExpressionType.Convert);
            }
        }
Пример #3
0
 private void EnsureOperationFunction(CodeActivityMetadata metadata,
                                      ref Func <TOperand, TResult> operationFunction,
                                      ExpressionType operatorType)
 {
     if (operationFunction == null)
     {
         if (!UnaryExpressionHelper.TryGenerateLinqDelegate(
                 operatorType,
                 out operationFunction,
                 out ValidationError validationError))
         {
             metadata.AddValidationError(validationError);
         }
     }
 }