Ejemplo n.º 1
0
        public void onResetPlugin()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new onResetPluginDelegate(onResetPlugin), new object[] { });
                return;
            } // if (InvokeRequired)


            cPluginParams.HostApplication.PluginSetStatus(this, "grey");

            /*
             * Clear DataGridView
             */
            //if (cSessions != null)
            //  cSessions.Clear();

            //DGV_Sessions.DataSource = cSessions;
            //DGV_Sessions.Refresh();

            /*
             * Clear TreeView
             */
            try
            {
                if (TV_Sessions != null && TV_Sessions.Nodes.Count > 0)
                {
                    foreach (TreeNode lNode in TV_Sessions.Nodes)
                    {
                        foreach (TreeNode lSubNode in lNode.Nodes)
                        {
                            if (lSubNode != null && lSubNode.Nodes.Count > 0)
                            {
                                lSubNode.Nodes.Clear();
                            }
                        }
                    }
                }
            }
            catch (Exception) { }

            /*
             * Select Main TV-Node.
             */
            mFilterNode = TV_Sessions.Nodes[0];
            TV_Sessions.SelectedNode = TV_Sessions.Nodes[0];
            TV_Sessions.Select();
            //            myTreeView.SelectedNode = myTreeNode
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TSMI_Clear_Click(object sender, EventArgs e)
        {
            /*
             * Clear DataGridView
             */
            if (cSessions != null)
            {
                cSessions.Clear();
            }

            DGV_Sessions.DataSource = cSessions;
            DGV_Sessions.Refresh();

            /*
             * Clear TreeView
             */
            try
            {
                if (TV_Sessions != null && TV_Sessions.Nodes.Count > 0)
                {
                    foreach (TreeNode lNode in TV_Sessions.Nodes)
                    {
                        foreach (TreeNode lSubNode in lNode.Nodes)
                        {
                            if (lSubNode != null && lSubNode.Nodes.Count > 0)
                            {
                                lSubNode.Nodes.Clear();
                            }
                        }
                    }
                }
            }
            catch (Exception lEx)
            {
                cPluginParams.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
            }

            /*
             * Select Main TV-Node.
             */
            mFilterNode = TV_Sessions.Nodes[0];
            TV_Sessions.SelectedNode = TV_Sessions.Nodes[0];
            TV_Sessions.Select();
            //myTreeView.SelectedNode = myTreeNode
        }