示例#1
0
        private void ExcludeChanges(IFileStatusEntry fileStatusEntry)
        {
            Logger.Trace("Adding file {0} to excluded changes", fileStatusEntry.FilePath);
            ExcludedChanges.Add(fileStatusEntry);

            RefreshView();
        }
        private void IncludeChanges(IFileStatusEntry fileStatusEntry)
        {
            if (UntrackedFiles.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath) != null)
            {
                Provider.AddFile(fileStatusEntry.FilePath);
            }
            else
            {
                ExcludedChanges.Remove(ExcludedChanges.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath));
            }

            RefreshView();
        }
示例#3
0
        private void IncludeChanges(IFileStatusEntry fileStatusEntry)
        {
            if (UntrackedFiles.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath) != null)
            {
                Logger.Trace("Tracking file {0}", fileStatusEntry.FilePath);
                Provider.AddFile(fileStatusEntry.FilePath);
            }
            else
            {
                Logger.Trace("Removing file {0} from excluded changes", fileStatusEntry.FilePath);
                ExcludedChanges.Remove(ExcludedChanges.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath));
            }

            RefreshView();
        }
        public void RefreshView()
        {
            OnPropertyChanged("CurrentBranch");

            IncludedChanges = Provider == null
                ? new ObservableCollection <IFileStatusEntry>()
                : new ObservableCollection <IFileStatusEntry>(
                Provider.Status()
                .Where(
                    stat =>
                    (stat.FileStatus.HasFlag(FileStatus.Modified) ||
                     stat.FileStatus.HasFlag(FileStatus.Added) ||
                     stat.FileStatus.HasFlag(FileStatus.Removed) ||
                     stat.FileStatus.HasFlag(FileStatus.RenamedInIndex) ||
                     stat.FileStatus.HasFlag(FileStatus.RenamedInWorkDir)) &&
                    !ExcludedChanges.Select(f => f.FilePath).Contains(stat.FilePath)));

            UntrackedFiles = Provider == null
                ? new ObservableCollection <IFileStatusEntry>()
                : new ObservableCollection <IFileStatusEntry>(
                Provider.Status().Where(stat => stat.FileStatus.HasFlag(FileStatus.Untracked)));
        }
        private void ExcludeChanges(IFileStatusEntry fileStatusEntry)
        {
            ExcludedChanges.Add(fileStatusEntry);

            RefreshView();
        }