msnnotificationtype.cs

来自「BugNET is an issue tracking and project 」· CS 代码 · 共 56 行

CS
56
字号
using System;
using System.Collections.Generic;
using System.Text;

namespace BugNET.BusinessLogicLayer
{
    public class MsnNotificationType : INotificationType
    {
        private bool _Enabled;

        #region INotificationType Members

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get { return "MSN"; }
        }

        /// <summary>
        /// Gets a value indicating whether this <see cref="MsnNotificationType"/> is enabled.
        /// </summary>
        /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
        public bool Enabled
        {
            get { return _Enabled; }
        }

        /// <summary>
        /// Sends the notification.
        /// </summary>
        /// <param name="context">The context.</param>
        public void SendNotification(INotificationContext context)
        {
            try
            {
                System.Web.Security.MembershipUser user = ITUser.GetUser(context.Username);

                //check if this user had this notifiction type enabled in his/her profile.
                if (user != null && ITUser.IsNotificationTypeEnabled(context.Username, this.Name))
                {
                    //TODO: Send the notification using a .NET msn library       
                }
            }
            catch (Exception ex)
            {

            }
        }

        #endregion
    }
}

⌨️ 快捷键说明

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