Ejemplo n.º 1
0
        private void drawOrganisationTree()
        {
            treeView1.Nodes.Clear();

            while (_PureOrganisationsTree.Count > 0)
            {
                for (int i = _PureOrganisationsTree.Count - 1; i >= 0; i--)
                {
                    PureOrganisation TreeOrg = _PureOrganisationsTree[i];
                    if (TreeOrg.Parent == "") // top node
                    {
                        treeView1.Nodes.Add(TreeOrg.UUID, TreeOrg.NameType);
                        _PureOrganisationsTree.RemoveAt(i);
                    }
                    else
                    {
                        TreeNode[] pNodes = treeView1.Nodes.Find(TreeOrg.Parent, true);
                        if (pNodes.Length > 0)
                        {
                            pNodes[0].Nodes.Add(TreeOrg.UUID, TreeOrg.NameType);
                            _PureOrganisationsTree.RemoveAt(i);
                        }
                    }
                }
            }
            foreach (TreeNode tn in treeView1.Nodes)
            {
                tn.Expand();
            }
        }
Ejemplo n.º 2
0
 private void deSerializeOrganisations()
 {
     _PureOrganisations.Clear();
     _PureOrganisationsTree.Clear();
     //foreach (KeyValuePair<string, string> kvp in Properties.Settings.Default.PureOrganisations)
     foreach (String OrganisationString in Properties.Settings.Default.PureOrganisations)
     {
         PureOrganisation Organisation = JsonConvert.DeserializeObject <PureOrganisation>(OrganisationString);
         _PureOrganisations.Add(Organisation);
         _PureOrganisationsTree.Add(Organisation);
     }
 }