Exemple #1
0
        public HMIFramework Open()
        {
            HMIFramework f = new HMIFramework(this);

            _openedList.Add(f);
            return(f);
        }
Exemple #2
0
 private void InitRoot(TreeNode root, HMIFramework framework)
 {
     root.Nodes.Clear();
     root.Text             = Rs.sRootName;
     root.Tag              = framework;
     root.ContextMenuStrip = _menuStripNode;
     root.ImageKey         = NodeKeys[0];
     root.SelectedImageKey = NodeKeys[0];
 }
Exemple #3
0
        public void Close(INSProjectDirector projectInfo)
        {
            HMIFramework f = FindOpened(projectInfo);

            if (f != null)
            {
                _openedList.Remove(f);
                f.Close();
            }
        }
Exemple #4
0
        private static void CloseForms(TreeNode node)
        {
            HMIFramework framework = GetFramework(node);

            if (framework == null)
            {
                return;
            }

            CloseForm(framework, node);
        }
Exemple #5
0
        private static void RenameForms(TreeNode node, string oldFullName)
        {
            HMIFramework framework = GetFramework(node);

            if (framework == null)
            {
                return;
            }

            RenameForm(framework, node, oldFullName);
        }
Exemple #6
0
        private static void CreateForm(TreeNode node)
        {
            HMIFramework framework = GetFramework(node);

            if (framework == null)
            {
                return;
            }
            string fullName = GetFilePath(node);

            framework.Forms.Create(fullName);
        }
Exemple #7
0
 private static void CloseForm(HMIFramework framework, TreeNode node)
 {
     if (GetFileType(node) == FileType.File)
     {
         framework.Forms.Close(GetFilePath(node));
     }
     else
     {
         foreach (TreeNode n in node.Nodes)
         {
             CloseForm(framework, n);
         }
     }
 }
Exemple #8
0
 private static void RenameForm(HMIFramework framework, TreeNode node, string oldFullName)
 {
     if (GetFileType(node) == FileType.File)
     {
         framework.Forms.Rename(GetFilePath(node), oldFullName);
     }
     else
     {
         foreach (TreeNode n in node.Nodes)
         {
             RenameForm(framework, n, oldFullName + @"\" + n.Text);
         }
     }
 }
Exemple #9
0
        private static void OpenForm(TreeNode node)
        {
            if (GetFileType(node) != FileType.File)
            {
                return;
            }

            HMIFramework framework = GetFramework(node);

            if (framework == null)
            {
                return;
            }
            string fullName = GetFilePath(node);

            framework.Forms.Open(fullName);
        }
Exemple #10
0
        /// <summary>
        /// 根据root和framework生成一个文件树
        /// </summary>
        /// <param name="root"></param>
        /// <param name="framework"></param>
        public void InitNodes(TreeNode root, HMIFramework framework)
        {
            Debug.Assert(root != null && root.TreeView != null);

            InitTreeView(root);
            InitRoot(root, framework);

            //file
            string project = framework.HMIPath;

            if (!Directory.Exists(project))
            {
                Directory.CreateDirectory(project);
            }
            _treeView.BeginUpdate();
            GetNodes(project, "*" + Rs.sExtension, root);
            _treeView.EndUpdate();
        }
Exemple #11
0
 public FormOperation(HMIFramework framework)
 {
     Debug.Assert(framework != null);
     _framework = framework;
 }