Exemplo n.º 1
0
		public MainForm()
		{
			InitializeComponent();

			WiresController = new WireController(_editPanel);

			DoubleBuffered = true;

			_editPanel.MouseMove += new MouseEventHandler(editPanel_MouseMove);
			_editPanel.DragOver += new DragEventHandler(editPanel_DragOver);
			_editPanel.DragDrop += new DragEventHandler(editPanel_DragDrop);
			_editPanel.AllowDrop = true;

			_logicListView.MouseDown += new MouseEventHandler(logicListView_MouseDown);
			_logicListView.MouseUp += new MouseEventHandler(logicListView_MouseUp);
			_logicListView.MouseMove += new MouseEventHandler(logicListView_MouseMove);

			_logicToolStripButton.Checked = true;

			_selectToolStripButton.Checked = true;
		}
Exemplo n.º 2
0
		private void openToolStripMenuItem_Click(object sender, EventArgs e)
		{
			// NOTE: возможность десериализации пока не поддерживается
			//  из-за наличия циклических ссылок между элементами
			OpenFileDialog dialog = new OpenFileDialog();
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				BinaryFormatter formatter = new BinaryFormatter();
				WiresController = formatter.Deserialize(dialog.OpenFile()) as WireController;
				WiresController.Owner = _editPanel;
				Refresh();
			}
		}