ExpandAll() public method

public ExpandAll ( ) : void
return void
        public SettingsForm(
            PluginRepository plugins,
            GuiConfigurablePluginInfo generalSettingsInfo,
            IEnumerable<GuiConfigurablePluginInfo> guiPluginInfos)
        {
            this.plugins = plugins;
            InitializeComponent();

            var generalSettingsPanel = generalSettingsInfo.PluginSettingsPanel;
            var generalSettingsNode = new TreeNode(generalSettingsInfo.PluginName) { Tag = generalSettingsPanel };
            settingsTreeView.Nodes.Add(generalSettingsNode);

            foreach (var plugin in guiPluginInfos)
            {
                var settingsNode = new TreeNode(plugin.PluginName) { Tag = plugin.PluginSettingsPanel };

                if(plugin.PluginIcon != null)
                {
                    treeviewImages.Images.Add(plugin.PluginIcon);
                    settingsNode.ImageIndex = treeviewImages.Images.Count - 1;
                    settingsNode.SelectedImageIndex = treeviewImages.Images.Count - 1;
                }

                generalSettingsNode.Nodes.Add(settingsNode);
            }

            settingsTreeView.SelectedNode = generalSettingsNode;
            generalSettingsNode.ExpandAll();
            panel.Controls.Add(generalSettingsPanel);

            CreateHandle();
        }
        private void BindTreeList(List<CorePointData> lstTempCorePointData)
        {
            treeViewList.Nodes.Clear();

            if (lstTempCorePointData != null && lstTempCorePointData.Count > 0)
            {
                lstCorePointData = new List<CorePointData>();
                foreach (CorePointData data in lstTempCorePointData)
                {
                    lstCorePointData.Add(data);
                }
            }

            if (lstCorePointData != null && lstCorePointData.Count > 0)
            {
                TreeNode node = new TreeNode("重心包线");
                treeViewList.Nodes.Add(node);

                foreach (CorePointData data in lstCorePointData)
                {
                    TreeNode childNode = new TreeNode();
                    childNode.Name = data.pointName;
                    childNode.Text = data.pointName;
                    childNode.ToolTipText = data.pointXValue.ToString() + "," + data.pointYValue.ToString();
                    node.Nodes.Add(childNode);
                }
                node.ExpandAll();
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            phone_book_root_node = tv_PhoneBook.Nodes["phone_book_root_node"];
            sessions_root_node = tv_Sessions.Nodes["sessions_root_node"];
            internal_root_node = sessions_root_node.Nodes["internal_root_node"];
            external_root_node = sessions_root_node.Nodes["external_root_node"];
            inbound_root_node = sessions_root_node.Nodes["inbound_root_node"];
            outbound_root_node = sessions_root_node.Nodes["outbound_root_node"];
            sessions_root_node.ExpandAll();

            talk_duration_less_than_a_minute = new DataPoint { Name = "LessThenAMinute", LegendText = "Talk < 1 min", YValues = new[] { 0.0 }, Color = Color.FromArgb(100, 180, 100) };
            c_UserChart.Series[USER_STATES].Points.Add(talk_duration_less_than_a_minute);
            talk_duration_over_a_minute = new DataPoint { Name = "OverAMinute", LegendText = "Talk >= 1 min", YValues = new[] { 0.0 }, Color = Color.FromArgb(180, 80, 80) };
            c_UserChart.Series[USER_STATES].Points.Add(talk_duration_over_a_minute);

            SetState(LoginState.LoggedOut);

            presenter = new MainWindowPresenter(this, SimpleIOCContainer.Instance.Resolve<IOPSClient>());

            c_Statistics.Series[NUMBER_OF_SESSIONS].Points.AddXY(0, 0);
            c_Statistics.Series[NUMBER_OF_DROPPED_SESSIONS].Points.AddXY(0, 0);

            presenter.Connect();

            t_Timer.Start();
        }
Example #4
0
        private void AddNode(IDictionary<string, object> dictionary, TreeNode node)
        {
            if (dictionary.Count == 0)
            {
                node.Nodes.Add("{}");
            }
            else
            {
                foreach (var pair in dictionary)
                {
                    var key = pair.Key;
                    if (pair.Value is IDictionary<string, object>)
                    {
                        var n = new TreeNode(pair.Key);
                        node.Nodes.Add(n);
                        AddNode(pair.Value, n);
                    }
                    else if (pair.Value is IList<object>)
                    {
                        var n = new TreeNode("[] " + pair.Key);
                        node.Nodes.Add(n);
                        AddNode((IList<object>)pair.Value, n);
                    }
                    else
                    {
                        // todo: differentiate null
                        node.Nodes.Add(string.Format("{0} : {1}", pair.Key, pair.Value));
                    }

                    node.ExpandAll();
                }
            }
        }
        private void ShowProcessWaitChains(WaitChainTraversal wct, bool showAllData)
        {
            var threads = Windows.GetProcessThreads(processPid);

            if (threads == null)
            {
                PhUtils.ShowWarning(string.Format("The process ID {0} does not exist", processPid));
                this.Close();
            }

            textDescription.AppendText(string.Format("Process: {0}, PID: {1}", processName, processPid));

            threadNode = threadTree.Nodes.Add(string.Format("Process: {0}, PID: {1}", processName, processPid));
           
            foreach (var thread in threads)
            {
                //Get the wait chains for this thread.
                int currThreadId = thread.Key;
                
                WaitData data = wct.GetThreadWaitChain(currThreadId);

                if (data != null)
                {
                    DisplayThreadData(data, showAllData);
                }
                else //This happens when running without admin rights.
                {
                    threadNode.Nodes.Add(string.Format("TID:{0} Unable to retrieve wait chains for this thread without Admin rights", currThreadId));
                    threadNode.ExpandAll();
                }
            }
        }
Example #6
0
        private static void SetNodeStyle(TreeNode Node)
        {
            int nNodeCount = 0;
            if (Node.Nodes.Count != 0)
            {
                foreach (TreeNode tnTemp in Node.Nodes)
                {

                    if (tnTemp.Checked == true)

                        nNodeCount++;
                }

                if (nNodeCount == Node.Nodes.Count)
                {
                    Node.Checked = true;
                    Node.ExpandAll();
                    Node.ForeColor = Color.Black;
                }
                else if (nNodeCount == 0)
                {
                    Node.Checked = false;
                    Node.Collapse();
                    Node.ForeColor = Color.Black;
                }
                else
                {
                    Node.Checked = true;
                    Node.ForeColor = Color.Gray;
                }
            }
            //当前节点选择完后,判断父节点的状态,调用此方法递归。
            if (Node.Parent != null)
                SetNodeStyle(Node.Parent);
        }
        private void pTreeViewDataBanding(TreeNode node,List<Precondition> childs)
        {
            if (node != null && childs != null && childs.Count > 0)
            {
                foreach (var item in childs)
                {
                    TreeNode child = new TreeNode(item.name + "(" + item.type + ")");
                    node.Nodes.Add(child);
                    if (item.child != null && item.child.Count > 0)
                    {
                        this.pTreeViewDataBanding(child, item.child);
                        child.ExpandAll();
                    }
                }
            }
            else
            {

                TreeNode root = new TreeNode(this.precondition.name + "(" + this.precondition .type + ")");
                this.pTreeView.Nodes.Add(root);
                if (this.precondition.child != null && this.precondition.child.Count > 0)
                {
                    this.pTreeViewDataBanding(root, this.precondition.child);
                    root.ExpandAll();
                }
            }
        }
 private void SetInitialExpansion(TreeNode treeNode)
 {
     if (_view.Tree.VisibleCount >= treeNode.GetNodeCount(true))
         treeNode.ExpandAll();
     else
         CollapseToFixtures(treeNode);
 }
 private void marcarHerenciaNodo(System.Windows.Forms.TreeNode mNode, bool Checked)
 {
     mNode.Checked = Checked;
     mNode.ExpandAll();
     for (int i = 0; i < mNode.Nodes.Count; i++)
     {
         marcarHerenciaNodo(mNode.Nodes[i], Checked);
     }
 }
 private void AddLabelOnClick(object sender, EventArgs e)
 {
     if (this.nodeMouseClickSelectedNode.Level == 0)
     {
         var treeNode = new TreeNode("NewHost");
         this.nodeMouseClickSelectedNode.Nodes.Add(treeNode);
         treeNode.ExpandAll();
         treeNode.BeginEdit();
     }
 }
Example #11
0
 public void PrepareFavoritesPane()
 {
     SqlCommon.SqlForm.treeFavorites.BeginUpdate();
     SqlCommon.SqlForm.treeFavorites.Nodes.Clear();
     SqlCommon.SqlForm.treeFavorites.Nodes.Add(_favoritesTree = new NodeRoot("Favoritter", SqlGuiForm.IconFavorites));
     _favoritesTree.Nodes.Add(_favoriteTables = new NodeFolder("Tabeller"));
     _favoritesTree.Nodes.Add(_favoriteViews = new NodeFolder("Views"));
     _favoritesTree.Nodes.Add(_favoriteSqls = new NodeFolder("SQL-uttrykk"));
     _favoritesTree.ExpandAll();
     SqlCommon.SqlForm.treeFavorites.EndUpdate();
 }
Example #12
0
 public void ReceiveFlowTokenList(IEnumerable<FlowToken> data)
 {
     treeFlowToken.BeginUpdate();
     treeFlowToken.Nodes.Clear();
     foreach (var d in data) {
         var node = new TreeNode();
         node.Text = d.TokenType.ToString();
         node.Nodes.Add(d.Content);
         node.Nodes.Add("Position: " + d.Position.ToString());
         node.Nodes.Add("Length: " + d.Length.ToString());
         node.ExpandAll();
         treeFlowToken.Nodes.Add(node);
     }
     treeFlowToken.EndUpdate();
 }
 /// <summary>
 /// Function to fill ledgers as TreeMode
 /// </summary>
 /// <param name="tn"></param>
 public void FillTree(TreeNode tn)
 {
     try
     {
         List<DataTable> ListObj = new List<DataTable>();
         AccountGroupBll bllAccountGroup = new AccountGroupBll();
         ListObj = bllAccountGroup.AccountGroupViewAllByGroupUnder(Convert.ToDecimal(tn.Name));
         AccountLedgerBll bllAccountLedger = new AccountLedgerBll();
         if (ListObj[0].Rows.Count > 0)
         {
             foreach (DataRow dr in ListObj[0].Rows)
             {
                 tn.Nodes.Add(dr["accountGroupId"].ToString(), dr["accountGroupName"].ToString());
                 tn.ExpandAll();
                 if (tn.LastNode != null)
                 {
                     tn.LastNode.ForeColor = Color.Red;
                 }
                 else
                 {
                     tn.LastNode.ForeColor = Color.Blue;
                 }
             }
             foreach (TreeNode tn1 in tn.Nodes)
             {
                 FillTree(tn1);
                 List<DataTable> ListObjLedger= bllAccountLedger.AccountLedgerViewAllByLedgerName(Convert.ToDecimal(tn1.Name));
                 foreach (DataRow dr in ListObjLedger[0].Rows)
                 {
                     tn1.Nodes.Add(dr["ledgerId"].ToString(), dr["ledgerName"].ToString());
                     tn1.ExpandAll();
                     if (tn1.LastNode != null)
                     {
                         tn1.LastNode.ForeColor = Color.Blue;
                     }
                     else
                     {
                         tn.LastNode.ForeColor = Color.Red;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("COA:1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #14
0
 /// <summary>
 /// Function to fill ledgers as TreeMode
 /// </summary>
 /// <param name="tn"></param>
 public void FillTree(TreeNode tn)
 {
     try
     {
         DataTable dtb = new DataTable();
         AccountGroupSP spAccountGroup = new AccountGroupSP();
         dtb = spAccountGroup.AccountGroupViewAllByGroupUnder(Convert.ToDecimal(tn.Name));
         AccountLedgerSP ledgerSP = new AccountLedgerSP();
         if (dtb.Rows.Count > 0)
         {
             foreach (DataRow dr in dtb.Rows)
             {
                 tn.Nodes.Add(dr["accountGroupId"].ToString(), dr["accountGroupName"].ToString());
                 tn.ExpandAll();
                 if (tn.LastNode != null)
                 {
                     tn.LastNode.ForeColor = Color.Red;
                 }
                 else
                 {
                     tn.LastNode.ForeColor = Color.Blue;
                 }
             }
             foreach (TreeNode tn1 in tn.Nodes)
             {
                 FillTree(tn1);
                 DataTable dtb1 = ledgerSP.AccountLedgerViewAllByLedgerName(Convert.ToDecimal(tn1.Name));
                 foreach (DataRow dr in dtb1.Rows)
                 {
                     tn1.Nodes.Add(dr["ledgerId"].ToString(), dr["ledgerName"].ToString());
                     tn1.ExpandAll();
                     if (tn1.LastNode != null)
                     {
                         tn1.LastNode.ForeColor = Color.Blue;
                     }
                     else
                     {
                         tn.LastNode.ForeColor = Color.Red;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("COA:1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #15
0
        public void OpenFile(string filename)
        {
            BinaryReader b_reader = new BinaryReader(new FileStream(filename, FileMode.Open));

            BfsBinaryReader.Endianness endianness;
            if(schema.ByteOrder.ByteOrder == BfsByteOrderEnum.BigEndian)
                endianness = BfsBinaryReader.Endianness.BigEndian;
            else
                endianness = BfsBinaryReader.Endianness.LittleEndian;

            reader = new BfsBinaryReader(b_reader, endianness);
            TreeNode rootNode = new TreeNode(schema.FormatBlock.Name);
            treeView1.Nodes.Add(rootNode);
            ReadDataBlock(schema.FormatBlock, rootNode);
            rootNode.ExpandAll();
        }
Example #16
0
        private void mAddItemCostCenter(string vstrRoot)
        {
            string strChild = "";

            System.Windows.Forms.TreeNode oNodex  = null;
            List <VectorCategory>         oaccLed = accms.mFillVectorMaster(strComID, vstrRoot).ToList();

            foreach (VectorCategory oLed in oaccLed)
            {
                strChild                  = oLed.strCostCenter;
                oNodex                    = tvwGroup.Nodes.Find(mcGROUP_PREFIX + vstrRoot, true)[0].Nodes.Add(mcLEDGER_PREFIX + strChild, strChild, "leaf");
                oNodex.ImageIndex         = 1;
                oNodex.SelectedImageIndex = 1;
                oNodex.ExpandAll();
            }
        }
Example #17
0
        private void mAddItemMR(string vstrRoot, int intstatus)
        {
            string strChild = "";

            System.Windows.Forms.TreeNode oNodex  = null;
            List <AccountsLedger>         oaccLed = accms.mLedgerAdditemMr(strComID, vstrRoot, intstatus).ToList();

            foreach (AccountsLedger oLed in oaccLed)
            {
                strChild                  = oLed.strmerzeString;
                oNodex                    = tvwGroup.Nodes.Find(mcGROUP_PREFIX + vstrRoot, true)[0].Nodes.Add(mcLEDGER_PREFIX + strChild, strChild, "leaf");
                oNodex.ImageIndex         = 1;
                oNodex.SelectedImageIndex = 1;
                oNodex.ExpandAll();
            }
        }
Example #18
0
        private void LoadSessionData()
        {
            //Root node
            rootNode = new TreeNode("Database");
            rootNode.ImageIndex = 0;
            tvSessions.Nodes.Add(rootNode);

            //Add folders to root
            Dictionary<Int32, String> folders = sessionManager.ListFolders();
            foreach (KeyValuePair<Int32, String> folder in folders)
            {
                AddFolder(folder.Key, folder.Value);
            }

            //Finally, expand all
            rootNode.ExpandAll();
        }
Example #19
0
        TreeNode rootNode = null; //treeview的根节点

        #endregion Fields

        #region Methods

        //DataTable dtDocFileList = null;//文档清单列表
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Nds"></param>
        /// <param name="parentID"></param>
        /// <param name="dt"></param>
        public void CreatTree(TreeNodeCollection Nds, string parentID, DataTable dt)
        {
            //DataView dv = new DataView();
            TreeNode tmpNode;
            //dv.Table = dt;
            //dv.RowFilter = "上级单位ID='" + parentID + "'";
            DataRow[] dv = dt.Select(string.Format("DFD_PARENT_DIR_ID='{0}'", parentID));
            foreach (DataRow drv in dv)
            {
                tmpNode = new TreeNode();
                tmpNode.Text = drv["DFD_PATH_NAME"].ToString();
                tmpNode.Tag = drv["DFD_ID"].ToString();
                tmpNode.ExpandAll();
                Nds.Add(tmpNode);
                CreatTree(tmpNode.Nodes, tmpNode.Tag.ToString(), dt);
            }
        }
Example #20
0
        private void mAddItemSales(string vstrRoot)
        {
            string strChild = "";

            System.Windows.Forms.TreeNode oNodex  = null;
            List <AccountsLedger>         oaccLed = accms.GetSalesLedgerTreefromCustomer(strComID, vstrRoot).ToList();

            foreach (AccountsLedger oLed in oaccLed)
            {
                strChild                  = oLed.strLedgerName;
                oNodex                    = tvwGroup.Nodes.Find(mcGROUP_PREFIX + vstrRoot, true)[0].Nodes.Add(mcLEDGER_PREFIX + strChild, strChild, "leaf");
                oNodex.ImageIndex         = 1;
                oNodex.SelectedImageIndex = 1;
                oNodex.EnsureVisible();
                oNodex.ExpandAll();
                oNodex.Expand();
            }
        }
Example #21
0
        public HelpWindow(MasterWindow master)
        {
            Master = master;
            InitializeComponent();
            this.MdiParent = Master;
            this.Show();

            Index = XDocument.Parse(GetTextFile("index.xml"));
            TreeNode rootNode = new TreeNode();
            rootNode.Text = "MFE";
            topicsTreeView.Nodes.Add(rootNode);

            addNodes(Index.FirstNode, rootNode);

            currentItemRichTextBox.ReadOnly = true;
            currentItemRichTextBox.Rtf = GetTextFile("default.rtf");

            rootNode.ExpandAll();
        }
        // Build Tree from Xml ---------
        public static TreeNode BuildTreeFromXML(string xml)
        {
            XmlDocument xmlDoc = new XmlDocument();
            XmlElement xmlRoot=null;
            xmlDoc.LoadXml( xml);
            xmlRoot = (XmlElement) xmlDoc.GetElementsByTagName("root").Item(0);

            if (xmlRoot== null)
               		return null;

            string headText = xmlRoot.GetAttribute("t");
            if (headText==string.Empty)
                headText = "Άδειο";
            TreeNode top = new TreeNode( headText );

            BuildTreeFromXML(top, xmlRoot);
            top.ExpandAll();
            return top;
        }
		private void RefreshConnections()
		{
			treeViewTargets.Nodes.Clear();
			foreach (ITransport transport in mDebugger.Transports)
			{
				TransportClassAttribute transportAttr = TransportClassAttribute.ForType(transport.GetType());
				TreeNode transportNode = new TreeNode(transportAttr.Name);
				transportNode.Tag = transport;
				foreach(HostInfo hostInfo in transport.EnumerateDevices())
				{
					TreeNode hostNode = new TreeNode(hostInfo.Name);
					hostNode.Tag = hostInfo;
					transportNode.Nodes.Add(hostNode);
				}
				transportNode.ExpandAll();
				treeViewTargets.Nodes.Add(transportNode);
			}
			mSelection = null;
			buttonConnect.Enabled = false;
		}
Example #24
0
 private void RefreshStatistics()
 {
     List<TreeNode> nodes = new List<TreeNode>();
     foreach (ISensor sensor in SensorArray.Sensors)
     {
         TreeNode sensorNode = new TreeNode(sensor.Name);
         foreach (string sensorDescription in sensor.Values.Keys)
         {
             TreeNode sensorDescriptionNode = new TreeNode(sensorDescription);
             foreach (string name in sensor.Values[sensorDescription].Keys)
             {
                 TreeNode sensorReading = new TreeNode(name + " = " + sensor.Values[sensorDescription][name]);
                 sensorDescriptionNode.Nodes.Add(sensorReading);
             }
             sensorNode.Nodes.Add(sensorDescriptionNode);
         }
         sensorNode.ExpandAll();
         nodes.Add(sensorNode);
     }
     dashTV.Invoke(new UpdateTreeDelegate(this.UpdateTree), nodes);
 }
Example #25
0
        public void populate()
        {
            treeviewFTP.Nodes.Clear();
            FTPConnection ftp = ParentWindow.ftpConnection.ftp;
            FTPFile[] files = ftp.GetFileInfos();
            List<FTPFile> directories = new List<FTPFile>();
            foreach (FTPFile f in files)
            {
                if (f.Dir)
                {
                    directories.Add(f);
                }

            }

            TreeNode rootNode = new TreeNode(ftp.ServerAddress);
            GetDirectories(getDirectories(""), rootNode);
            treeviewFTP.Nodes.Add(rootNode);
            treeviewFTP.TopNode = rootNode;
            rootNode.ExpandAll();
        }
Example #26
0
        static void LoadHtmlSamples(TreeView _samplesTreeView)
        {
            //find sample folder 
            string execFromFolder = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
            string checkFolder = ExampleFolderConfig.GetCheckFolder();

            //only from debug ?
            if (!execFromFolder.EndsWith(checkFolder))
            {
                return;
            }

            int index = execFromFolder.LastIndexOf(checkFolder);
            string rootSampleFolder = execFromFolder.Substring(0, index) + "\\Source\\HtmlRenderer.Demo\\Samples";
            var root = new TreeNode("HTML Renderer");
            _samplesTreeView.Nodes.Add(root);
            string[] sampleDirs = System.IO.Directory.GetDirectories(rootSampleFolder);
            //only 1 file level (not recursive)
            foreach (string dirName in sampleDirs)
            {
                var dirNode = new TreeNode(System.IO.Path.GetFileName(dirName));
                root.Nodes.Add(dirNode);
                string[] fileNames = System.IO.Directory.GetFiles(dirName, "*.htm");
                foreach (string fname in fileNames)
                {
                    var onlyFileName = System.IO.Path.GetFileName(fname);
                    if (!onlyFileName.StartsWith("x"))
                    {
                        //for our convention: 
                        //file start with x will not show here  
                        //(it used for comment out/backup file)
                        var fileNameNode = new TreeNode(System.IO.Path.GetFileName(fname));
                        dirNode.Nodes.Add(fileNameNode);
                        fileNameNode.Tag = fname;
                    }
                }
            }
            root.ExpandAll();
            _samplesTreeView.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(_samplesTreeView_NodeMouseDoubleClick);
        }
        public GestionBDD()
        {
            InitializeComponent();

            racine_aff = TV_BDD_afficher_list_table.Nodes.Add("networkdgv");
            racine_aff.Tag = "BDD";

            racine_struct = TV_GestionBDD_structure_list_table.Nodes.Add("networkdgv");
            racine_struct.Tag = "BDD";

            for(int i = 0; i < 8; i++)
            {
                table[i] = null;
            }

            int index = 0;

            //récupère le nom des tables de la base de données
            Variable_Compte.Connection.Open();
            Lecture = new MySqlCommand("SHOW TABLES FROM networkdgv", Variable_Compte.Connection);
            MySqlDataReader Resultat = Lecture.ExecuteReader();
            while (Resultat.Read())
            {
                racine_aff.Nodes.Add((string)Resultat["Tables_in_networkdgv"]);
                racine_struct.Nodes.Add((string)Resultat["Tables_in_networkdgv"]);
                CB_BDD_SQL_table.Items.Add((string)Resultat["Tables_in_networkdgv"]);
                table[index] = (string)Resultat["Tables_in_networkdgv"];
                index++;
            }
            Variable_Compte.Connection.Close();

            racine_aff.ExpandAll();
            racine_struct.ExpandAll();

            Affichage_Table();
            Affichage_Contenu();

            CB_BDD_SQL_command.SelectedItem = CB_BDD_SQL_command.Items[0];
        }
 internal void buildApplicationsTreeView()
 {
     if (this.applications != null && this.applications.Length > 0)
     {
         IAzManStorage storage = this.applications[0].Store.Storage;
         storage.OpenConnection();
         this.itemsHierarchyTreeView.Nodes.Clear();
         TreeNode root = new TreeNode("NetSqlAzMan", 0, 0);
         root.ToolTipText = ".NET Sql Authorization Manager";
         this.itemsHierarchyTreeView.Nodes.Add(root);
         TreeNode storeNode = new TreeNode(this.applications[0].Store.Name, 1, 1);
         root.Nodes.Add(storeNode);
         root.Expand();
         storeNode.Expand();
         /*Application.DoEvents();*/
         storeNode.ToolTipText = this.applications[0].Store.Description;
         this.pb.Value = 0;
         this.pb.Minimum = 0;
         this.pb.Maximum = this.applications.Length - 1;
         this.pb.Visible = true;
         this.lblStatus.Visible = true;
         for (int i = 0; i < this.applications.Length; i++)
         {
             if (this.closeRequest)
             {
                 return;
             }
             this.pb.Value = i;
             /*Application.DoEvents();*/
             this.add(storeNode, this.applications[i]);
             storeNode.Expand();
             /*Application.DoEvents();*/
         }
         storage.CloseConnection();
         root.ExpandAll();
         this.pb.Visible = false;
         this.lblStatus.Visible = false;
     }
 }
Example #29
0
        public Visualizer(IEnumerable<AccCIL.IR.MethodEntry> methods)
        {
            InitializeComponent();

            tv.BeginUpdate();

            tv.Nodes.Clear();

            foreach (var m in methods)
            {
                TreeNode rn = new TreeNode(m.Method.ToString());
                rn.Tag = m;

                foreach(var el in m.Childnodes)
                    AddRecursive(el, rn);

                tv.Nodes.Add(rn);
                rn.ExpandAll();
            }

            tv.EndUpdate();
        }
Example #30
0
        private void WorkspaceForm_Load(object sender, EventArgs e)
        {
            mWorkspaceRootNode = WorkspaceTreeView.Nodes.Add("Workspace");

            if (Constants.ROLE_ADMIN.Equals(DataCenter.MySelf.Role))
            {
                mAdministrationNode = mWorkspaceRootNode.Nodes.Add("Administration");
                mUsersAndLicensingNode = mAdministrationNode.Nodes.Add("Users & Licensing");
            }

            mSettingFilesNode = mWorkspaceRootNode.Nodes.Add("Settings File");
            mColorSettingNode = mSettingFilesNode.Nodes.Add("Color");
            mSitesAndEmiNode = mSettingFilesNode.Nodes.Add("Site & EMI");
            //mEmiFilesNode = mSettingFilesNode.Nodes.Add("EMI");
            mChannelSettingFilesNode = mSettingFilesNode.Nodes.Add("Channel");
            mLinkconfigurationFilesNode = mSettingFilesNode.Nodes.Add("Link");
            mEquipmentParameterFilesNode = mSettingFilesNode.Nodes.Add("Equipment");

            mRegionsAndAssignmentsNode = mWorkspaceRootNode.Nodes.Add("Regions & Assignments");

            mTasksNode = mWorkspaceRootNode.Nodes.Add("Tasks");

            mWorkspaceRootNode.ExpandAll();
        }
Example #31
0
        private void AddNode(object obj, TreeNode node)
        {
            if (obj is IList<object>)
            {
                AddNode((IList<object>)obj, node);
            }
            else if (obj is IDictionary<string, object>)
            {
                AddNode((IDictionary<string, object>)obj, node);
            }
            else
            {
                if (obj == null)
                {
                    node.Nodes.Add("null");
                }
                else
                {
                    node.Nodes.Add(obj.ToString());
                }

                node.ExpandAll();
            }
        }
Example #32
0
 private void LoadTypes(Type baseType)
 {
     TreeNode treeNode = new TreeNode(String.Empty, -1, -1);
     if (baseType.IsInterface)
     {
         treeNode.Text = SR.TypeSelectorInterfaceRootNodeText(baseType.FullName);
     }
     else if (baseType.IsClass)
     {
         treeNode.Text = SR.TypeSelectorClassRootNodeText(baseType.FullName);
     }
     this.treeView.Nodes.Add(treeNode);
     this.rootNode = new TreeNode(SR.AssembliesLabelText, 0, 1);
     treeNode.Nodes.Add(rootNode);
     foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
     {
         this.LoadTreeView(assembly);
     }
     treeNode.ExpandAll();
     this.treeView.SelectedNode = this.currentTypeTreeNode;
 }
Example #33
0
        private void ribbonButton_OpenMap_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.InitialDirectory = this.getDataPath() + "map\\";
            openFileDialog1.Filter = "User Defined Map Files|*.map";
            openFileDialog1.Title = "Select map";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string openPath = openFileDialog1.FileName;
                MG_Map map = MG_ShapeFileOper.LoadMap(openPath);

                // save map to list
                this.m_gMaps.Add(map);

                // add map node
                TreeNode mapNode = new TreeNode();
                mapNode.Text = map.GetMapName();
                mapNode.Checked = false;
                this.treeViewContent.Nodes.Add(mapNode);

                // add layer node to map node
                for (int i = 0; i < map.GetLayerCount(); i++)
                {
                    TreeNode layerNode = new TreeNode();
                    layerNode.Text = map.GetLayer(i).GetLayerName();
                    layerNode.Checked = true;
                    mapNode.Nodes.Add(layerNode);
                }
                mapNode.ExpandAll();
                // set selectedNode
                this.m_gSelectedNode = mapNode;
                this.treeViewContent.SelectedNode = this.m_gSelectedNode;

                // update m_gMapView
                this.updateMapView();

                this.Refresh();
            }

            // set state
            this.setState();
        }
Example #34
0
        private bool LoadMessage(string sLoadType, string sMessage)
        {
            ADODB.Stream objMsgStream = new ADODB.Stream();
            string       sFileName    = "";

            objCDOMsg = null;
            objCDOMsg = new CDO.Message();
            bLoaded   = false;

            try {
                this.Cursor = Cursors.WaitCursor;


                // First Get the Raw Mime and display it.
                string sFileText = null;
                if (sLoadType == "file")
                {
                    //MyApp.AppUtil xObj = new MyApp.AppUtil();
                    sFileName = txtFileName.Text.Trim();
                    sFileText = UserIoHelper.GetFileAsString(sFileName);


                    txtMime.Text = sFileText;


                    // Now Lets read this thing
                    objMsgStream.Open();
                    objMsgStream.LoadFromFile(sFileName);
                    objCDOMsg.BodyPart.DataSource.OpenObject(objMsgStream, "IStream");
                    m_MessageMime = sFileText;
                }
                else
                {
                    sFileName    = Path.GetTempFileName();
                    txtMime.Text = sMessage;


                    UserIoHelper.SaveStringAsFile(sMessage, sFileName);

                    // Ran into problems writing mime text to a message, working around by using a temp file
                    objMsgStream.Open();
                    objMsgStream.LoadFromFile(sFileName);
                    // Read temp file

                    objCDOMsg.BodyPart.DataSource.OpenObject(objMsgStream, "IStream");
                    // read it
                    File.Delete(sFileName);
                    // Get rid of temp file
                    m_MessageMime = sMessage;
                }

                LoadMessageFields();
                //LoadAttachemntsFields();
                ExtractBodyPart(objCDOMsg.BodyPart);


                //Marshal.ReleaseComObject(objMsgStream);
            }
            catch (Exception ex) {
                bLoaded = false;
                MessageBox.Show("Error Loading File: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            try {
                System.Windows.Forms.TreeNode pNode = new System.Windows.Forms.TreeNode();
                TreeView1.Nodes.Clear();
                pNode = TreeView1.Nodes.Add("Root");
                // m_BaseURI
                pNode.Tag = objCDOMsg.BodyPart;



                int iBodyPartCount1 = 1;
                int iBodyPartCount2 = 1;
                int iBodyPartCount3 = 1;
                int iBodyPartCount4 = 1;
                int iBodyPartCount5 = 1;
                int iBodyPartCount6 = 1;
                int iBodyPartCount7 = 1;

                System.Windows.Forms.TreeNode aNode1 = null;
                System.Windows.Forms.TreeNode aNode2 = null;
                System.Windows.Forms.TreeNode aNode3 = null;
                System.Windows.Forms.TreeNode aNode4 = null;
                System.Windows.Forms.TreeNode aNode5 = null;
                System.Windows.Forms.TreeNode aNode6 = null;
                System.Windows.Forms.TreeNode aNode7 = null;

                iBodyPartCount1 = 1;
                // Note: I'm using this big loop because i want to be able to see things better
                // as this code loops through each body part.  Using a recursive call to a method
                // just makes the debugging process more difficult.
                foreach (CDO.IBodyPart objBodypart1 in objCDOMsg.BodyPart.BodyParts)
                {
                    AddNode(objBodypart1, ref pNode, ref aNode1, iBodyPartCount1);

                    iBodyPartCount2 = 1;
                    foreach (CDO.IBodyPart objBodypart2 in objBodypart1.BodyParts)
                    {
                        AddNode(objBodypart2, ref aNode1, ref aNode2, iBodyPartCount2);
                        iBodyPartCount3 = 1;
                        foreach (CDO.IBodyPart objBodypart3 in objBodypart2.BodyParts)
                        {
                            AddNode(objBodypart3, ref aNode2, ref aNode3, iBodyPartCount3);
                            iBodyPartCount4 = 1;
                            foreach (CDO.IBodyPart objBodypart4 in objBodypart3.BodyParts)
                            {
                                AddNode(objBodypart4, ref aNode3, ref aNode4, iBodyPartCount4);
                                iBodyPartCount5 = 1;
                                foreach (CDO.IBodyPart objBodypart5 in objBodypart4.BodyParts)
                                {
                                    AddNode(objBodypart5, ref aNode4, ref aNode5, iBodyPartCount5);
                                    iBodyPartCount6 = 1;
                                    foreach (CDO.IBodyPart objBodypart6 in objBodypart5.BodyParts)
                                    {
                                        AddNode(objBodypart6, ref aNode5, ref aNode6, iBodyPartCount6);
                                        iBodyPartCount7 = 1;
                                        foreach (CDO.IBodyPart objBodypart7 in objBodypart6.BodyParts)
                                        {
                                            AddNode(objBodypart7, ref aNode6, ref aNode7, iBodyPartCount7);
                                            iBodyPartCount7 += 1;
                                            //Marshal.ReleaseComObject(objBodypart7);
                                        }
                                        iBodyPartCount6 += 1;
                                        // Marshal.ReleaseComObject(objBodypart6);
                                    }
                                    iBodyPartCount5 += 1;
                                    //Marshal.ReleaseComObject(objBodypart5);
                                }
                                iBodyPartCount4 += 1;
                                //Marshal.ReleaseComObject(objBodypart4);
                            }
                            iBodyPartCount3 += 1;
                            // Marshal.ReleaseComObject(objBodypart3);
                        }
                        iBodyPartCount2 += 1;
                        //Marshal.ReleaseComObject(objBodypart2);
                    }
                    iBodyPartCount1 += 1;
                    //Marshal.ReleaseComObject(objBodypart1);
                }
                pNode.ExpandAll();

                bLoaded = true;
            } catch (Exception ex) {
                bLoaded = false;
                MessageBox.Show("Error Loading Message Body Parts: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            objMsgStream = null;
            Cursor       = Cursors.Default;
            return(bLoaded);
        }
        private void DoSetup()
        {
            _tree.Nodes.Clear();

            TreeNode root = new TreeNode(_project.Name);

            TreeNode profileNode = new TreeNode(_project.Profile.Name);
            TreeNode sequenceNode = new TreeNode(_project.Sequence.Name);
            sequenceNode.Nodes.Add(profileNode);
            root.Nodes.Add(sequenceNode);

            _tree.AfterSelect += new TreeViewEventHandler(_tree_AfterSelect);
            _tree.Nodes.Add(root);
            root.ExpandAll();
        }
Example #36
0
        private void mloadTreeView(int intSttsus)
        {
            string strGroup;


            if (strType != "S" && strType != "M" && strType != "C" & strType != "N")
            {
                frmLabel.Text = "     Chart of Accounts";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                oNodex             = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Assets", "Assets", "closed");
                oNodex.Expand();
                oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Liabilities", "Liabilities", "closed");
                oNodex.Expand();
                oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Income", "Income", "closed");
                oNodex.Expand();
                oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Expenses", "Expenses", "closed");
                oNodex.Expand();
                List <AccountdGroup> oogrp = accms.GetAccountsTreeview(strComID).ToList();
                foreach (AccountdGroup ogrp in oogrp)
                {
                    strGroup                  = ogrp.GroupName.ToString();
                    oNodex                    = tvwGroup.Nodes.Find(mcGROUP_PREFIX + ogrp.ParentName.ToString(), true)[0].Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.Expand();
                    oNodex.EnsureVisible();
                    mAddItem(strGroup, intSttsus);
                }
            }
            else if (strType == "N")
            {
                frmLabel.Text = "Chart of Cost Center";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                //oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Sundry Debtors", "Sundry Debtors", "closed");
                //oNodex.Expand();
                List <VectorCategory> oogrp = accms.mFillVectorCategory(strComID).ToList();
                foreach (VectorCategory ogrp in oogrp)
                {
                    strGroup                  = ogrp.strVectorcategory.ToString();
                    oNodex                    = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, ogrp.strVectorcategory, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItemCostCenter(strGroup);
                }
            }
            else if (strType == "M")
            {
                frmLabel.Text = "Chart of Medical Representative";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                oNodex             = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Sundry Debtors", "Sundry Debtors", "closed");
                oNodex.Expand();
                List <AccountdGroup> oogrp = accms.GetAccountsTreeviewDR(strComID).ToList();
                foreach (AccountdGroup ogrp in oogrp)
                {
                    strGroup = ogrp.GroupName.ToString();
                    oNodex   = tvwGroup.Nodes.Find(mcGROUP_PREFIX + ogrp.ParentName.ToString(), true)[0].Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    //oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItemMR(strGroup, intSttsus);
                }
            }
            else if (strType == "C")
            {
                frmLabel.Text = "Chart of Sundry Creditors";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                oNodex             = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Sundry Creditors", "Sundry Creditors", "closed");
                oNodex.Expand();
                List <AccountdGroup> oogrp = accms.GetAccountsTreeviewCR(strComID).ToList();
                foreach (AccountdGroup ogrp in oogrp)
                {
                    strGroup = ogrp.GroupName.ToString();
                    oNodex   = tvwGroup.Nodes.Find(mcGROUP_PREFIX + ogrp.ParentName.ToString(), true)[0].Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    //oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItem(strGroup, intSttsus);
                }
            }
            else
            {
                frmLabel.Text = "Doctor/Customer Treeview";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                List <AccountsLedger> oogrp = accms.GetSalesLedgerTree(strComID).ToList();
                foreach (AccountsLedger ogrp in oogrp)
                {
                    strGroup                  = ogrp.strRepName.ToString();
                    oNodex                    = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, ogrp.strParentGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItemSales(strGroup);
                }
            }
        }