示例#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;
                }
            }

            return(sum);
        }
示例#2
0
 public void Refresh()
 {
     // TODO: Figure out a way to update space nicely WITHOUT rewalking everything
     _available = _root.CalculateSize();
 }