Beispiel #1
0
        public override string GetDetails(MultiboxFunctionParam args)
        {
            string pth     = AddHDIfNeeded(args, args.MC.LabelManager.CurrentSelection.FullText);
            long   sz      = GetFileSize(pth);
            string sizestr = FormatSizestr(sz);
            string typ     = GetTypeString(pth, sz);

            if (sz <= 0 && IsDrive(pth))
            {
                try
                {
                    foreach (Drive di in Filesystem.GetDrives())
                    {
                        if (!di.Name.Equals(pth))
                        {
                            continue;
                        }
                        sizestr = FormatSizestr(di.TotalSize - di.TotalFreeSpace) + " / " + FormatSizestr(di.TotalSize);
                        break;
                    }
                }
                catch { }
            }
            string lmd = "";

            try
            {
                DateTime lmddt = Filesystem.GetFileLastWriteTime(pth);
                lmd = lmddt.ToShortDateString() + " " + lmddt.ToLongTimeString();
            }
            catch { }
            return("Name: " + args.MC.LabelManager.CurrentSelection.DisplayText + "\nType: " + typ + "\nSize: " + sizestr + "\nLast Modified: " + lmd);
        }
Beispiel #2
0
 private static string[] DriveList(string fnd)
 {
     try
     {
         List <string> itms = new List <string>(0);
         itms.AddRange(from di in Filesystem.GetDrives() where string.IsNullOrEmpty(fnd) || di.Name.StartsWith(fnd) select di.Name);
         return(itms.ToArray());
     }
     catch {}
     return(null);
 }