示例#1
0
        //////////////////////////////////////////////////////////////////////////
        private void OnRemoveWatch(object sender, EventArgs e)
        {
            GridItem SelItem = GridWatch.SelectedGridItem;

            if (SelItem != null && SelItem.GridItemType != GridItemType.Root)
            {
                Watch.RemoveWatch(SelItem.Label);
                GridWatch.Refresh();
            }
        }
示例#2
0
        //////////////////////////////////////////////////////////////////////////
        private void OnAddWatch(object sender, EventArgs e)
        {
            FormWatch Dlg = new FormWatch();

            if (Dlg.ShowDialog() == DialogResult.OK)
            {
                Watch.AddWatch(Dlg.TxtName.Text);
                GridWatch.Refresh();
            }
        }
示例#3
0
 //////////////////////////////////////////////////////////////////////////
 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);
 }
示例#4
0
 public void RefreshVars()
 {
     GridVars.Refresh();
     GridGlobals.Refresh();
     GridWatch.Refresh();
 }
示例#5
0
        //////////////////////////////////////////////////////////////////////////
        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();
        }