Пример #1
0
        /// <summary>
        /// Determines whether the solution is git TFS controlled.
        /// </summary>
        /// <returns>
        /// <c>true</c> if the solution is git TFS controlled.
        /// </returns>
        private bool IsSolutionGitTfsControlled()
        {
            var repositoryDirectory = GitFileStatusTracker.GetRepositoryDirectory(this.GetSolutionDirectory());

            if (!string.IsNullOrEmpty(repositoryDirectory))
            {
                var expectedGitTfsDirectory = repositoryDirectory + "\\.git\\tfs";
                return(Directory.Exists(expectedGitTfsDirectory));
            }

            return(false);
        }
Пример #2
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                this.Activate();

                var dropped = ((string[])e.Data.GetData(DataFormats.FileDrop, true))[0];

                if (!Directory.Exists(dropped))
                {
                    dropped = Path.GetDirectoryName(dropped);
                }
                var gitWorkingFolder = GitFileStatusTracker.GetRepositoryDirectory(dropped);
                if (Directory.Exists(dropped) && gitWorkingFolder != null &&
                    MessageBox.Show("Do you want to open Git repository from " + gitWorkingFolder,
                                    "Git repository found", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    this.OpenRepository(dropped);
                }
            }
        }
Пример #3
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                this.Activate();

                var dropped = ((string[])e.Data.GetData(DataFormats.FileDrop, true))[0];

                if (!Directory.Exists(dropped))
                {
                    dropped = Path.GetDirectoryName(dropped);
                }
                var gitWorkingFolder = GitFileStatusTracker.GetRepositoryDirectory(dropped);
                if (Directory.Exists(dropped) && gitWorkingFolder != null &&
                    MessageBox.Show("Do you want to open Git repository from " + gitWorkingFolder,
                                    "Git repository found", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    HistoryViewCommands.CloseCommitDetails.Execute(null, this);
                    HistoryViewCommands.CloseCommitDetails.Execute("PendingChanges", this);
                    this.gitViewModel.Open(dropped);
                    this.gitViewModel.Refresh(true);
                }
            }
        }