亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? notificationmanager.cs

?? BugNET is an issue tracking and project issue management solution built using the ASP.NET web applic
?? CS
字號:
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Reflection;
using BugNET.Providers.ResourceProviders;
using System.Web.Security;
using System.Threading;


namespace BugNET.BusinessLogicLayer
{
    /// <summary>
    /// 
    /// </summary>
    public class NotificationManager
    {
        private List<INotificationType> plugins = null;
        private string _Username;
        private string _Subject;
        private string _BodyText;

        /// <summary>
        /// Loads the notification types from the current assembly.
        /// </summary>
        public List<INotificationType> LoadNotificationTypes()
        {
            plugins = new List<INotificationType>();
            Assembly asm = this.GetType().Assembly;

            foreach (Type t in asm.GetTypes())
            {
                foreach (Type iface in t.GetInterfaces())
                {
                    if (iface.Equals(typeof(INotificationType)))
                    {
                        try
                        {
                            INotificationType notificationType = (INotificationType)Activator.CreateInstance(t);
                            plugins.Add(notificationType);
                            //Console.WriteLine("Type: " + notificationType.Name + " Enabled: " + notificationType.Enabled);
                            break;
                        }
                        catch (Exception e) { }
                    }
                }
            }
            return plugins;
        }

        /// <summary>
        /// Recurses the loaded notification plugins and if enabled will send the notifications using the plugin.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="bodyText">The body text.</param>
        public void SendNotification(string username,string subject, string bodyText)
        {
            if (string.IsNullOrEmpty(username))
                throw new ArgumentNullException("username");
            if (string.IsNullOrEmpty(subject))
                throw new ArgumentNullException("subject");
            if (string.IsNullOrEmpty(bodyText))
                throw new ArgumentNullException("bodyText");

            _Username = username;
            _Subject = subject;
            _BodyText = bodyText;

            Thread thread = new Thread(new System.Threading.ThreadStart(SendNotification_Thread));
            thread.Priority = ThreadPriority.Lowest;
            thread.Start();
        }


        /// <summary>
        /// Sends the notification_ thread.
        /// </summary>
        private void SendNotification_Thread()
        {

            foreach (INotificationType nt in plugins)
            {
                //if plugin is enabled globably though application settings
                if (nt.Enabled)
                {
                    nt.SendNotification(new NotificationContext(_Username,_Subject,_BodyText));
                }
            }
        }


        /// <summary>
        /// Loads the notification template.
        /// </summary>
        public string LoadNotificationTemplate(string templateName)
        {
            DBResourceProvider res = new DBResourceProvider("Notification");
            return res.GetObject(templateName, System.Threading.Thread.CurrentThread.CurrentUICulture).ToString();             
        }     

        /// <summary>
        /// Replaces the issue tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="issue">The issue.</param>
        private void ReplaceIssueTokens(ref string template, Issue issue)
        {
            if (issue != null)
            {
                template = template.Replace("[Issue_AssignedDisplayName]", issue.AssignedDisplayName);
                template = template.Replace("[Issue_Title]", issue.Title);
                template = template.Replace("[Issue_Description]", issue.Description);
                template = template.Replace("[Issue_Id]", issue.Id.ToString());
                template = template.Replace("[Issue_FullId]", issue.FullId);
                template = template.Replace("[Issue_Project]", issue.ProjectName);
                template = template.Replace("[Issue_CreatorDisplayName]", issue.CreatorDisplayName);
                template = template.Replace("[Issue_CreatedDate]", issue.DateCreated.ToShortDateString());
            }
        }


        /// <summary>
        /// Replaces the comment tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="issueComment">The issue comment.</param>
        private void ReplaceCommentTokens(ref string template, IssueComment issueComment)
        {

            if (issueComment != null)
            {
                template = template.Replace("[Comment_CreatorDisplayName]", issueComment.CreatorDisplayName);
                template = template.Replace("[Comment_DateCreated]", issueComment.DateCreated.ToShortDateString());
                template = template.Replace("[Comment]", issueComment.Comment);
            }
        }


        /// <summary>
        /// Replaces the user tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="user">The user.</param>
        private void ReplaceUserTokens(ref string template, MembershipUser user)
        {
            if (user != null)
            {
                template = template.Replace("[User_DateCreated]", user.CreationDate.ToShortDateString());
                template = template.Replace("[User_Email]", user.Email);
                template = template.Replace("[User_Username]", user.UserName);
                template = template.Replace("[User_DisplayName]", ITUser.GetUserDisplayName(user.UserName));                
            }
        }

        /// <summary>
        /// Replaces the common tokens.
        /// </summary>
        /// <param name="template">The template.</param>
        private void ReplaceCommonTokens(ref string template)
        {
            string desktopDefaultUrl = Globals.DefaultUrl;
            template = template.Replace("[DefaultUrl]", desktopDefaultUrl);
            template = template.Replace("\\n", Environment.NewLine);
        }

        /// <summary>
        /// Replaces the tokens for a issue, issue comment and membership user
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="issue">The issue.</param>
        /// <param name="issueComment">The issue comment.</param>
        /// <param name="user">The user.</param>
        public void ReplaceTokens(ref string template, Issue issue, IssueComment issueComment, MembershipUser user)
        {
            ReplaceIssueTokens(ref template, issue);
            ReplaceCommentTokens(ref template, issueComment);
            ReplaceUserTokens(ref template, user);
            ReplaceCommonTokens(ref template);
        }

        /// <summary>
        /// Replaces the tokens for a issue
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="issue">The issue.</param>
        public void ReplaceTokens(ref string template, Issue issue)
        {
            ReplaceTokens(ref template, issue, null, null);
        }

        /// <summary>
        /// Replaces the tokens for a issue comment
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="issueComment">The issue comment.</param>
        public void ReplaceTokens(ref string template, IssueComment issueComment)
        {

            ReplaceTokens(ref template, null, issueComment, null);
        }

        /// <summary>
        /// Replaces the tokens for a user
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="user">The user.</param>
        public void ReplaceTokens(ref string template, MembershipUser user)
        {
            ReplaceTokens(ref template, null, null, user);
        }

        /// <summary>
        /// Determines whether [is notification type enabled] [the specified notification type].
        /// </summary>
        /// <param name="notificationType">Type of the notification.</param>
        /// <returns>
        /// 	<c>true</c> if [is notification type enabled] [the specified notification type]; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsNotificationTypeEnabled(string notificationType)
        {
            if (string.IsNullOrEmpty(notificationType))
                throw new ArgumentNullException("notificationType");

            string[] notificationTypes = HostSetting.GetHostSetting("EnabledNotificationTypes").Split(';');
            foreach (string s in notificationTypes)
            {
                if (s.Equals(notificationType))
                    return true;
            }
            return false;
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
制服丝袜亚洲精品中文字幕| 亚洲午夜免费电影| 麻豆精品一区二区av白丝在线| 91丨porny丨在线| 一区视频在线播放| 91丨porny丨在线| 亚洲成人自拍偷拍| 91精品国产综合久久精品图片| 欧美aaa在线| 欧美精品一区二区久久久| 国产成a人亚洲| 成人免费看黄yyy456| 欧美三级视频在线播放| 亚欧色一区w666天堂| 日韩欧美中文一区| 成人久久18免费网站麻豆| 亚洲人成影院在线观看| 欧美日韩三级一区二区| 久久av资源站| 国产精品大尺度| 欧美日韩高清在线播放| 精一区二区三区| 成人欧美一区二区三区| 欧美人妇做爰xxxⅹ性高电影| 国产综合一区二区| 亚洲精品国产品国语在线app| 欧美老肥妇做.爰bbww| 经典一区二区三区| 亚洲女同女同女同女同女同69| 337p亚洲精品色噜噜噜| 国产激情一区二区三区四区| 亚洲综合色网站| 亚洲精品在线观| 色播五月激情综合网| 精品在线一区二区| 亚洲一区二区高清| 欧美激情在线看| 777亚洲妇女| 91在线一区二区三区| 日韩精品成人一区二区在线| 国产精品欧美综合在线| 欧美少妇性性性| 大陆成人av片| 麻豆成人免费电影| 亚洲色图19p| 久久亚洲精华国产精华液| 国产一区二区不卡老阿姨| 亚洲女爱视频在线| 久久久精品免费免费| 欧美性一二三区| 成人激情综合网站| 强制捆绑调教一区二区| 一片黄亚洲嫩模| 国产精品私人影院| 精品国产免费一区二区三区香蕉| 在线视频欧美精品| 成人18视频在线播放| 另类人妖一区二区av| 亚洲在线成人精品| 自拍偷在线精品自拍偷无码专区| 久久蜜桃av一区精品变态类天堂 | 亚洲欧洲精品天堂一级| 日韩视频一区二区| 欧美日本一区二区| 欧美最新大片在线看| 不卡av电影在线播放| 国产一区二区三区不卡在线观看 | 亚洲精品国产无套在线观| 日韩欧美亚洲国产精品字幕久久久 | 亚洲精品久久7777| 亚洲国产精品t66y| 久久久久88色偷偷免费| 欧美videossexotv100| 欧美日韩久久久| 欧洲国产伦久久久久久久| jiyouzz国产精品久久| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美亚日韩国产aⅴ精品中极品| av一二三不卡影片| 成人动漫精品一区二区| 国产精品一区二区久激情瑜伽| 另类小说色综合网站| 亚洲最新视频在线观看| 国产精品视频九色porn| 国产欧美一区二区精品婷婷 | 91在线观看下载| 成人视屏免费看| 成人深夜在线观看| 色综合久久综合网97色综合| 91影视在线播放| 在线日韩av片| 欧美欧美欧美欧美| 日韩亚洲欧美高清| 精品欧美乱码久久久久久1区2区| 日韩视频在线永久播放| 精品国产一区a| 欧美刺激午夜性久久久久久久| 欧美不卡一区二区三区四区| 26uuu久久综合| 国产欧美日韩视频一区二区| 国产精品久久久久aaaa樱花| 亚洲欧美色综合| 亚洲福利国产精品| 久久9热精品视频| 国产一区二区按摩在线观看| thepron国产精品| 欧美性生活久久| 日韩视频不卡中文| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲欧美激情插| 亚洲五码中文字幕| 蜜臀a∨国产成人精品| 国产超碰在线一区| 在线影院国内精品| 日韩一级完整毛片| 日本一区二区成人在线| 亚洲国产精品嫩草影院| 精东粉嫩av免费一区二区三区| 91一区一区三区| 日韩欧美在线123| 国产精品不卡视频| 午夜视频久久久久久| 国模冰冰炮一区二区| 97精品国产97久久久久久久久久久久| 欧美人妖巨大在线| 国产欧美日韩在线| 亚洲成人av一区| 国产美女av一区二区三区| 91免费看视频| 日韩欧美中文字幕精品| 亚洲欧美激情插| 国产麻豆9l精品三级站| 欧美网站大全在线观看| 久久综合九色综合久久久精品综合| 中文字幕一区二区三区四区| 日本特黄久久久高潮| 色综合天天综合色综合av | 视频在线在亚洲| 成人av在线网| 91精品国产免费| 亚洲精品国产无天堂网2021| 国产在线精品一区二区| 欧美日韩三级一区| 亚洲免费观看高清在线观看| 精品综合久久久久久8888| 欧美日本视频在线| 一区二区日韩电影| 国产成人鲁色资源国产91色综| 日韩三级伦理片妻子的秘密按摩| 亚洲一区二区美女| 91在线精品一区二区三区| 久久新电视剧免费观看| 久久成人精品无人区| 这里是久久伊人| 亚洲成精国产精品女| 93久久精品日日躁夜夜躁欧美| 国产亚洲一区二区三区在线观看 | 成人午夜电影小说| 精品国产伦一区二区三区免费 | 麻豆国产精品官网| 5月丁香婷婷综合| 亚洲一级电影视频| 91麻豆精品一区二区三区| 国产欧美在线观看一区| 国产在线精品国自产拍免费| 日韩一级大片在线观看| 日本亚洲天堂网| 欧美美女网站色| 亚瑟在线精品视频| 欧美日韩另类一区| 亚洲图片欧美色图| 欧美日韩高清影院| 日产国产欧美视频一区精品| 欧美日韩一区二区三区四区五区| 樱桃视频在线观看一区| 一本一本久久a久久精品综合麻豆| 亚洲欧洲日韩一区二区三区| av在线不卡观看免费观看| 国产精品国产三级国产aⅴ入口| 成人性生交大片免费看中文| 欧美国产一区视频在线观看| 国产东北露脸精品视频| 国产精品久久久久婷婷| av一区二区不卡| 一区二区三区在线视频播放| 日本韩国欧美三级| 亚洲bt欧美bt精品| 欧美tickling网站挠脚心| 国产乱人伦精品一区二区在线观看 | 欧美日韩精品免费| 日韩高清一区二区| 久久久久久久久久美女| 成人免费的视频| 一区二区三区欧美激情| 欧美日韩国产精品成人| 麻豆成人综合网| 中文字幕亚洲视频| 欧美精品亚洲二区| 精品一区二区在线看| 中文字幕av不卡|