Beispiel #1
0
        public FileAttributesDlg(P4ScmProvider scm)
        {
            _scm = scm;

            InitializeComponent();
            this.Icon = Images.icon_p4vs_16px;
            BaseTypeCB.Items.Clear();

            //P4VsOutputWindow.AppendMessage("Server version: {0}", _scm.ServerVersion.ToString());

            BaseTypeCB.Items.Add(P4.BaseFileType.Text);
            BaseTypeCB.Items.Add(P4.BaseFileType.Binary);
            BaseTypeCB.Items.Add(P4.BaseFileType.Symlink);
            BaseTypeCB.Items.Add(P4.BaseFileType.Apple);
            BaseTypeCB.Items.Add(P4.BaseFileType.Resource);
            BaseTypeCB.Items.Add(P4.BaseFileType.Unicode);
            BaseTypeCB.Items.Add(P4.BaseFileType.UTF16);
            if (_scm.ServerVersion >= Versions.V15_2)
            {
                BaseTypeCB.Items.Add(P4.BaseFileType.UTF8);
            }

            MaxRevsCB.Items.Clear();

            MaxRevsCB.Items.Add(1);
            MaxRevsCB.Items.Add(2);
            MaxRevsCB.Items.Add(3);
            MaxRevsCB.Items.Add(4);
            MaxRevsCB.Items.Add(5);
            MaxRevsCB.Items.Add(6);
            MaxRevsCB.Items.Add(7);
            MaxRevsCB.Items.Add(8);
            MaxRevsCB.Items.Add(9);
            MaxRevsCB.Items.Add(10);
            MaxRevsCB.Items.Add(16);
            MaxRevsCB.Items.Add(32);
            MaxRevsCB.Items.Add(64);
            MaxRevsCB.Items.Add(128);
            MaxRevsCB.Items.Add(256);
            MaxRevsCB.Items.Add(512);

            IList <P4.Changelist> changelists = _scm.GetAvailibleChangelists(-1);

            TargetChangeListCB.Items.Clear();

            TargetChangeListCB.Items.Add(Resources.Changelist_New);
            TargetChangeListCB.Items.Add(Resources.Changelist_Default);

            if (changelists != null)
            {
                foreach (P4.Changelist change in changelists)
                {
                    TargetChangeListCB.Items.Add(new ChangelistItem(change));
                }
            }
        }
Beispiel #2
0
        public UnshelveFileDialog(P4ScmProvider scm)
        {
            PreferenceKey = "UnshelveFileDialog";

            _scm = scm;
            InitializeComponent();
            this.Icon  = Images.icon_p4vs_16px;
            ListImages = new System.Windows.Forms.ImageList(components);
            //
            // ListImages
            //
            ListImages.TransparentColor = System.Drawing.Color.Transparent;
            ListImages.Images.Add("noCheckBox.png", Images.noCheckBox);
            ListImages.Images.Add("CheckBox.png", Images.CheckBox);

            ShelvedFilesLV.SmallImageList     = ListImages;
            ShelvedFilesLV.ListViewItemSorter = (System.Collections.IComparer) new FileListViewSorter();

            IList <P4.Changelist> changes = _scm.GetAvailibleChangelists(-1);

            changeMap = new Dictionary <int, P4.Changelist>();

            //add new as the first item in the list
            TargetChangelistCB.Items.Add(Resources.Changelist_New);
            changeMap[-1] = null;

            //add default as the first item in the list if not already there
            TargetChangelistCB.Items.Add(Resources.Changelist_Default);
            changeMap[0] = null;

            // if there are other existing changelists, add them to the list
            if (changes != null)
            {
                foreach (P4.Changelist item in changes)
                {
                    int id = item.Id;
                    if ((id != -1) && (id != 0))
                    {
                        changeMap[id] = item;
                        int idx = TargetChangelistCB.Items.Add(SelectChangelistDlg.ChangeListToString(item));
                    }
                }
            }

            // select the default changelist
            TargetChangelistCB.SelectedIndex = 1;
        }