Esempio n. 1
0
        public IfElseControl()
        {
            margin = new Thickness(14, 0, 0, 0);

            slot          = new ConditionSlot(new BooleanExpressionFitter());
            slot.MinWidth = 100;
            slot.Padding  = new Thickness(4);

            consequenceSpine = new Spine(new SpineFitter(), 1);
            alternativeSpine = new Spine(new SpineFitter(), 1);

            slot.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            consequenceSpine.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            alternativeSpine.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            InitializeComponent();

            stackPanel.Children.Insert(1, slot);

            Consequences = consequenceSpine;
            Alternative  = alternativeSpine;
        }
Esempio n. 2
0
        public IfControl()
        {
            slot          = new ConditionSlot(new BooleanExpressionFitter());
            slot.MinWidth = 100;
            slot.Padding  = new Thickness(4);

            spine        = new Spine(new SpineFitter(), 1);
            spine.Margin = new Thickness(14, 0, 0, 0);

            slot.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            spine.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            InitializeComponent();

            spine.Extends = border.Height + 20;

            stackPanel.Children.Insert(1, slot);

            Grid.SetRow(spine, 0);
            Grid.SetColumn(spine, 0);
            Grid.SetZIndex(spine, -1);
            grid.Children.Add(spine);
        }
Esempio n. 3
0
        public DoWhileControl()
        {
            slot         = new ConditionSlot(new BooleanExpressionFitter());
            slot.Padding = new Thickness(10);

            consequenceSpine = new Spine(new SpineFitter(), 1, 10);

            slot.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            consequenceSpine.Changed += delegate
            {
                OnChanged(new EventArgs());
            };

            InitializeComponent();

            Grid.SetRow(slot, 3);
            Grid.SetColumn(slot, 0);
            grid.Children.Add(slot);

            Grid.SetRow(consequenceSpine, 1);
            Grid.SetColumn(consequenceSpine, 0);
            grid.Children.Add(consequenceSpine);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets a deep copy of this instance.
        /// </summary>
        /// <returns>A deep copy of this instance.</returns>
        public override MoveableSlot DeepCopy()
        {
            ConditionSlot copy = new ConditionSlot(fitter);

            copy.Contents = this.Contents.DeepCopy();
            return(copy);
        }
Esempio n. 5
0
        public AndBlock()
        {
            InitializeComponent();

            BooleanExpressionFitter fitter = new BooleanExpressionFitter();

            slot1 = new ConditionSlot(fitter);
            slot2 = new ConditionSlot(fitter);

            slot1.Changed += delegate(object sender, EventArgs e) { OnChanged(e); };
            slot2.Changed += delegate(object sender, EventArgs e) { OnChanged(e); };

            TextBlock text = new TextBlock();

            text.Text              = "AND";
            text.FontSize          = 18;
            text.FontWeight        = FontWeights.ExtraBold;
            text.Padding           = new Thickness(8);
            text.Background        = Brushes.Transparent;
            text.Foreground        = Brushes.Yellow;
            text.VerticalAlignment = VerticalAlignment.Center;

            stackPanel.Children.Add(slot1);
            stackPanel.Children.Add(text);
            stackPanel.Children.Add(slot2);
        }
Esempio n. 6
0
        public ConditionalFrame()
        {
            currentScriptIsBasedOn = String.Empty;
            address = String.Empty;

            InitializeComponent();

            saveButton = new BigButton("Save");
            //finishButton = new BigButton("Finish");
            saveButton.Margin = new Thickness(0, 15, 15, 15);
            //finishButton.Margin = new Thickness(0,15,0,15);
            buttonsPanel.Children.Add(saveButton);
            //buttonsPanel.Children.Add(finishButton);

            BooleanExpressionFitter fitter = new BooleanExpressionFitter();

            slot           = new ConditionSlot(fitter);
            slot.AllowDrop = true;
            slot.Margin    = new Thickness(10, 10, 10, 0);
            slot.MinWidth  = 550;
            slot.Height    = 100;

            dragMessageTextBlock.AllowDrop        = true;
            dragMessageTextBlock.IsHitTestVisible = false;

            slot.Changed += delegate(object sender, EventArgs e)
            {
                if (slot.Contents == null)
                {
                    dragMessageTextBlock.Visibility = Visibility.Visible;
                }
                else
                {
                    dragMessageTextBlock.Visibility = Visibility.Hidden;
                }

                OnChanged(e);
            };

            Grid.SetRow(slot, 2);
            mainGrid.Children.Add(slot);
        }