Beispiel #1
0
 protected ElementNode(FsDataStorage storage, StoragePath path, FolderNode?parent)
 {
     Storage    = storage;
     Parent     = parent;
     Path       = path.FullPath;
     ModifiedOn = CreatedOn = DateTimeOffset.Now;
 }
Beispiel #2
0
        public static FileNode Create(FsDataStorage storage, StoragePath path)
        {
            var parentNode = storage.GetParentNodeAndRequirePathToHaveParent(path);
            var node       = new FileNode(storage, path, parentNode);

            storage.RegisterNode(node);
            parentNode.RegisterChildNode(node);
            return(node);
        }
Beispiel #3
0
        public static FolderNode Create(FsDataStorage storage, StoragePath path)
        {
            var parentNode = storage.GetParentNode(path);
            var node       = new FolderNode(storage, path, parentNode);

            storage.RegisterNode(node);
            parentNode?.RegisterChildNode(node);
            return(node);
        }
Beispiel #4
0
 private FileNode(FsDataStorage storage, StoragePath path, FolderNode parent)
     : base(storage, path, parent)
 {
     Content    = new FileContent(ownerFileNode: this);
     Attributes = FileAttributes.Normal;
 }
Beispiel #5
0
 private FolderNode(FsDataStorage storage, StoragePath path, FolderNode?parent)
     : base(storage, path, parent)
 {
     Attributes = FileAttributes.Directory | FileAttributes.Normal;
 }