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); }
private void Init() { ToolForms.Toolbox.AddTab(Rs.sVectorTabName, HMIForm.GetVectorTypes()); ToolForms.Toolbox.Initialize(); ToolForms.Toolbox.ToolBoxControl.SelectItemChanged += _frameworks.SelectItemChanged; ToolForms.Toolbox.ToolBoxControl.CreateToolboxItem += _frameworks.CreateToolboxItem; }
public IHMIForm Create(string fullName) { HMIForm f = new HMIForm(_framework) { Text = Path.GetFileNameWithoutExtension(fullName) }; Initialization(f, fullName); Show(f); f.Save(); return(f); }