public frmSetAlgorithm() { InitializeComponent(); AutoScaleMode = AutoScaleMode.Dpi; this.DockAreas = DockAreas.Document; this._AppValue = AppValue.Instance(); checkConfigDir(this._AppValue._ConfigDir); }
public frmSetMatch() { InitializeComponent(); AutoScaleMode = AutoScaleMode.Dpi; this.DockAreas = DockAreas.Document; this._AppValue = AppValue.Instance(); checkConfigDir(this._AppValue._ConfigDir); this._contextMenuStrip_ImageControl = new ContextMenuStrip(); this.viewPort.ContextMenuStrip = this._contextMenuStrip_ImageControl; this._ImageControl = new ToolStripMenuItem("图像操作"); this._ROIControl = new ToolStripMenuItem("添加模板ROI"); this._zoomImage = new ToolStripMenuItem("缩放"); this._zoomImage.Click += new EventHandler(zoomButton_CheckedChanged); this._ImageControl.DropDownItems.Add(this._zoomImage); this._moveImage = new ToolStripMenuItem("移动"); this._moveImage.Click += new EventHandler(moveButton_CheckedChanged); this._ImageControl.DropDownItems.Add(this._moveImage); this._noneImage = new ToolStripMenuItem("None"); this._noneImage.Click += new EventHandler(noneButton_CheckedChanged); this._ImageControl.DropDownItems.Add(this._noneImage); this._resetImage = new ToolStripMenuItem("复位"); this._resetImage.Click += new EventHandler(resetButton_Click); this._ImageControl.DropDownItems.Add(this._resetImage); this._RoiRectangle1 = new ToolStripMenuItem("Rectangle1"); this._RoiRectangle1.Click += new EventHandler(Rect1Button_Click); this._ROIControl.DropDownItems.Add(this._RoiRectangle1); this._RoiRectangle2 = new ToolStripMenuItem("Rectangle2"); this._RoiRectangle2.Click += new EventHandler(Rect2Button_Click); this._ROIControl.DropDownItems.Add(this._RoiRectangle2); this._RoiCircle = new ToolStripMenuItem("Circle"); this._RoiCircle.Click += new EventHandler(CircleButton_Click); this._ROIControl.DropDownItems.Add(this._RoiCircle); this.viewPort.ContextMenuStrip.Items.Add(this._ImageControl); this.viewPort.ContextMenuStrip.Items.Add(this._ROIControl); }
public virtual bool SaveAs() { SaveFileDialog dlg = new SaveFileDialog(); dlg.InitialDirectory = AppValue.Instance().FlowChartFile; if (Doc.Name != "") { dlg.FileName = Doc.Name; } if (dlg.ShowDialog() == DialogResult.OK) { String loc = dlg.FileName; String loc_xml = string.Format("{0}_flowStep.xml", loc); FileStream file = null; FileStream file_xml = null; try { file = File.Open(loc, FileMode.Create); this.Doc.Store(file, loc); file_xml = File.Open(loc_xml, FileMode.Create); this.Doc.StoreA(file_xml, loc_xml, View); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error saving graph as a file"); return(false); } finally { if (file != null) { file.Close(); } if (file_xml != null) { file_xml.Close(); } } } return(true); }