public static bool SafeDeleteLocalPost(string blogId, string postId) { try { PostEditorFile post = PostEditorFile.FindPost(PostEditorFile.RecentPostsFolder, blogId, postId); if (post != null) { post.Delete(); } return(true); } catch (Exception ex) { DisplayableException displayableException = new DisplayableException( StringId.ErrorOccurredDeletingDraft, StringId.ErrorOccurredDeletingDraftDetails, ex.Message); DisplayableExceptionDisplayForm.Show(Win32WindowImpl.ForegroundWin32Window, displayableException); return(false); } }
public static bool SafeDeleteLocalPost(FileInfo postFile) { try { PostEditorFile postEditorFile = PostEditorFile.GetExisting(postFile); if (postEditorFile != null) { postEditorFile.Delete(); } return(true); } catch (Exception ex) { DisplayableException displayableException = new DisplayableException( StringId.ErrorOccurredDeletingDraft, StringId.ErrorOccurredDeletingDraftDetails, ex.Message); DisplayableExceptionDisplayForm.Show(Win32WindowImpl.ForegroundWin32Window, displayableException); return(false); } }