public HMIFramework Open() { HMIFramework f = new HMIFramework(this); _openedList.Add(f); return(f); }
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]; }
public void Close(INSProjectDirector projectInfo) { HMIFramework f = FindOpened(projectInfo); if (f != null) { _openedList.Remove(f); f.Close(); } }
private static void CloseForms(TreeNode node) { HMIFramework framework = GetFramework(node); if (framework == null) { return; } CloseForm(framework, node); }
private static void RenameForms(TreeNode node, string oldFullName) { HMIFramework framework = GetFramework(node); if (framework == null) { return; } RenameForm(framework, node, oldFullName); }
private static void CreateForm(TreeNode node) { HMIFramework framework = GetFramework(node); if (framework == null) { return; } string fullName = GetFilePath(node); framework.Forms.Create(fullName); }
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); } } }
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); } } }
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); }
/// <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(); }
public FormOperation(HMIFramework framework) { Debug.Assert(framework != null); _framework = framework; }