Esempio n. 1
0
        private void InitializeDialog(CodeExpression expression)
        {
            HelpRequested     += new HelpEventHandler(OnHelpRequested);
            HelpButtonClicked += new CancelEventHandler(OnHelpClicked);

            if (expression != null)
            {
                this.ruleExpressionCondition.Expression = RuleExpressionWalker.Clone(expression);
                this.conditionTextBox.Text = ruleExpressionCondition.ToString().Replace("\n", "\r\n");
            }
            else
            {
                this.conditionTextBox.Text = string.Empty;
            }

            this.conditionTextBox.PopulateAutoCompleteList += new EventHandler <AutoCompletionEventArgs>(ConditionTextBox_PopulateAutoCompleteList);
            this.conditionTextBox.PopulateToolTipList      += new EventHandler <AutoCompletionEventArgs>(ConditionTextBox_PopulateAutoCompleteList);

            try
            {
                this.ruleParser.ParseCondition(this.conditionTextBox.Text);
                conditionErrorProvider.SetError(this.conditionTextBox, string.Empty);
            }
            catch (RuleSyntaxException ex)
            {
                conditionErrorProvider.SetError(this.conditionTextBox, ex.Message);
            }
        }
Esempio n. 2
0
        protected override void UpdatePreview(TextBox previewBox, object ruleObject)
        {
            RuleExpressionCondition condition = ruleObject as RuleExpressionCondition;

            if ((condition != null) && (condition.Expression != null))
            {
                RuleExpressionCondition condition2 = new RuleExpressionCondition(condition.Expression);
                System.Workflow.Activities.Common.NativeMethods.SendMessage(previewBox.Handle, 11, IntPtr.Zero, IntPtr.Zero);
                previewBox.Lines = condition2.ToString().Split(new char[] { '\n' });
                System.Workflow.Activities.Common.NativeMethods.SendMessage(previewBox.Handle, 11, new IntPtr(1), IntPtr.Zero);
                previewBox.Invalidate();
            }
            else
            {
                previewBox.Text = string.Empty;
            }
        }
Esempio n. 3
0
        protected override void UpdatePreview(TextBox previewBox, object ruleObject)
        {
            RuleExpressionCondition declarativeRuleDefinition = ruleObject as RuleExpressionCondition;

            if (declarativeRuleDefinition != null && declarativeRuleDefinition.Expression != null)
            {
                RuleExpressionCondition ruleExpressionCondition = new RuleExpressionCondition(declarativeRuleDefinition.Expression);
                NativeMethods.SendMessage(previewBox.Handle, NativeMethods.WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero);
                previewBox.Lines = ruleExpressionCondition.ToString().Split('\n');
                NativeMethods.SendMessage(previewBox.Handle, NativeMethods.WM_SETREDRAW, new IntPtr(1), IntPtr.Zero);
                previewBox.Invalidate();
            }
            else
            {
                previewBox.Text = string.Empty;
            }
        }