public override Exceptional Execute(AGraphDSSharp myAGraphDSSharp, ref String myCurrentPath, Dictionary<String, List<AbstractCLIOption>> myOptions, String myInputString) { if (myAGraphDSSharp == null) return new Exceptional(new GraphDSError("myAGraphDSSharp must not be null!")); _CancelCommand = false; WriteLine(Environment.NewLine + "Used space on the following devices:" + Environment.NewLine); var Size = myAGraphDSSharp.GetNumberOfBytes(ObjectLocation.ParseString(FSPathConstants.PathDelimiter)); var UsedSize = myAGraphDSSharp.GetNumberOfBytes(ObjectLocation.ParseString(FSPathConstants.PathDelimiter)) - myAGraphDSSharp.GetNumberOfFreeBytes(ObjectLocation.ParseString(FSPathConstants.PathDelimiter)); var Procent = (((Double)UsedSize) / ((Double)Size)) * (Double)100; WriteLine("{0,-12} {1,15} ({2:0.#}%)", FSPathConstants.PathDelimiter, UsedSize.ToByteFormattedString(2), Procent); foreach (var _Mountpoint in myAGraphDSSharp.GetChildFileSystemMountpoints(true)) { Size = myAGraphDSSharp.GetNumberOfBytes(_Mountpoint); UsedSize = myAGraphDSSharp.GetNumberOfBytes(_Mountpoint) - myAGraphDSSharp.GetNumberOfFreeBytes(_Mountpoint); Procent = (((Double)UsedSize) / ((Double)Size)) * (Double)100; WriteLine("{0,-12} {1,15} ({2:0.#}%)", _Mountpoint, UsedSize.ToByteFormattedString(2), Procent); } WriteLine(Environment.NewLine); return Exceptional.OK; }
public override Exceptional Execute(AGraphDSSharp myAGraphDSSharp, ref String myCurrentPath, Dictionary<String, List<AbstractCLIOption>> myOptions, String myInputString) { if (myAGraphDSSharp == null) return new Exceptional(new GraphDSError("myAGraphDSSharp must not be null!")); _CancelCommand = false; WriteLine(Environment.NewLine + "Total disc size of the following devices:" + Environment.NewLine); var Size = myAGraphDSSharp.GetNumberOfBytes(ObjectLocation.Root); WriteLine("{0,-12} {1,15} Bytes", FSPathConstants.PathDelimiter, Size.ToByteFormattedString(2)); foreach (var _Mountpoint in myAGraphDSSharp.GetChildFileSystemMountpoints(true)) { Size = myAGraphDSSharp.GetNumberOfBytes(_Mountpoint); WriteLine("{0,-12} {1,15} ", _Mountpoint, Size.ToByteFormattedString(2)); } WriteLine(Environment.NewLine); return Exceptional.OK; }