示例#1
0
        /// <summary>
        /// Process the specified Action ID.
        /// </summary>
        public override void Action(ActionID id)
        {
            switch (id)
            {
                case ActionID.JoinForum:
                    {
                        ListView.SelectedIndexCollection selectedItems = dvForumsList.SelectedIndices;
                        if (selectedItems.Count == 1)
                        {
                            DirForum selectedForum = _items[selectedItems[0]];
                            string forumName = selectedForum.Name;

                            JoinForum joinForum = new JoinForum(forumName);
                            if (joinForum.ShowDialog() == DialogResult.OK)
                            {
                                FoldersTree.MainForm.Address = string.Format("cix:{0}", forumName);
                            }
                        }
                        break;
                    }

                case ActionID.Refresh:
                    _currentCategory.Refresh();
                    break;
            }
        }
示例#2
0
 /// <summary>
 /// Invoke the Join dialog to join the forum specified by the address.
 /// This only works for cix: addresses. Others are ignored.
 /// </summary>
 /// <param name="address">The forum or forum/topic address</param>
 /// <returns>True if we displayed the Join Forum dialog, false otherwise</returns>
 private static bool JoinMissingForum(Address address)
 {
     if (address.Scheme == "cix")
     {
         string[] splitAddress = address.Query.Split(new[] {'/'});
         if (splitAddress.Length > 0)
         {
             JoinForum joinForum = new JoinForum(splitAddress[0]);
             joinForum.ShowDialog();
             return true;
         }
     }
     return false;
 }
示例#3
0
        /// <summary>
        /// Top level action handler.
        /// </summary>
        public void Action(ActionID id)
        {
            switch (id)
            {
                case ActionID.Offline:
                    ChangeOnlineState(!CIX.Online);
                    LogFile.WriteLine("User changed online state to {0}", CIX.Online);
                    break;

                case ActionID.BackTrack:
                    GoBack();
                    break;

                case ActionID.Search:
                    ActivateSearch();
                    break;

                case ActionID.NextPriorityUnread:
                    _foldersTree.NextUnread(FolderOptions.NextUnread | FolderOptions.Priority);
                    break;

                case ActionID.NextUnread:
                    _foldersTree.NextUnread(FolderOptions.NextUnread);
                    break;

                case ActionID.Markdown:
                    {
                        bool disableMarkup = Preferences.StandardPreferences.IgnoreMarkup;
                        Preferences.StandardPreferences.IgnoreMarkup = !disableMarkup;
                        break;
                    }

                case ActionID.KeyboardHelp:
                    if (_keyHelpDialog == null)
                    {
                        _keyHelpDialog = new KeyboardHelp();
                    }
                    _keyHelpDialog.Show();
                    _keyHelpDialog.BringToFront();
                    break;

                case ActionID.ViewChangeLog:
                    {
                        string releaseOrBeta = Preferences.StandardPreferences.UseBeta ? "beta" : "release";
                        LaunchURL(string.Format(Constants.ChangeLogURL, releaseOrBeta));
                        break;
                    }

                case ActionID.JoinForum:
                    if (_foldersTree.CanAction(ActionID.JoinForum))
                    {
                        _foldersTree.Action(ActionID.JoinForum);
                    }
                    else
                    {
                        JoinForumInput joinInput = new JoinForumInput();
                        if (joinInput.ShowDialog() == DialogResult.OK)
                        {
                            JoinForum joinForum = new JoinForum(joinInput.ForumName);
                            joinForum.ShowDialog();
                        }
                    }
                    break;

                default:
                    _foldersTree.Action(id);
                    break;
            }
            _toolbar.RefreshButtons();
        }