コード例 #1
0
        /// <summary>
        /// Unmount a bundle.
        /// </summary>
        /// <param name="bundle"></param>
        public void UnmountBundle(VfsBundle bundle)
        {
            if (!Bundles.Exists(b => b.ID == bundle.ID))
            {
                throw new Exception($"Bundle [{bundle.ID}] is not mounted to [{Path}].");
            }

            UnmountBundle(bundle.ID);
        }
コード例 #2
0
        /// <summary>
        /// Mount a bundle.
        /// </summary>
        /// <param name="bundle"></param>
        public void MountBundle(VfsBundle bundle)
        {
            if (Bundles.Exists(b => b.ID == bundle.ID))
            {
                throw new Exception($"Bundle [{bundle.ID}] is already mounted to [{Path}].");
            }

            Bundles.Add(bundle);
        }
コード例 #3
0
        /// <summary>
        /// Unmount a bundle.
        /// </summary>
        /// <param name="bundleId"></param>
        public void UnmountBundle(Guid bundleId)
        {
            if (!Bundles.Exists(b => b.ID == bundleId))
            {
                throw new Exception($"Bundle [{bundleId}] is not mounted to [{Path}].");
            }

            Bundles.Remove(Bundles.Find(b => b.ID == bundleId));
        }
コード例 #4
0
ファイル: VfsBundle.cs プロジェクト: nfs-tools/LibOpenNFS
        /// <summary>
        /// Mount a bundle to the bundle. Yes, seriously.
        /// </summary>
        /// <param name="bundle"></param>
        public VfsBundle MountBundle(VfsBundle bundle)
        {
            if (Bundles.Exists(b => b.ID == bundle.ID))
            {
                throw new Exception($"Bundle [{bundle.ID}] is already mounted to bundle {Name}.");
            }

            Bundles.Add(bundle);

            return(Bundles.Find(b => b.ID == bundle.ID));
        }