Beispiel #1
0
 /// <summary>
 /// User clicked the Join button.
 /// </summary>
 private void joinButton_Click(object sender, EventArgs e)
 {
     DialogResult = DialogResult.Cancel;
     if (_forum != null)
     {
         if (_forum.IsClosed)
         {
             _forum.RequestAdmittance();
         }
         else
         {
             _forum.Join();
             DialogResult = DialogResult.OK;
         }
     }
     CIX.DirectoryCollection.ForumUpdated -= OnForumUpdated;
     Close();
 }
Beispiel #2
0
        /// <summary>
        /// This event is triggered when the user performs an action on a canvas item.
        /// </summary>
        /// <param name="sender">The thread view control</param>
        /// <param name="args">A CanvasItemArgs object that contains details of the action</param>
        private void OnItemAction(object sender, CanvasItemArgs args)
        {
            switch (args.Item)
            {
            case ActionID.AuthorImage:
            {
                FoldersTree.MainForm.Address = string.Format("cixuser:{0}", args.Tag);
                break;
            }

            case ActionID.Refresh:
            case ActionID.ManageForum:
            case ActionID.Participants:
                Action(args.Item);
                break;

            case ActionID.Delete:
            {
                CanvasElementBase deleteButton = args.Control.CanvasItemLayout[ActionID.Delete];
                CanvasElementBase resignButton = args.Control.CanvasItemLayout[ActionID.ResignForum];
                if (deleteButton.Enabled)
                {
                    string promptString = string.Format(Resources.ConfirmDelete, _currentFolder.Name);
                    if (MessageBox.Show(promptString, Resources.Confirm, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                    {
                        deleteButton.Enabled = false;
                        if (resignButton != null)
                        {
                            resignButton.Enabled = false;
                        }
                        _currentFolder.Folder.Delete(true);
                    }
                }
                break;
            }

            case ActionID.ResignForum:
            {
                CanvasElementBase resignButton = args.Control.CanvasItemLayout[ActionID.ResignForum];
                if (resignButton.Enabled)
                {
                    string promptString = string.Format(Resources.ConfirmResign, _currentFolder.Name);
                    if (MessageBox.Show(promptString, Resources.Confirm, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                    {
                        resignButton.Enabled = false;
                        _currentFolder.Folder.Resign();
                    }
                }
                break;
            }

            case ActionID.JoinForum:
            {
                string promptString = string.Format(Resources.ConfirmJoin, _currentFolder.Name);
                if (MessageBox.Show(promptString, Resources.Confirm, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                {
                    _thisForum.Join();
                }
                break;
            }
            }
        }