Esempio n. 1
0
        public GroupsBrowserDlg(P4ScmProvider scm, string sender)
        {
            PreferenceKey = "GroupsBrowserDlg";

            Scm = scm;
            InitializeComponent();

            if (components == null)
            {
                components = new Container();
            }
            this.Icon = Images.icon_p4vs_16px;

            imageList1 = new System.Windows.Forms.ImageList(components);

            //
            // imageList1
            //
            imageList1.TransparentColor = System.Drawing.Color.Transparent;
            imageList1.Images.Add("groups_icon.png", Images.groups_icon);
            imageList1.Images.Add("users_icon.png", Images.users_icon);

            this.groupGridP4ObjectTreeListView.LargeImageList = this.imageList1;
            this.groupGridP4ObjectTreeListView.SmallImageList = this.imageList1;

            if (Scm != null)
            {
                IList <P4.Group> groups = Scm.GetGroups(null, null);
                foreach (P4.Group group in groups)
                {
                    string           id   = group.Id;
                    TreeListViewItem tlvi = new TreeListViewItem();
                    tlvi.Name = id;
                    tlvi.Text = id;
                    tlvi.ChildNodes.Add(new TreeListViewItem());
                    tlvi.Collapse();
                    tlvi.Tag        = group;
                    tlvi.ImageIndex = 0;
                    groupGridP4ObjectTreeListView.Items.Add(tlvi);
                }
            }
            ClosedByDoubleClick = false;
        }