예제 #1
0
        public void DisposeMountPoint(IMountPoint mountPoint)
        {
            FileSystemMountPoint mp = mountPoint as FileSystemMountPoint;

            if (mp?.Parent != null)
            {
                mp.EnvironmentSettings.SettingsLoader.ReleaseMountPoint(mp.Parent);
            }
        }
예제 #2
0
        public bool TryMount(IMountPointManager manager, MountPointInfo info, out IMountPoint mountPoint)
        {
            if (info.ParentMountPointId != Guid.Empty || !Directory.Exists(info.Place))
            {
                mountPoint = null;
                return(false);
            }

            mountPoint = new FileSystemMountPoint(manager.EnvironmentSettings, info);
            return(true);
        }
예제 #3
0
        public bool TryMount(IEngineEnvironmentSettings environmentSettings, IMountPoint parent, string place, out IMountPoint mountPoint)
        {
            if (parent != null || !Directory.Exists(place))
            {
                mountPoint = null;
                return(false);
            }

            Guid           mountPointId = Guid.NewGuid();
            MountPointInfo info         = new MountPointInfo(Guid.Empty, Id, mountPointId, place);

            mountPoint = new FileSystemMountPoint(environmentSettings, info);
            return(true);
        }
        bool IMountPointFactory.TryMount(IEngineEnvironmentSettings environmentSettings, IMountPoint?parent, string mountPointUri, out IMountPoint?mountPoint)
        {
            if (!Uri.TryCreate(mountPointUri, UriKind.Absolute, out var uri))
            {
                mountPoint = null;
                return(false);
            }

            if (!uri.IsFile)
            {
                mountPoint = null;
                return(false);
            }

            if (parent != null || !environmentSettings.Host.FileSystem.DirectoryExists(uri.LocalPath))
            {
                mountPoint = null;
                return(false);
            }

            mountPoint = new FileSystemMountPoint(environmentSettings, parent, mountPointUri, uri.LocalPath);
            return(true);
        }