protected void PropChanged_Listener(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Statistics") { Uptime = TimeString.GenerateFromSeconds(Statistics.ServerUptime); AllSongDuration = TimeString.GenerateFromSeconds(Statistics.AllSongDuration); DateTime time = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local) .AddSeconds(Statistics.LastDBUpdate); LastDBUpdate = time.ToLongDateString() + " " + time.ToLongTimeString(); } }
private void SetUpdatedValues() { if (Status != null) { string imageSource = (status.Repeat == 1) ? "repeat_blue.png" : "repeat_white.png"; if (RepeatImageSource != imageSource) { RepeatImageSource = imageSource; } imageSource = (status.Random == 1) ? "shuffle_blue.png" : "shuffle_white.png"; if (ShuffleImageSource != imageSource) { ShuffleImageSource = imageSource; } if (status.Volume >= 60) { VolumeImageSource = "volume_up_white.png"; } else if (status.Volume > 0) { VolumeImageSource = "volume_down_white.png"; } else { VolumeImageSource = "volume_off_white.png"; } PromilleElapsed = (double)status.ElapsedTime / (1000.0 * Status.CurrentTrackLength); TracklengthString = (CurrentSong != null) ? TimeString.GenerateFromSeconds(CurrentSong.LengthInSeconds) : TimeString.GenerateFromSeconds(Status.CurrentTrackLength); ElapsedTimeString = TimeString.GenerateFromSeconds(Status.ElapsedTimeInSec); } }