示例#1
0
 public FolderNodeProvider(IFileSystem fs, IPersister persister, IDependencyInjector dependencyInjector)
 {
     UploadFolderPaths = new FolderPair[0];
     this.fs = fs;
     this.persister = persister;
     this.dependencyInjector = dependencyInjector;
 }
示例#2
0
        private Directory CreateDirectory(FolderPair pair)
        {
            var dd     = fs.GetDirectoryOrVirtual(pair.FolderPath);
            var parent = persister.Get(pair.ParentID);

            var dir = Directory.New(dd, parent, dependencyInjector);

            dir.Title = pair.Path.Substring(pair.ParentPath.Length).Trim('/');
            dir.Name  = dir.Title;

            return(dir);
        }
示例#3
0
            private Directory CreateDirectory(FolderPair pair)
            {
                var dd     = fs.GetDirectory(pair.FolderPath);
                var parent = persister.Get(pair.ParentID);

                var dir = new Directory(dd, parent);

                dir.Set(fs);
                dir.Title = pair.Path.Substring(pair.ParentPath.Length).Trim('/');
                dir.Name  = dir.Title;

                return(dir);
            }
        private FolderPair[] GetUploadFolderPaths()
        {
            var paths = new List <FolderPair>();

            // configured folders to the root node
            foreach (var folder in folderSource.GetUploadFoldersForAllSites())
            {
                var parent = persister.Get(folder.GetParentID());
                var pair   = new FolderPair(parent.ID, parent.Path, parent.Path + folder.GetName() + "/", folder);
                paths.Add(pair);
            }

            return(paths.ToArray());
        }
        private FolderPair[] GetUploadFolderPaths()
        {
            var paths = new List <FolderPair>();

            // configured folders to the root node
            foreach (FolderElement folder in folders)
            {
                var root = persister.Get(host.DefaultSite.RootItemID);
                var pair = new FolderPair(root.ID, root.Path, folder.Path.TrimStart('~'), folder.Path);
                paths.Add(pair);
            }
            // site-upload folders to their respective nodes
            paths.AddRange(UploadFoldersForSite(host.DefaultSite));
            foreach (var site in host.Sites)
            {
                paths.AddRange(UploadFoldersForSite(site));
            }

            return(paths.ToArray());
        }
        private FolderPair[] GetUploadFolderPaths()
        {
            var paths = new List<FolderPair>();

            // configured folders to the root node
            foreach (FolderElement folder in folders)
            {
                var root = persister.Get(host.DefaultSite.RootItemID);
                var pair = new FolderPair(root.ID, root.Path, folder.Path.TrimStart('~'), folder.Path);
                paths.Add(pair);
            }
            // site-upload folders to their respective nodes
            paths.AddRange(UploadFoldersForSite(host.DefaultSite));
            foreach (var site in host.Sites)
            {
                paths.AddRange(UploadFoldersForSite(site));
            }

            return paths.ToArray();
        }
示例#7
0
 private Directory CreateDirectory(FolderPair pair)
 {
     return(CreateDirectory(pair.Folder, fs, repository, dependencyInjector));
 }
		private FolderPair[] GetUploadFolderPaths()
		{
			var paths = new List<FolderPair>();

			if (folderSource == null)
				throw new NullReferenceException("folderSource is null");
				//return new FolderPair[0];
			
			var gpp = new List<FileSystemRoot>(folderSource.GetUploadFoldersForAllSites()); // non-lazy easier to debug :-)

			if (gpp == null)
				throw new NullReferenceException("folderSource.GetUploadFoldersForAllSites() returned null");

			// configured folders to the root node
			foreach (var folder in gpp)
			{
				var parent = persister.Get(folder.GetParentID());
				if (parent == null)
					break;

				var pair = new FolderPair(parent.ID, parent.Path, parent.Path + folder.GetName() + "/", folder);
				paths.Add(pair);
			}

			return paths.ToArray();
		}
		private Directory CreateDirectory(FolderPair pair)
		{
			return CreateDirectory(pair.Folder, fs, repository, dependencyInjector);
		}
            private Directory CreateDirectory(FolderPair pair)
            {
                var dd = fs.GetDirectory(pair.FolderPath);
                var parent = persister.Get(pair.ParentID);

                var dir = Directory.New(dd, parent, fs, imageSizes);
                dir.Title = pair.Path.Substring(pair.ParentPath.Length).Trim('/');
                dir.Name = dir.Title;

                return dir;
            }
 public FolderNodeProvider(IFileSystem fs, IPersister persister, ImageSizeCache imageSizes)
 {
     UploadFolderPaths = new FolderPair[0];
     this.fs = fs;
     this.persister = persister;
     this.imageSizes = imageSizes;
 }
示例#12
0
		private FolderPair[] GetUploadFolderPaths()
		{
			var paths = new List<FolderPair>();

			// configured folders to the root node
			foreach (var folder in folderSource.GetUploadFoldersForAllSites())
			{
				var parent = persister.Get(folder.GetParentID());
				if (parent == null)
					break;

				var pair = new FolderPair(parent.ID, parent.Path, parent.Path + folder.GetName() + "/", folder);
				paths.Add(pair);
			}

			return paths.ToArray();
		}
示例#13
0
 private Directory CreateDirectory(FolderPair pair)
 {
     return(CreateDirectory(pair.Folder, fs, persister, dependencyInjector));
 }
示例#14
0
 public FolderNodeProvider(IFileSystem fs, IPersister persister)
 {
     UploadFolderPaths = new FolderPair[0];
     this.fs = fs;
     this.persister = persister;
 }
示例#15
0
		private Directory CreateDirectory(FolderPair pair)
		{
			return CreateDirectory(pair.Folder, fs, persister, dependencyInjector);
		}
示例#16
0
        private Directory CreateDirectory(FolderPair pair)
        {
            var dd = fs.GetDirectoryOrVirtual(pair.FolderPath);
            var parent = persister.Get(pair.ParentID);

            var dir = Directory.New(dd, parent, dependencyInjector);
            dir.Title = pair.Path.Substring(pair.ParentPath.Length).Trim('/');
            dir.Name = dir.Title;

            return dir;
        }