GetFileList() public method

public GetFileList ( ) : List
return List
コード例 #1
0
ファイル: FunctionList.cs プロジェクト: erendrake/kRISC
        private kList GetFileList(SharedObjects shared)
        {
            kList list = new kList();

            list.AddColumn("Name", 30, ColumnAlignment.Left);
            list.AddColumn("Size", 7, ColumnAlignment.Right);

            if (shared.VolumeMgr != null)
            {
                Volume volume = shared.VolumeMgr.CurrentVolume;
                if (volume != null)
                {
                    list.Title = "Volume " + shared.VolumeMgr.GetVolumeBestIdentifier(volume);

                    foreach (FileInfo info in volume.GetFileList())
                    {
                        list.AddItem(info.Name, info.Size);
                    }

                    int freeSpace = volume.GetFreeSpace();
                    list.Footer = "Free space remaining: " + (freeSpace > -1 ? freeSpace.ToString() : " infinite");
                }
            }

            return(list);
        }