Exemplo n.º 1
0
        public FolderTreeItemsGrouping <T> MergeItems <TU>(FolderTreeItemsGrouping <TU> grp)
        {
            if (grp._files != null)
            {
                foreach (var pair in grp._files.Where(pair => _files.ContainsKey(pair.Key) == false))
                {
                    AddFile(pair.Value);
                }
            }

            if (grp._folders == null)
            {
                return(this);
            }

            foreach (var pair in grp._folders.Where(pair => _folders.ContainsKey(pair.Key) == false))
            {
                AddFolder(pair.Value);
            }

            return(this);
        }
Exemplo n.º 2
0
        private FolderTreeItemsGrouping(FolderTreeItemsGrouping <T> itemsGroup)
        {
            Key = itemsGroup.Key;

            if (itemsGroup._files != null)
            {
                _files = new Dictionary <string, FileItem>();

                foreach (var pair in itemsGroup._files)
                {
                    _files.Add(pair.Key, pair.Value);
                }
            }

            if (itemsGroup._folders != null)
            {
                _folders = new Dictionary <string, FolderItem>();

                foreach (var pair in itemsGroup._folders)
                {
                    _folders.Add(pair.Key, pair.Value);
                }
            }

            if (itemsGroup._parentFolders == null)
            {
                return;
            }

            _parentFolders = new Dictionary <string, FolderItem>();

            foreach (var pair in itemsGroup._parentFolders)
            {
                _parentFolders.Add(pair.Key, pair.Value);
            }
        }
Exemplo n.º 3
0
 public static FolderTreeItemsGrouping <T> CreateCopy(FolderTreeItemsGrouping <T> itemsGroup)
 {
     return(new FolderTreeItemsGrouping <T>(itemsGroup));
 }