protected virtual void DoSelectedImage( EnumControlResult result, [NotNull] IEnumerable <PhotoModel> itemImages, [NotNull] PhotoModel selectedImage) { switch (result) { case EnumControlResult.ResultDeleteItem: case EnumControlResult.ResultDeferred: case EnumControlResult.ResultSaveNow: case EnumControlResult.ResultCancelled: default: break; } }
// these two members are separated so they can be overriden separately protected virtual void DoSelectedComment( EnumControlResult result, [CanBeNull] ICommentBase itemBase, [CanBeNull] string modelText) { switch (result) { case EnumControlResult.ResultDeleteItem: // TODO: ??? break; case EnumControlResult.ResultDeferred: case EnumControlResult.ResultSaveNow: if (!string.IsNullOrEmpty(modelText)) { // TODO: Change the timestamp OR should we add this comment with a new timestamp ??? // TODO: Need to add the proper kind of comment here... var newComment = new CommentBase { EntryUser = new Person() { FirstName = "John", LastName = "Doe" }, EntryTime = DateTime.Now, CommentText = modelText }; // adding to the base collection prevents the filter getting in the way CommentContainer.Collection.Add(newComment); // this selection will be filtered, it may become a -1 (not found) CommentContainer.SelectedItem = newComment; } break; case EnumControlResult.ResultCancelled: default: break; } }