public DateTimeFixedCorrection(FileDatabase fileDatabase, ImageRow fileToDisplay, Window owner)
        {
            this.InitializeComponent();
            this.displayingPreview = false;
            this.fileDatabase = fileDatabase;
            this.fileToDisplay = fileToDisplay;
            this.Owner = owner;

            // get the image filename and display it
            this.FileName.Content = fileToDisplay.FileName;
            this.FileName.ToolTip = this.FileName.Content;

            // configure datetime picker
            this.initialDateTime = fileToDisplay.GetDateTime();
            this.OriginalDate.Content = DateTimeHandler.ToDisplayDateTimeString(this.initialDateTime);
            this.DateTimePicker.Value = this.initialDateTime;
            this.DateTimePicker.ValueChanged += this.DateTimePicker_ValueChanged;
        }
コード例 #2
0
        public DateTimeSetTimeZone(FileDatabase fileDatabase, ImageRow fileToDisplay, Window owner)
        {
            this.InitializeComponent();
            this.displayingPreview = false;
            this.fileDatabase = fileDatabase;
            this.fileToDisplay = fileToDisplay;
            this.Owner = owner;

            // get the file's current time
            DateTimeOffset currentDateTime = fileToDisplay.GetDateTime();
            this.OriginalDate.Content = DateTimeHandler.ToDisplayDateTimeUtcOffsetString(currentDateTime);

            // get the filename and display it
            this.FileName.Content = fileToDisplay.FileName;

            // configure timezone picker
            this.TimeZones.SelectTimeZone(this.fileDatabase.ImageSet.GetTimeZone());
            this.TimeZones.SelectionChanged += this.TimeZones_SelectionChanged;
        }
コード例 #3
0
        public void Verify(ImageRow file, TimeZoneInfo timeZone)
        {
            // this.DarkPixelFraction isn't applicable
            Assert.IsTrue(file.DateTime.Kind == DateTimeKind.Utc);
            Assert.IsTrue(file.DeleteFlag == this.DeleteFlag);
            Assert.IsTrue(file.FileName == this.FileName, "{0}: Expected FileName '{1}' but found '{2}'.", this.FileName, this.FileName, file.FileName);
            Assert.IsTrue(file.ID == this.ID, "{0}: Expected ID '{1}' but found '{2}'.", this.FileName, this.ID, file.ID);
            Assert.IsTrue(file.ImageQuality == this.Quality, "{0}: Expected ImageQuality '{1}' but found '{2}'.", this.FileName, this.Quality, file.ImageQuality);
            // this.IsColor isn't applicable
            Assert.IsTrue(file.RelativePath == this.RelativePath, "{0}: Expected RelativePath '{1}' but found '{2}'.", this.FileName, this.RelativePath, file.RelativePath);
            // this.UserDefinedColumnsByDataLabel isn't current applicable

            // bypass checking of Date and Time properties if requested, for example if the camera didn't generate image taken metadata
            if (this.SkipDateTimeVerification == false)
            {
                DateTimeOffset imageDateTime = file.GetDateTime();
                DateTimeOffset expectedDateTime = this.ConvertDateTimeToTimeZone(timeZone);
                Assert.IsTrue(imageDateTime.UtcDateTime == expectedDateTime.UtcDateTime, "{0}: Expected date time '{1}' but found '{2}'.", this.FileName, DateTimeHandler.ToDatabaseDateTimeString(expectedDateTime), DateTimeHandler.ToDatabaseDateTimeString(imageDateTime.UtcDateTime));
                Assert.IsTrue(imageDateTime.Offset == expectedDateTime.Offset, "{0}: Expected date time offset '{1}' but found '{2}'.", this.FileName, expectedDateTime.Offset, imageDateTime.Offset);
                Assert.IsTrue(file.DateTime == expectedDateTime.UtcDateTime, "{0}: Expected DateTime '{1}' but found '{2}'.", this.FileName, DateTimeHandler.ToDatabaseDateTimeString(expectedDateTime), DateTimeHandler.ToDatabaseDateTimeString(file.DateTime));
                Assert.IsTrue(file.UtcOffset == expectedDateTime.Offset, "{0}: Expected UtcOffset '{1}' but found '{2}'.", this.FileName, expectedDateTime.Offset, file.UtcOffset);
            }
        }