////////////////////////////////////////////////////////////////////////// private void OnRemoveWatch(object sender, EventArgs e) { GridItem SelItem = GridWatch.SelectedGridItem; if (SelItem != null && SelItem.GridItemType != GridItemType.Root) { Watch.RemoveWatch(SelItem.Label); GridWatch.Refresh(); } }
////////////////////////////////////////////////////////////////////////// private void OnAddWatch(object sender, EventArgs e) { FormWatch Dlg = new FormWatch(); if (Dlg.ShowDialog() == DialogResult.OK) { Watch.AddWatch(Dlg.TxtName.Text); GridWatch.Refresh(); } }
////////////////////////////////////////////////////////////////////////// private void DisplayScript(Script Scr) { if (Scr != null) { GridVars.SelectedObject = Scr.VarProvider; ScrViewer.LoadScript(_Client, Scr); Watch.Refresh(Scr); GridWatch.Refresh(); } else { GridVars.SelectedObject = null; ScrViewer.LoadScript(_Client, null); Watch.Refresh(Scr); GridWatch.Refresh(); } RefreshScriptInfo(ScrViewer.Script); }
public void RefreshVars() { GridVars.Refresh(); GridGlobals.Refresh(); GridWatch.Refresh(); }
////////////////////////////////////////////////////////////////////////// public void RefreshScripts(Script[] Scripts) { List <ScriptPath> Paths = new List <ScriptPath>(); foreach (Script Scr in Scripts) { if (Scr.Parent != null) { continue; } ScriptPath Path = new ScriptPath(System.IO.Path.GetDirectoryName(Scr.Filename.ToLower())); int Index = Paths.BinarySearch(Path); if (Index < 0) { Paths.Add(Path); Paths.Sort(); } else { Path = Paths[Index]; } Path.Scripts.Add(Scr); } TreeScripts.BeginUpdate(); int NodeIndex = 0; foreach (ScriptPath Path in Paths) { TreeNode Node = null; while (Node == null && NodeIndex < TreeScripts.Nodes.Count) { Node = TreeScripts.Nodes[NodeIndex]; if (Node.Text != Path.Path) { if (string.Compare(Node.Text, Path.Path) < 0) { TreeScripts.Nodes.RemoveAt(NodeIndex); Node = null; } else { Node = null; break; } } else { NodeIndex++; } } if (Node == null) { Node = TreeScripts.Nodes.Insert(NodeIndex, Path.Path); Node.ImageIndex = 1; Node.SelectedImageIndex = 0; NodeIndex++; } UpdateScriptPathNode(Node, Path); } for (int i = NodeIndex; i < TreeScripts.Nodes.Count; i++) { TreeScripts.Nodes.RemoveAt(NodeIndex); } TreeScripts.EndUpdate(); Watch.Refresh(); GridWatch.Refresh(); }