Окно ввода ID топика или ссылки.
Inheritance: System.Windows.Forms.Form
コード例 #1
0
        public void ExecuteGoToMessageWithPrompt(ICommandContext context)
        {
            var parentWindow = context.GetRequiredService<IUIShell>().GetMainWindowParent();

            int mid;
            using (var etf = new EnterTopicMessageIdForm())
                if (etf.ShowDialog(parentWindow) == DialogResult.OK)
                    mid = etf.MessageId;
                else
                    return;

            if (ApplicationManager.Instance.ForumNavigator.SelectMessage(mid))
            {
                var mainWindowSvc = context.GetService<IMainWindowService>();
                if (mainWindowSvc != null)
                    mainWindowSvc.EnsureVisible();
            }
            else if (MessageBox.Show(
                parentWindow,
                SR.Forum.GoToMessage.NotFound.FormatStr(mid),
                SR.Search.Error,
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Exclamation,
                MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                context
                    .GetRequiredService<IOutboxManager>()
                    .AddTopicForDownload(mid);
        }
コード例 #2
0
 public void ExecuteTopicDownload(ICommandContext context)
 {
     using (var etf = new EnterTopicMessageIdForm())
         if (etf.ShowDialog(context
                            .GetRequiredService <IUIShell>()
                            .GetMainWindowParent()) == DialogResult.OK)
         {
             context
             .GetRequiredService <IOutboxManager>()
             .AddTopicForDownload(etf.MessageId);
         }
 }
コード例 #3
0
        public void ExecuteGoToMessageWithPrompt(ICommandContext context)
        {
            var parentWindow = context.GetRequiredService <IUIShell>().GetMainWindowParent();

            int mid;

            using (var etf = new EnterTopicMessageIdForm())
                if (etf.ShowDialog(parentWindow) == DialogResult.OK)
                {
                    mid = etf.MessageId;
                }
                else
                {
                    return;
                }

            if (ApplicationManager.Instance.ForumNavigator.SelectMessage(mid))
            {
                var mainWindowSvc = context.GetService <IMainWindowService>();
                if (mainWindowSvc != null)
                {
                    mainWindowSvc.EnsureVisible();
                }
            }
            else if (MessageBox.Show(
                         parentWindow,
                         SR.Forum.GoToMessage.NotFound.FormatStr(mid),
                         SR.Search.Error,
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                context
                .GetRequiredService <IOutboxManager>()
                .AddTopicForDownload(mid);
            }
        }
コード例 #4
0
 public void ExecuteTopicDownload(ICommandContext context)
 {
     using (var etf = new EnterTopicMessageIdForm())
         if (etf.ShowDialog(context
                 .GetRequiredService<IUIShell>()
                 .GetMainWindowParent()) == DialogResult.OK)
             context
                 .GetRequiredService<IOutboxManager>()
                 .AddTopicForDownload(etf.MessageId);
 }