コード例 #1
0
ファイル: GroupsBrowserDlg.cs プロジェクト: perforce/P4VS
        private void groupGridP4ObjectTreeListView_BeforeExpand(object Sender, TreeListViewEventArgs args)
        {
            TreeListViewItem tlvi = args.Node;

            tlvi.ChildNodes.Clear();
            P4.Group group = Scm.GetGroup(tlvi.Name);

            if (group.UserNames != null)
            {
                foreach (string user in group.UserNames)
                {
                    TreeListViewItem groupMemeber = new TreeListViewItem();
                    groupMemeber.Name       = user;
                    groupMemeber.Text       = user;
                    groupMemeber.ImageIndex = 1;
                    tlvi.ChildNodes.Add(groupMemeber);
                }
            }

            if (group.SubGroups != null)
            {
                foreach (string subGroup in group.SubGroups)
                {
                    P4.Group         groupSpec    = new P4.Group(subGroup);
                    TreeListViewItem groupMemeber = new TreeListViewItem();
                    groupMemeber.Tag        = groupSpec;
                    groupMemeber.Name       = subGroup;
                    groupMemeber.Text       = subGroup;
                    groupMemeber.ImageIndex = 0;
                    groupMemeber.ChildNodes.Add(new TreeListViewItem());
                    groupMemeber.Collapse();
                    tlvi.ChildNodes.Add(groupMemeber);
                }
            }
        }