Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        public IHMIForm Create(string fullName)
        {
            HMIForm f = new HMIForm(_framework)
            {
                Text = Path.GetFileNameWithoutExtension(fullName)
            };

            Initialization(f, fullName);
            Show(f);
            f.Save();
            return(f);
        }