public MessageForm( [NotNull] IServiceProvider provider, MessageFormMode mode, MessageInfo message) { if (provider == null) throw new ArgumentNullException("provider"); _serviceManager = new ServiceManager(provider); InitializeComponent(); _formMode = mode; _messageInfo = message ?? new MessageInfo(); _previewSourceNum = OutboxManager.RegisterPreviewSource(this); _serviceManager.Publish<IMessageEditorService>( new MessageEditorService(this)); CustomInitializeComponent(); _menuGenerator = new StripMenuGenerator(_serviceManager, _menuStrip, "MessageEditor.Menu"); _toolbarGenerator = new StripMenuGenerator(_serviceManager, _toolStrip, "MessageEditor.Toolbar"); _tagsbarGenerator = new SmilesToolbarGenerator(_serviceManager, "Forum.MessageEditor.TagsBar", _tagsBar); _syntaxExtSvc = provider.GetRequiredService<IEditorSyntaxExtensibilityService>(); }
public void ExecuteReplyMessage(ICommandContext context, int? messageId) { var msg = ForumMessageCommandHelper.GetMessage(context, messageId); var messageInfo = new MessageInfo( msg.ForumID, msg.ID, msg.Subject, Format.Forum.GetEditMessage( DatabaseManager.GetMessageBody(context, msg.ID), msg.UserNick)); MessageEditor.EditMessage(context, MessageFormMode.Reply, messageInfo); }
public void AddBugReport( string bugName, string bugDescription, string stackTrace, bool showEditor) { var mi = new MessageInfo(_bugReportForumId, _bugReportTopicId, bugName, string.Format( SR.Outbox.BugReportTemplate, bugName, bugDescription, ApplicationInfo.NameWithVersion, Config.Instance.DbDriver, stackTrace)); if (showEditor) MessageEditor.EditMessage(_serviceProvider, MessageFormMode.Add, mi); else NewMessages.Add(mi); }
public static void EditMessage(IServiceProvider provider, MessageFormMode mode, MessageInfo msgInfo) { new MessageForm(provider, mode, msgInfo).Show(); }