public RuleConditionDialog(System.Type activityType, ITypeProvider typeProvider, CodeExpression expression)
 {
     this.ruleExpressionCondition = new RuleExpressionCondition();
     if (activityType == null)
     {
         throw new ArgumentNullException("activityType");
     }
     this.InitializeComponent();
     RuleValidation validation = new RuleValidation(activityType, typeProvider);
     this.ruleParser = new Parser(validation);
     this.InitializeDialog(expression);
 }
 public RuleConditionDialog(Activity activity, CodeExpression expression)
 {
     ITypeProvider provider;
     this.ruleExpressionCondition = new RuleExpressionCondition();
     if (activity == null)
     {
         throw new ArgumentNullException("activity");
     }
     this.InitializeComponent();
     this.serviceProvider = activity.Site;
     if (this.serviceProvider != null)
     {
         IUIService service = this.serviceProvider.GetService(typeof(IUIService)) as IUIService;
         if (service != null)
         {
             this.Font = (Font) service.Styles["DialogFont"];
         }
         provider = (ITypeProvider) this.serviceProvider.GetService(typeof(ITypeProvider));
         if (provider == null)
         {
             throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Messages.MissingService, new object[] { typeof(ITypeProvider).FullName }));
         }
         WorkflowDesignerLoader loader = this.serviceProvider.GetService(typeof(WorkflowDesignerLoader)) as WorkflowDesignerLoader;
         if (loader != null)
         {
             loader.Flush();
         }
     }
     else
     {
         TypeProvider provider2 = new TypeProvider(null);
         foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
         {
             provider2.AddAssembly(assembly);
         }
         provider = provider2;
     }
     RuleValidation validation = new RuleValidation(activity, provider, false);
     this.ruleParser = new Parser(validation);
     this.InitializeDialog(expression);
 }
 internal abstract CodeExpression ParseRootIdentifier(Parser parser, ParserContext parserContext, bool assignIsEquality);
Ejemplo n.º 4
0
 internal override CodeExpression ParseRootIdentifier(Parser parser, ParserContext parserContext, bool assignIsEquality)
 {
     return parser.ParseUnadornedMemberIdentifier(parserContext, this, assignIsEquality);
 }
Ejemplo n.º 5
0
 internal override CodeExpression ParseRootIdentifier(Parser parser, ParserContext parserContext, bool assignIsEquality)
 {
     // The root name is a type (might be generic or not).
     return parser.ParseRootTypeIdentifier(parserContext, this, assignIsEquality);
 }
Ejemplo n.º 6
0
 internal override CodeExpression ParseRootIdentifier(Parser parser, ParserContext parserContext, bool assignIsEquality)
 {
     return parser.ParseRootOverloadedTypeIdentifier(parserContext, this.TypeSymbols, assignIsEquality);
 }
Ejemplo n.º 7
0
            internal override CodeBinaryOperatorExpression CreateBinaryExpression(CodeExpression left, CodeExpression right, int operatorPosition, Parser parser, ParserContext parserContext, bool assignIsEquality)
            {
                CodePrimitiveExpression falseExpr = new CodePrimitiveExpression(false);
                parserContext.exprPositions[falseExpr] = operatorPosition;

                // Compare the comperands using "value-equality"
                CodeBinaryOperatorExpression binaryExpr = new CodeBinaryOperatorExpression(left, CodeBinaryOperatorType.ValueEquality, right);
                parserContext.exprPositions[binaryExpr] = operatorPosition;

                // Compare the result of that with false to simulate "value-inequality"
                binaryExpr = new CodeBinaryOperatorExpression(binaryExpr, CodeBinaryOperatorType.ValueEquality, falseExpr);
                parserContext.exprPositions[binaryExpr] = operatorPosition;
                parser.ValidateExpression(parserContext, binaryExpr, assignIsEquality, ValueCheck.Read);

                return binaryExpr;
            }
Ejemplo n.º 8
0
 internal override CodeExpression ParseRootIdentifier(Parser parser, ParserContext parserContext, bool assignIsEquality)
 {
     return parser.ParseRootNamespaceIdentifier(parserContext, this, assignIsEquality);
 }
Ejemplo n.º 9
0
 internal virtual CodeBinaryOperatorExpression CreateBinaryExpression(CodeExpression left, CodeExpression right, int operatorPosition, Parser parser, ParserContext parserContext, bool assignIsEquality)
 {
     CodeBinaryOperatorExpression binaryExpr = new CodeBinaryOperatorExpression(left, codeDomOperator, right);
     parserContext.exprPositions[binaryExpr] = operatorPosition;
     parser.ValidateExpression(parserContext, binaryExpr, assignIsEquality, ValueCheck.Read);
     return binaryExpr;
 }
 public RuleSetDialog(Activity activity, System.Workflow.Activities.Rules.RuleSet ruleSet)
 {
     ITypeProvider service;
     this.sortOrder = new bool[4];
     if (activity == null)
     {
         throw new ArgumentNullException("activity");
     }
     this.InitializeDialog(ruleSet);
     this.serviceProvider = activity.Site;
     if (this.serviceProvider != null)
     {
         service = (ITypeProvider) this.serviceProvider.GetService(typeof(ITypeProvider));
         if (service == null)
         {
             throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Messages.MissingService, new object[] { typeof(ITypeProvider).FullName }));
         }
         WorkflowDesignerLoader loader = this.serviceProvider.GetService(typeof(WorkflowDesignerLoader)) as WorkflowDesignerLoader;
         if (loader != null)
         {
             loader.Flush();
         }
     }
     else
     {
         TypeProvider provider2 = new TypeProvider(null);
         foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
         {
             provider2.AddAssembly(assembly);
         }
         service = provider2;
     }
     RuleValidation validation = new RuleValidation(activity, service, false);
     this.ruleParser = new Parser(validation);
 }
 public RuleSetDialog(System.Type activityType, ITypeProvider typeProvider, System.Workflow.Activities.Rules.RuleSet ruleSet)
 {
     this.sortOrder = new bool[4];
     if (activityType == null)
     {
         throw new ArgumentNullException("activityType");
     }
     this.InitializeDialog(ruleSet);
     RuleValidation validation = new RuleValidation(activityType, typeProvider);
     this.ruleParser = new Parser(validation);
 }
 internal override CodeBinaryOperatorExpression CreateBinaryExpression(CodeExpression left, CodeExpression right, int operatorPosition, Parser parser, ParserContext parserContext, bool assignIsEquality)
 {
     CodePrimitiveExpression expression = new CodePrimitiveExpression(false);
     parserContext.exprPositions[expression] = operatorPosition;
     CodeBinaryOperatorExpression expression2 = new CodeBinaryOperatorExpression(left, CodeBinaryOperatorType.ValueEquality, right);
     parserContext.exprPositions[expression2] = operatorPosition;
     expression2 = new CodeBinaryOperatorExpression(expression2, CodeBinaryOperatorType.ValueEquality, expression);
     parserContext.exprPositions[expression2] = operatorPosition;
     parser.ValidateExpression(parserContext, expression2, assignIsEquality, Parser.ValueCheck.Read);
     return expression2;
 }
 internal int CompareConstructor(Parser.CandidateConstructor other)
 {
     int num = 1;
     int num2 = -1;
     if (!this.isExpandedMatch && other.isExpandedMatch)
     {
         return num;
     }
     if (this.isExpandedMatch && !other.isExpandedMatch)
     {
         return num2;
     }
     if (this.isExpandedMatch && other.isExpandedMatch)
     {
         int length = this.ctor.GetParameters().Length;
         int num5 = other.ctor.GetParameters().Length;
         if (length > num5)
         {
             return num;
         }
         if (num5 > length)
         {
             return num2;
         }
     }
     return 0;
 }