コード例 #1
0
        internal long CalculateSize()
        {
            long sum = 0;

            foreach (IMediaItem item in _items)
            {
                MediaFolder folder = item as MediaFolder;
                if (folder != null)
                {
                    sum += folder.CalculateSize();
                }
                else
                {
                    MediaFile file = item as MediaFile;
                    sum += file.Length;
                }
            }

            _totalSize = sum;
            return(sum);
        }
コード例 #2
0
ファイル: UmdDevice.cs プロジェクト: mattweb28/pspplayer
        public bool Load(string path, bool minimalCache)
        {
            _hostPath = path;

            FileInfo fi = new FileInfo(path);

            _capacity = fi.Length;

            _lbnLookup.Clear();

            _root = ParseIsoFileSystem(path, minimalCache);
            Debug.Assert(_root != null);
            _root.CalculateSize();

            // Would be nice to do something with this that was official-like (serial number?)
            _description = string.Format("UMD ({0}MB)",
                                         _capacity / 1024 / 1024);

            _state = MediaState.Present;

            return(true);
        }
コード例 #3
0
ファイル: UmdDevice.cs プロジェクト: BradFuller/pspplayer
        public bool Load( string path, bool minimalCache )
        {
            _hostPath = path;

            FileInfo fi = new FileInfo( path );
            _capacity = fi.Length;

            _lbnLookup.Clear();

            _root = ParseIsoFileSystem( path, minimalCache );
            Debug.Assert( _root != null );
            _root.CalculateSize();

            // Would be nice to do something with this that was official-like (serial number?)
            _description = string.Format( "UMD ({0}MB)",
                _capacity / 1024 / 1024 );

            _state = MediaState.Present;

            return true;
        }