void Application_ResourceStateChanged(object sender, ResourceStateChangedArgs e) { // TODO: set the label text to the event contents. if (e.Resource != null && e.Resource.Equals(_currentTrack)) { System.Text.StringBuilder builder = new System.Text.StringBuilder(); builder.Append(e.Resource.Name); builder.Append(" .ResourceStateChanged( "); builder.Append(e.Status.ToString()); builder.Append(", {"); bool first = true; foreach (KeyValuePair <string, string> pair in e.ResourceInfo) { if (!first) { builder.Append(", "); } builder.Append(pair.Key); builder.Append("="); builder.Append(pair.Value); first = false; } builder.Append("} )"); Text = builder.ToString(); } }
void application_ResourceStateChanged(object sender, ResourceStateChangedArgs e) { if (e.Status >= ResourceStatus.Closed) { // the track finished - what next? if (_fileNames.Count == 1) { _playingIndex = -1; } else { // advance int index = _playingIndex + 1; if (index == _fileNames.Count) { index = 0; } // if the user hasn't touched the list recently, move the // selector to reflect the new track. if (DateTime.UtcNow - _lastSelectionChange > TimeSpan.FromSeconds(5)) { _musicList.SelectedIndex = index; } else { index = _musicList.SelectedIndex; } // now play the new track Play(index); } } }
void Application_ResourceStateChanged(object sender, ResourceStateChangedArgs e) { if (e.Resource == _videoView && e.Status == ResourceStatus.Complete) { _videoView.Stop(); } //if (e.Resource == _videoView && e.Status > ResourceStatus.Error) //{ // // just a place to set a break point for debugging // int x = 0; //} }