コード例 #1
0
 ConflictItem[] RefreshDirectories(DirectoryInfo directoryInfo, string subPath)
 {
     return(directoryInfo.SafeGetDirectories()
            .Where(n => Show(n.Attributes))
            .OrderBy(n => n.Name)
            .Select(n => ConflictItem.CreateConflictDirectoryItem(n.Name, CombineSubPath(subPath, directoryInfo.Name))).ToArray());
 }
コード例 #2
0
        void ExtractSubItems(Item[] items, CancellationToken cancellationToken)
        {
            try
            {
                operationItems.Clear();
                foreach (var item in items.Where(n => n.Kind == Kind.File))
                {
                    if (cancellationToken.IsCancellationRequested)
                    {
                        throw new CancelledException();
                    }
                    operationItems.Add(ConflictItem.CreateConflictFileItem(item));
                }
                var dirs = items.Where(n => n.Kind == Kind.Directory).Select(n => ConflictItem.CreateConflictDirectoryItem(n.Name, null));
                foreach (var item in dirs)
                {
                    var odi = ConflictItem.CreateConflictDirectoryItem(item.Name, null);

                    sourceProcessor.ExtractSubItems(operationItems, odi, cancellationToken);
                }
            }
            catch (CancelledException)
            {
                throw;
            }
            catch (Exception e)
            {
                var var = e;
            }
        }
コード例 #3
0
 void TakeItems(Item[] items, CancellationToken cancellationToken)
 {
     operationItems.Clear();
     foreach (var item in items.Where(n => n.Kind == Kind.Directory))
     {
         if (cancellationToken.IsCancellationRequested)
         {
             throw new CancelledException();
         }
         operationItems.Add(ConflictItem.CreateConflictDirectoryItem(item.Name, null));
     }
     foreach (var item in items.Where(n => n.Kind == Kind.File))
     {
         if (cancellationToken.IsCancellationRequested)
         {
             throw new CancelledException();
         }
         operationItems.Add(ConflictItem.CreateConflictFileItem(item));
     }
 }