Beispiel #1
0
 public FolderNodeProvider(IFileSystem fs, IPersister persister, IDependencyInjector dependencyInjector)
 {
     UploadFolderPaths = new FolderPair[0];
     this.fs = fs;
     this.persister = persister;
     this.dependencyInjector = dependencyInjector;
 }
Beispiel #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);
        }
Beispiel #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();
        }
Beispiel #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;
 }
		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();
		}
Beispiel #13
0
 private Directory CreateDirectory(FolderPair pair)
 {
     return(CreateDirectory(pair.Folder, fs, persister, dependencyInjector));
 }
 public FolderNodeProvider(IFileSystem fs, IPersister persister)
 {
     UploadFolderPaths = new FolderPair[0];
     this.fs = fs;
     this.persister = persister;
 }
Beispiel #15
0
		private Directory CreateDirectory(FolderPair pair)
		{
			return CreateDirectory(pair.Folder, fs, persister, dependencyInjector);
		}
Beispiel #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;
        }