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); }
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); }
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; }