internal void Delete() { // FIXME:It would be nice if this was copied to all the old versions // of this file in the SupportingFile store using (Bitmap img = CreateMockPlayer(Res.Get(StringId.VideoError))) { // Show the player as in an error state, stop tracking its progress UpdateVideoSnapshot(img); } _content.Properties.SetBoolean(VIDEO_HAS_PROGRESS, false); _content.Properties.SetString(VIDEO_STATUS, Res.Get(StringId.VideoError)); //FIXME: The problem with doing this is that once you undo a delete file, // there is no way to turn it back on for call backs // If it is a video and has a watcher make sure it is taken care of IStatusWatcher statusWatcher = ((IInternalContent)_content).ObjectState as IStatusWatcher; if (statusWatcher == null) { return; } statusWatcher.CancelPublish(); statusWatcher.Dispose(); ((IInternalContent)_content).ObjectState = null; }
/// <summary> /// When a video is finished or has an error it should no longer /// have settings that say it has progress. Clears those out, and make /// sure that we arent going to be called back anymore. /// </summary> /// <param name="message">The last known status that the video had</param> private void StopProgress(bool hasError) { IStatusWatcher sw = ((IInternalContent)_content).ObjectState as IStatusWatcher; if (sw != null) { sw.Dispose(); } // Remove the place holder on success if (!hasError) { RemoveBitmap(_content.Properties.GetString(VIDEO_PUBLISH_IMAGE, String.Empty)); _content.Properties.Remove(VIDEO_PUBLISH_IMAGE); } RemoveBitmap(VIDEO_PROGRESS_PATH); _content.Properties.SetBoolean(VIDEO_HAS_PROGRESS, false); _content.Properties.SetBoolean(VIDEO_HAS_ERROR, hasError); }