Esempio n. 1
0
 public BorderDecorator(GraphicsView view)
 {
     View = view;
     Parent = View.Parent;
     BorderWidth = 2;
     Offset += BorderWidth;
 }
Esempio n. 2
0
 public BorderDecorator(GraphicsView view)
 {
     View        = view;
     Parent      = View.Parent;
     BorderWidth = 2;
     Offset     += BorderWidth;
 }
Esempio n. 3
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());
 }
Esempio n. 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());
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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;
        }
Esempio n. 8
0
 public void DetachFrom(GraphicsView graphicsView)
 {
     _graphicsView         = null;
     graphicsView.TouchUp -= OnGraphicsViewTouchUp;
 }
Esempio n. 9
0
 public void AttachTo(GraphicsView graphicsView)
 {
     _graphicsView         = graphicsView;
     graphicsView.TouchUp += OnGraphicsViewTouchUp;
 }
Esempio n. 10
0
 private void Draw()
 {
     GraphicsView.Invalidate();
 }
 public GraphicsMastermind()
 {
     this._graphicsView = new GraphicsView(new Board());
 }
Esempio n. 12
0
 void OnButtonClicked(object sender, EventArgs e)
 => GraphicsView.Invalidate();