private void Initialization(IHMIForm f, string fullName) { f.FullName = fullName; _openedList.Add(f); ((Form)f).FormClosed += FormClosed; f.Common.Initialization(); }
public IHMIForm Open(string fullName) { IHMIForm f = FindOpened(fullName); if (f != null) { Show(f); return(f); } BinaryFormatter bf = new BinaryFormatter(); try { using (Stream s = File.Open(fullName, FileMode.Open)) { f = new HMIForm(_framework); (f as HMIForm).Deserialize(bf, s); Initialization(f, fullName); } } catch (Exception e) { MessageBox.Show(e.Message); return(null); } Show(f); return(f); }
public void MouseMove(PointF point) { IUndoRedoManager undo = null; if (_list.Count > 0) { IHMIForm form = _list[0].Parant; undo = form.Studio.Undo; } Invalidate(); if (undo != null) { undo.StartTransaction("Move"); } foreach (IDrawObj obj in _list) { obj.MouseMove(point); } if (undo != null) { undo.EndTransaction(); } SetListRect(); SetRotatePointPos(); Invalidate(true); }
public LayerConfigForm(IHMIForm data) { InitializeComponent(); Debug.Assert(data != null); _data = data; }
public void ActiveDocumentChanged(object sender, EventArgs e) { if (sender is DockPanel) { _activeForm = (sender as DockPanel).ActiveDocument as IHMIForm; } SetCreateObjectState(_currentToolboxItem); }
private static void ChangeText(IHMIForm f, string newFullName) { string name = Path.GetFileNameWithoutExtension(f.FullName); //Text和文件名保持一致,才改名 if (string.Compare(name, ((Form)f).Text, true) == 0) { ((Form)f).Text = Path.GetFileNameWithoutExtension(newFullName); } }
private void Show(IHMIForm form) { if (_framework.IsStudioMode) { ((DockContent)form).Show(((FrameworkManager)_framework.Manager).MainPanel); } else { ((Form)form).Show(); } }
public bool Close(string fullName) { IHMIForm f = FindOpened(fullName); if (f != null) { ((Form)f).Close(); return(true); } return(false); }
public bool Rename(string newFullName, string oldFullName) { IHMIForm f = FindOpened(oldFullName); if (f != null) { ChangeText(f, newFullName); f.FullName = newFullName; return(true); } return(false); }
public ControlPointContainer(IHMIForm container) { Debug.Assert(container != null); _container = container; _selectObjs = new SelectObjectManager(this); _node = new NodePoint(_selectObjs); _custom = new CustomPoint(_selectObjs); _frame = new FramePoint(_selectObjs); _segment = new SegmentPoint(_selectObjs); _form = new FormPoint((HMIForm)_container); }
public bool Save(IHMIForm form) { form.Save(); return(true); }