public void ExecuteModerating(ICommandContext context, int?messageId) { using (var frm = new ModeratingForm( context, ForumCommandHelper.GetMessageId(context, messageId))) frm.ShowDialog(context.GetRequiredService <IUIShell>().GetMainWindowParent()); }
public void ExecuteOpenMessageInJBrowser(ICommandContext context, int?messageId) { var url = JanusProtocolDispatcher.FormatURI( JanusProtocolResourceType.Message, ForumCommandHelper.GetMessageId(context, messageId).ToString()); context.OpenUrlInBrowser(url, UrlBehavior.InternalBrowser); }
public CommandStatus QueryGoToMessageCommandStatus( ICommandContext context, int?messageId) { return(ForumCommandHelper.GetSingleMessageCommandStatus(context, messageId) .UnavailableIfNot( () => Forums.Instance.ActiveForum == null || ForumMessageCommandHelper.GetMessage(context, messageId).ForumID != Forums.Instance.ActiveForum.ID)); }
public CommandStatus QueryModeratingStatus(ICommandContext context, int?messageId) { return (QueryMessageCommandStatus(context, messageId) .DisabledIfNot( () => { var id = ForumCommandHelper.GetMessageId(context, messageId); using (var mgr = context.CreateDBContext()) return mgr.Moderatorials().Any(m => m.MessageID == id); })); }
public void ExecuteRateMessage(ICommandContext context, int[] messageIds, MessageRates rate) { using (var rateForm = new RateForm(context, rate)) if (rateForm.ShowDialog( context .GetRequiredService <IUIShell>() .GetMainWindowParent()) == DialogResult.Yes) { ForumCommandHelper .GetMessageIds(context, messageIds) .ForEach( msgId => context .GetRequiredService <IOutboxManager>() .RateMarks .Add(msgId, rate)); } }
public void ExecuteGoToMessage( ICommandContext context, int?messageId) { var parentWindow = context .GetRequiredService <IUIShell>() .GetMainWindowParent(); if (Config.Instance.ConfirmationConfig.ConfirmJump && MessageBox.Show( parentWindow, SR.Search.JumpRequest, SR.Search.Confirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } if (ApplicationManager.Instance.ForumNavigator.SelectMessage( ForumCommandHelper.GetMessageId(context, messageId))) { var mainWindowSvc = context.GetService <IMainWindowService>(); if (mainWindowSvc != null) { mainWindowSvc.EnsureVisible(); } } else { MessageBox.Show( parentWindow, SR.Search.NotFound, SR.Search.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public IDisposable SubscribeMessageExportStatusChanged( IServiceProvider serviceProvider, Action handler) { return(ForumCommandHelper.SubscribeMessageCommandStatusChanged(serviceProvider, handler)); }
public CommandStatus QueryMessageExportStatus(ICommandContext context) { return(ForumCommandHelper.GetMultipleMessagesCommandStatus(context, null) .Or(QueryForumCommandStatus(context, null))); }
public CommandStatus QueryMessageCommandStatus(ICommandContext context, int?messageId) { return(ForumCommandHelper.GetSingleMessageCommandStatus(context, messageId)); }
public void ExecuteWarnModeratorOnRsdn(ICommandContext context, int?messageId) { context.OpenUrlInBrowser( RsdnUrlHelper.GetWarnModeratorUrl( ForumCommandHelper.GetMessageId(context, messageId))); }
public void ExecuteOpenModeratingOnRsdn(ICommandContext context, int?messageId) { context.OpenUrlInBrowser( RsdnUrlHelper.GetSelfModerateUrl( ForumCommandHelper.GetMessageId(context, messageId))); }
public void ExecuteOpenMessageOnRsdn(ICommandContext context, int?messageId) { context.OpenUrlInBrowser( SiteUrlHelper.GetMessageUrl( ForumCommandHelper.GetMessageId(context, messageId))); }
public CommandStatus QueryMessagesCommandStatus(ICommandContext context, int[] messageIds) { return(ForumCommandHelper.GetMultipleMessagesCommandStatus(context, messageIds)); }
public void ExecuteShowMessageRating(ICommandContext context, int?messageId) { context.OpenUrlInBrowser( SiteUrlHelper.GetRatingUrl( ForumCommandHelper.GetMessageId(context, messageId))); }