예제 #1
0
        public void ShowPendingCheckinsDialog()
        {
            List<string> fileNamesToShow = new List<string>();
            string[] files = _agsEditor.GetFilesThatCanBePutUnderSourceControl();
            SourceControlFileStatus[] fileStatuses = _agsEditor.SourceControlProvider.GetFileStatuses(files);
            for (int i = 0; i < files.Length; i++)
            {
                if (((fileStatuses[i] == SourceControlFileStatus.NotControlled) ||
                    ((fileStatuses[i] & SourceControlFileStatus.Deleted) != 0) ||
                    ((fileStatuses[i] & SourceControlFileStatus.CheckedOutByMe) != 0)) &&
                    (fileStatuses[i] != SourceControlFileStatus.Invalid))
                {
                    fileNamesToShow.Add(files[i]);
                }
            }

            CheckinsDialog dialog = new CheckinsDialog("Pending Checkins", "Check in", fileNamesToShow.ToArray());
            dialog.ShowDialog();
            string[] selectedFiles = dialog.SelectedFiles;
            string checkinComments = dialog.Comments;
            dialog.Dispose();

            if (selectedFiles != null)
            {
                CheckInOrAddFiles(selectedFiles, checkinComments);
            }
        }
예제 #2
0
 public bool ShowCheckOutDialog(List<string> fileNames)
 {
     bool checkedOut = false;
     CheckinsDialog dialog = new CheckinsDialog("Check Out", "Check out", fileNames.ToArray());
     dialog.ShowDialog();
     if (dialog.SelectedFiles != null)
     {
         try
         {
             _agsEditor.SourceControlProvider.CheckOutFiles(dialog.SelectedFiles, dialog.Comments);
             checkedOut = (dialog.SelectedFiles.Length == fileNames.Count);
         }
         catch (SourceControlException ex)
         {
             this.ShowMessage("Checkout failed: " + ex.SccErrorMessage, MessageBoxIcon.Warning);
             checkedOut = false;
         }
     }
     dialog.Dispose();
     return checkedOut;
 }