Ejemplo n.º 1
0
		public FolderReference(int parentID, string parentPath, string path, FileSystemRoot folder)
		{
			ParentID = parentID;
			Path = path;
			ParentPath = parentPath;
			Folder = folder;
		}
		internal static Directory CreateDirectory(FileSystemRoot folder, IFileSystem fs, IRepository<ContentItem> persister, IDependencyInjector dependencyInjector)
		{
			var dd = fs.GetDirectoryOrVirtual(folder.Path);
			var parent = persister.Get(folder.GetParentID());

			var dir = Directory.New(dd, parent, dependencyInjector);
			dir.Name = folder.GetName();
			dir.Title = folder.Title ?? dir.Name;
			dir.UrlPrefix = folder.UrlPrefix;

			Apply(folder.Readers, dir);
			Apply(folder.Writers, dir);

			return dir;
		}