⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 privatemessageview.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

// TODO: Remove code that display help...

using System.Collections;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

using CommunityServer.Components;
using CommunityServer.Discussions.Components;

namespace CommunityServer.Discussions.Controls 
{

    // *********************************************************************
    //  PrivateMessageView
    //
    /// <summary>
    /// This server control is used to display private messages to a user
    /// </summary>
    /// 
    // ********************************************************************/
    public class PrivateMessageView : ThreadView 
    {

        #region Member variables and constructor
        string skinFilename              = "View-PrivateMessages.ascx";
        
        // *********************************************************************
        //  PrivateMessageView
        //
        /// <summary>
        /// The constructor simply checks for a ForumID value passed in via the
        /// HTTP POST or GET.
        /// properties.
        /// </summary>
        /// 
        // ********************************************************************/
        public PrivateMessageView() 
        {

            base.ThreadViewMode = ThreadViewMode.PrivateMessages;

            SkinFilename = skinFilename;

        }
        #endregion

        #region Skin initialization
        // *********************************************************************
        //  Initializeskin
        //
        /// <summary>
        /// Initializes the user control loaded in CreateChildControls. Initialization
        /// consists of finding well known control names and wiring up any necessary events.
        /// </summary>
        /// 
        // ********************************************************************/ 
        protected override void InitializeSkin(Control skin) 
        {
            base.InitializeSkin(skin);

            base.announcements.ItemCommand +=new RepeaterCommandEventHandler(Messages_ItemCommand);
            base.threads.ItemCommand +=new RepeaterCommandEventHandler(Messages_ItemCommand);

        }

        #endregion

        #region Events
        public void Messages_ItemCommand (object sender, RepeaterCommandEventArgs e)
        {
            ArrayList deleteList = new ArrayList();

            foreach (RepeaterItem i in announcements.Items) 
            {
                CheckBox c = i.FindControl("BulkEdit") as CheckBox;

                if (c.Checked) 
                {
                    HtmlGenericControl d = i.FindControl("ThreadID") as HtmlGenericControl;
                    deleteList.Add( int.Parse(d.InnerText) );
                }

            }

            foreach (RepeaterItem i in threads.Items) 
            {
                CheckBox c = i.FindControl("BulkEdit") as CheckBox;

                if (c.Checked) 
                {
                    HtmlGenericControl d = i.FindControl("ThreadID") as HtmlGenericControl;
                    deleteList.Add( int.Parse(d.InnerText) );
                }

            }

            PrivateMessages.DeletePrivateMessages(CSContext.Current.User.UserID, deleteList);

            DataBind();
        }

        #endregion

    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -