Beispiel #1
0
        public Widget(LogicCanvasType type)
        {
            InitializeComponent();
            ToolTip = type.ToString();

            glow = new DropShadowEffect();
            glow.ShadowDepth = 0;
            glow.Color = Colors.Blue;
            glow.BlurRadius = 5;
        }
		public SubCanvasEventArgs(LogicCanvasType type, Rect central, StrokeCollection strokes)
		{
			this._logicCanvasType = type;
            this._central = central;
            this._strokes = strokes;
		}		
 public SubCanvasEventArgs(LogicCanvasType type, Rect central)
 {
     this._logicCanvasType = type;
     this._central = central;
 }
 public MenuEventArgs(LogicCanvasType type)
 {
     _currentEditingCanvas = type;
 }
 public MenuEventArgs(LogicCanvasType type, UserControl userControl)
 {
     _currentEditingCanvas = type;
     _currentEditingUserControl = userControl;
 }
        private void HighLightCurrentUserControl(LogicCanvasType type, UserControl currentEditingControl)
        {
            CurrentEditingUserControl = currentEditingControl;

            Border border;

            foreach (UIElement child in Children)
            {
                if (child is UserControl)
                {
                    if (child == currentEditingControl)
                    {
                        switch (type)
                        {
                            case LogicCanvasType.Diagram:
                                LogicPad2.Diagram.UserControl1 ucd = child as LogicPad2.Diagram.UserControl1;
                                border = ucd.UserControlBorder;
                                border.BorderBrush = Brushes.Yellow;
                                border.BorderThickness = new Thickness(5);

                                ChangeMainMenuRepresentationOptions(ucd, new MenuEventArgs(LogicCanvasType.Diagram, ucd));
                                break;
                            case LogicCanvasType.Expression:
                                LogicPad2.Expression.UserControl1 uce = child as LogicPad2.Expression.UserControl1;
                                border = uce.UserControlBorder;
                                border.BorderBrush = Brushes.Yellow;
                                border.BorderThickness = new Thickness(5);
                                ChangeMainMenuRepresentationOptions(uce, new MenuEventArgs(LogicCanvasType.Expression, uce));
                                break;
                            case LogicCanvasType.TruthTable:
                                LogicPad2.TruthTable.UserControl1 uct = child as LogicPad2.TruthTable.UserControl1;
                                border = uct.UserControlBorder;
                                border.BorderBrush = Brushes.Yellow;
                                border.BorderThickness = new Thickness(5);
                                ChangeMainMenuRepresentationOptions(uct, new MenuEventArgs(LogicCanvasType.TruthTable, uct));
                                break;
                        }
                    }else
                    {
                        //Reset Others
                       if(child is LogicPad2.Diagram.UserControl1)
                       {
                            LogicPad2.Diagram.UserControl1 ucd = child as LogicPad2.Diagram.UserControl1;
                            border = ucd.UserControlBorder;
                            border.BorderBrush = Brushes.Black;
                            border.BorderThickness = new Thickness(1);
                       }
                       else if (child is LogicPad2.Expression.UserControl1)
                       {
                           LogicPad2.Expression.UserControl1 uce = child as LogicPad2.Expression.UserControl1;
                           border = uce.UserControlBorder;
                           border.BorderBrush = Brushes.Black;
                           border.BorderThickness = new Thickness(1);

                       }
                       else if (child is LogicPad2.TruthTable.UserControl1)
                       {
                           LogicPad2.TruthTable.UserControl1 uct = child as LogicPad2.TruthTable.UserControl1;
                           border = uct.UserControlBorder;
                           border.BorderBrush = Brushes.Black;
                           border.BorderThickness = new Thickness(1);
                       }
                    }
                }
            }

        }