示例#1
0
        /// <summary>
        /// Parse data into human-readable format, if possible
        /// </summary>
        private void ParseData()
        {
            switch (Type.ToString())
            {
            case "IHDR":
                ParsedData = new ParsedIHDR(data);
                break;

            case "gAMA":
                ParsedData = new ParsedGAMA(data);
                break;

            case "tEXt":
                ParsedData = new ParsedTEXT(data);
                break;

            case "iTXt":
                ParsedData = new ParsedITXT(data);
                break;

            case "tIME":
                ParsedData = new ParsedTIME(data);
                break;

            default:
                break;
            }
        }
示例#2
0
        private void btnSetDateNow_Click(object sender, RoutedEventArgs e)
        {
            ParsedTIME timeChunk = this.DataContext as ParsedTIME;

            if (timeChunk != null) // It really shouldn't be, but might as well check
            {
                timeChunk.Time   = DateTime.Now;
                this.DataContext = null;        // This is to update the view
                this.DataContext = timeChunk;   // There's probably a more elegant way but w/e this works
            }
        }