예제 #1
0
        /// <summary>
        /// This event is triggered when the user performs an action on a thread 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)
        {
            ProfileItem profileItem = (ProfileItem)args.Control;

            switch (args.Item)
            {
            case ActionID.Profile:
            case ActionID.AuthorImage:
                MainForm.Address = string.Format("cixmail:{0}", profileItem.ProfileData.Username);
                break;

            case ActionID.Email:
                MainForm.Address = string.Format("mailto:{0}", profileItem.ProfileData.EMailAddress);
                break;

            case ActionID.Location:
                MainForm.Address = string.Format(Constants.MapLink, profileItem.ProfileData.Location);
                break;
            }
        }
예제 #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.GoToSource:
            {
                CIXThread thread = args.Tag as CIXThread;
                if (thread != null)
                {
                    FoldersTree.MainForm.Address = string.Format("cix:{0}/{1}:{2}", thread.Forum, thread.Topic,
                                                                 thread.RemoteID);
                }
                break;
            }

            case ActionID.AuthorImage:
                FoldersTree.MainForm.Address = string.Format("cixuser:{0}", args.Tag);
                break;
            }
        }
예제 #3
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;
            }
            }
        }