private static Transmission LoadFromTransmissionFile(IPlatformFile file, out long fileSize)
        {
            ChangeFileExtension(file, TemporaryFileExtension);
            Transmission transmission = LoadFromTemporaryFile(file, out fileSize);

            file.Delete();
            return(transmission);
        }
        private static Transmission LoadFromTransmissionFile(IPlatformFile file, out long fileSize)
        {
            fileSize = 0;
            Transmission transmission = null;

            if (file.Exists)
            {
                // The ingestion service rejects anything older than 2 days.
                if (file.DateCreated > DateTimeOffset.Now.AddDays(-2))
                {
                    ChangeFileExtension(file, TemporaryFileExtension);
                    transmission = LoadFromTemporaryFile(file, out fileSize);
                }
                else
                {
                    TelemetryChannelEventSource.Log.TransmissionStorageFileExpired(file.Name, file.DateCreated.ToString(CultureInfo.InvariantCulture));
                }

                file.Delete();
            }

            return(transmission);
        }
 private static Transmission LoadFromTransmissionFile(IPlatformFile file, out long fileSize)
 {
     ChangeFileExtension(file, TemporaryFileExtension);
     Transmission transmission = LoadFromTemporaryFile(file, out fileSize);
     file.Delete();
     return transmission;
 }