XboxFile.Move has no IProgress

Apr 24, 2015 at 6:58 PM
Hi everyone :)

Just to letting you know, the XboxFile.Move method has no IProgress in it to track progress while moving a file.

I think it would be a great feature to add in future release since it takes the same amount of time to copy and move a file.

What I did... I added an overload for Move with the IProgress in it (based on XboxFile.Copy) and rebuilt the DLL and it works like a charm :)
        public static void Move(XboxPath sourceFile, string destinationFile, XboxConsole console, IProgress<XboxFileTransferMetric> metrics)
        {
            XboxConsoleEventSource.Logger.MethodCalled(XboxConsoleEventSource.GetCurrentMethod());

            if (sourceFile == null)
            {
                throw new ArgumentNullException("sourceFile");
            }
            if (XboxPath.HasXboxOrigin(sourceFile.FullName))
            {
                new XboxFileInfo(sourceFile, console).Copy(destinationFile, metrics);
                new XboxFileInfo(sourceFile, console).Delete();
            }
            else
            {
                throw new XboxConsoleFeatureNotSupportedException("The source XboxPath object does not contain a valid Xbox file path.");
            }
        }
Thanks!