示例#1
0
        private void Input_ValueChanged(object sender, EventArgs e)
        {
            if (Working)
            {
                return;
            }

            try
            {
                Working = true;

                DateTime gameMasterTimestamp = TimestampUtils.TicksToDateTime(numberBox.Value);
                DateTime fileTimestamp       = maskedDateTimePicker.Value;
                TimeSpan difference          = gameMasterTimestamp - fileTimestamp;

                StringBuilder stringBuilder = new StringBuilder("new Mangle(");
                stringBuilder.AppendFormat($"\"{numberBox.Text}\", ");
                stringBuilder.AppendFormat($"new DateTime({fileTimestamp.Year:0000}, {fileTimestamp.Month:00}, {fileTimestamp.Day:00}, {fileTimestamp.Hour:00}, {fileTimestamp.Minute:00}, 0, DateTimeKind.Utc)),");
                stringBuilder.AppendFormat($"    // {gameMasterTimestamp.Year:0000}-{gameMasterTimestamp.Month:00}-{gameMasterTimestamp.Day:00} {gameMasterTimestamp.Hour:00}:{gameMasterTimestamp.Minute:00}:{gameMasterTimestamp.Second:00}.{gameMasterTimestamp.Millisecond:000}");
                stringBuilder.AppendFormat($" - {difference.Days:00} days, {difference.Hours:00} hours, {difference.Minutes:00} minutes");

                textBoxMunge.Text = stringBuilder.ToString();
            }
            catch (Exception)
            {
                // One of the fields is invalid.
                textBoxMunge.Text = string.Empty;
            }
            finally
            {
                Working = false;
            }
        }
示例#2
0
 protected override void serializeContent(ICustomDataWriter writer)
 {
     writer.WriteByte((byte)Channel);
     writer.WriteUTF(Content);
     writer.WriteInt(TimestampUtils.GetFromNow());
     writer.WriteUTF(Content);
 }
示例#3
0
        private void numberBox_ValueChanged(object sender, EventArgs e)
        {
            if (Working)
            {
                return;
            }

            try
            {
                Working = true;

                maskedDateTimePicker.Value = checkBoxGameMaster.Checked ?
                                             GameMasterTimestampUtils.TicksToDateTime(numberBox.Value) :
                                             TimestampUtils.TicksToDateTime(numberBox.Value);
            }
            finally
            {
                Working = false;
            }
        }
示例#4
0
        private void numberBoxTimeStamp_ValueChanged(object sender, EventArgs e)
        {
            // Make sure we aren't in the middle of doing work.
            if (Working)
            {
                return;
            }

            try
            {
                Working = true;

                // Convert TimeStamp to DateTime for each.
                maskedDateTimePickerNormal.Value     = TimestampUtils.TicksToDateTime(numberBoxTimeStamp.Value);
                maskedDateTimePickerGameMaster.Value = GameMasterTimestampUtils.TicksToDateTime(numberBoxTimeStamp.Value);
            }
            finally
            {
                Working = false;
            }
        }
示例#5
0
 private void maskedDateTimePickerNormal_ValueChanged(object sender, EventArgs e)
 {
     numberBoxTimeStamp.Value = TimestampUtils.DateTimeToTicks(maskedDateTimePickerNormal.Value);
 }
示例#6
0
 public static DateTime TimestampToDateTime(string timeStamp)
 {
     return(AdjustForMangle(TimestampUtils.TimestampToDateTime(timeStamp)));
 }
示例#7
0
 public static ulong HexTimeStampToTicks(string hexTimeStamp)
 {
     return(TimestampUtils.HexTimeStampToTicks(hexTimeStamp));
 }
示例#8
0
 public static ulong DateTimeToTicks(DateTime dateTime)
 {
     return(TimestampUtils.DateTimeToTicks(dateTime));
 }
示例#9
0
 public Mangle(string gameMaster, DateTime corrected)
 {
     Start     = TimestampUtils.HexTimeStampToDateTime(gameMaster);
     Corrected = corrected;
 }