Example #1
0
 public BorderDecorator(GraphicsView view)
 {
     View = view;
     Parent = View.Parent;
     BorderWidth = 2;
     Offset += BorderWidth;
 }
 public BorderDecorator(GraphicsView view)
 {
     View        = view;
     Parent      = View.Parent;
     BorderWidth = 2;
     Offset     += BorderWidth;
 }
 public ScrollDecorator(GraphicsView view)
 {
     View    = view;
     Parent  = View.Parent;
     VScroll = new VScrollBar();
     Parent.Controls.Add(VScroll);
     Parent.Resize += Parent_Resize;
     Parent_Resize(this, new EventArgs());
 }
Example #4
0
 public ScrollDecorator(GraphicsView view)
 {
     View = view;
     Parent = View.Parent;
     VScroll = new VScrollBar();
     Parent.Controls.Add(VScroll);
     Parent.Resize += Parent_Resize;
     Parent_Resize(this, new EventArgs());
 }
Example #5
0
 public MainForm()
 {
     InitializeComponent();
     this.BackColor = mainPanel.BackColor = Color.White;
     View           = new TextView("Hello world", mainPanel);
     this.KeyPress += (View as TextView).KeyPressEventHeandler;
     this.KeyDown  += (View as TextView).KeyDownEventHandler;
     this.KeyPress += MainForm_KeyPress;
     BorderDecor    = new BorderDecorator(View);
     ScrollDecor    = new ScrollDecorator(BorderDecor);
     (View as TextArea).TextChanged += MainForm_TextChanged;
     ScrollDecor.SetScrollHandler(ScrollHandler);
 }
Example #6
0
 public MainForm()
 {
     InitializeComponent();
     this.BackColor = mainPanel.BackColor = Color.White;
     View = new TextView("Hello world", mainPanel);
     this.KeyPress += (View as TextView).KeyPressEventHeandler;
     this.KeyDown += (View as TextView).KeyDownEventHandler;
     this.KeyPress += MainForm_KeyPress;
     BorderDecor = new BorderDecorator(View);
     ScrollDecor = new ScrollDecorator(BorderDecor);
     (View as TextArea).TextChanged += MainForm_TextChanged;
     ScrollDecor.SetScrollHandler(ScrollHandler);
 }
Example #7
0
        void context_EventWorkspaceAdded(object sender, WorkspaceViewModel e)
        {
            Control control = null;

            Type type = e.GetType();

            if (type == typeof(AllAppManageViewModel))
            {
                control = new AllAppManageView();
            }
            else if (type == typeof(AppParamsViewModel))
            {
                control = new AppParamsView();
            }
            else if (type == typeof(CreateAppViewModel))
            {
                control = new CreateAppView();
            }
            else if (type == typeof(AppSearchViewModel))
            {
                control = new AppSearchView();
            }
            else if (type == typeof(AppDataViewModel))
            {
                control = new AppDataView();
            }
            else if (type == typeof(GraphicsViewModel))
            {
                control = new GraphicsView();
            }
            else if (type == typeof(DamWebAPI.ViewModel.DataImport.ImportExcelDataViewModel))
            {
                control = new DamWebAPI.View.DataImport.ImportExcelDataView();
            }


            DockPanel panel = new DockPanel();

            panel.Children.Add(control);

            TabItem item = new TabItem();

            item.Header      = e.DisplayName;
            item.DataContext = e;
            item.Content     = panel;
            //    control.Dock = System.Windows.Forms.DockStyle.Fill;

            tabControl1.Items.Add(item);
            tabControl1.SelectedItem = item;
        }
Example #8
0
 public void DetachFrom(GraphicsView graphicsView)
 {
     _graphicsView         = null;
     graphicsView.TouchUp -= OnGraphicsViewTouchUp;
 }
Example #9
0
 public void AttachTo(GraphicsView graphicsView)
 {
     _graphicsView         = graphicsView;
     graphicsView.TouchUp += OnGraphicsViewTouchUp;
 }
 private void Draw()
 {
     GraphicsView.Invalidate();
 }
 public GraphicsMastermind()
 {
     this._graphicsView = new GraphicsView(new Board());
 }
Example #12
0
 void OnButtonClicked(object sender, EventArgs e)
 => GraphicsView.Invalidate();