public bool GetValue(Buffer buffer)
        {
            string   name = buffer != null ? buffer.Name : null;
            BoolInfo info = null;

            if (name != null)
            {
                for (int i = value.Count; i-- > 0;)
                {
                    BoolInfo infoI = value[i];
                    if (infoI.filter != null && infoI.filter.Match(name))
                    {
                        info = infoI;
                        break;
                    }
                }
            }
            if (info == null)
            {
                for (int i = value.Count; i-- > 0;)
                {
                    BoolInfo infoI = value[i];
                    if (infoI.filter == null)
                    {
                        info = infoI;
                        break;
                    }
                }
            }
            return(info.value);
        }
Exemple #2
0
        /// <summary>
        /// 初始化逻辑类
        /// </summary>
        protected override void InitClass()
        {
            base.InitClass();

            InfoList = new List <BaseInfo>();
            ConfigNames.EmailConfigName ni = new ConfigNames.EmailConfigName();

            #region 构造


            #region EmailName ~ 发送人的邮箱帐号|如:zhx-fu

            m_EmailName = new StringInfo(ni.EmailName);
            InfoList.Add(m_EmailName);

            #endregion EmailName ~ 发送人的邮箱帐号|如:zhx-fu


            #region EmailSmtpServer ~ SMTP服务|如:10.2.1.78

            m_EmailSmtpServer = new StringInfo(ni.EmailSmtpServer);
            InfoList.Add(m_EmailSmtpServer);

            #endregion EmailSmtpServer ~ SMTP服务|如:10.2.1.78


            #region EmailSend ~ 发送人的邮箱帐号|如:[email protected]

            m_EmailSend = new StringInfo(ni.EmailSend);
            InfoList.Add(m_EmailSend);

            #endregion EmailSend ~ 发送人的邮箱帐号|如:[email protected]


            #region EmailPwd ~ 邮箱密码|如:abc123

            m_EmailPwd = new StringInfo(ni.EmailPwd);
            InfoList.Add(m_EmailPwd);

            #endregion EmailPwd ~ 邮箱密码|如:abc123


            #region EnableSsl ~ 使用Ssl模式|如:false

            m_EnableSsl           = new BoolInfo(ni.EnableSsl);
            m_EnableSsl.InfoValue = false;
            InfoList.Add(m_EnableSsl);

            #endregion EnableSsl ~ 使用Ssl模式|如:false


            #region EmailRecv ~ 接收人邮箱帐号|如:[email protected];[email protected];

            m_EmailRecv = new StringInfo(ni.EmailRecv);
            InfoList.Add(m_EmailRecv);

            #endregion EmailRecv ~ 接收人邮箱帐号|如:[email protected];[email protected];


            #region EmailTitle ~ 邮件标题|如:{DateTime.Date}-发送邮件测试

            m_EmailTitle = new StringInfo(ni.EmailTitle);
            InfoList.Add(m_EmailTitle);

            #endregion EmailTitle ~ 邮件标题|如:{DateTime.Date}-发送邮件测试


            #region EmailText ~ 邮件内容|如:发送邮件测试成功

            m_EmailText = new StringInfo(ni.EmailText);
            InfoList.Add(m_EmailText);

            #endregion EmailText ~ 邮件内容|如:发送邮件测试成功


            #region EmailEncoding ~ 邮件编码|如:gb2312

            m_EmailEncoding = new StringInfo(ni.EmailEncoding);
            InfoList.Add(m_EmailEncoding);

            #endregion EmailEncoding ~ 邮件编码|如:gb2312


            #region HtmlFlag ~ 内容为Html模式|如:false

            m_HtmlFlag           = new BoolInfo(ni.HtmlFlag);
            m_HtmlFlag.InfoValue = false;
            InfoList.Add(m_HtmlFlag);

            #endregion HtmlFlag ~ 内容为Html模式|如:false


            #region PwdTextType ~ 密码内容类型|text:明文;des3:des3加密|如:des3

            m_PwdTextType = new StringInfo(ni.PwdTextType);
            InfoList.Add(m_PwdTextType);

            #endregion PwdTextType ~ 密码内容类型|text:明文;des3:des3加密|如:des3



            #endregion 构造
        }
Exemple #3
0
        /// <summary>
        /// 初始化逻辑类
        /// </summary>
        protected override void InitClass()
        {
            base.InitClass();


            ConfigNames.ReadFileAndSendEmailConfigName
                ni
                = new ConfigNames.ReadFileAndSendEmailConfigName();

            #region 构造

            #region EmailTextType ~ 邮件内容类型|text:纯文字;file:文件|如:text

            m_EmailTextType = new StringInfo(ni.EmailTextType);
            InfoList.Add(m_EmailTextType);

            #endregion EmailTextType ~ 邮件内容类型|text:纯文字;file:文件|如:text


            #region DirFullName ~ 完整的Dir名称|如:D:\one(无后缀)|或:~/执行程序所在的目录|如:~/

            m_DirFullName = new StringInfo(ni.DirFullName);
            InfoList.Add(m_DirFullName);

            #endregion DirFullName ~ 完整的Dir名称|如:D:\one(无后缀)|或:~/执行程序所在的目录|如:~/


            #region FileNameExpress ~ 文件名表达式|如:*_bak.log

            m_FileNameExpress = new StringInfo(ni.FileNameExpress);
            InfoList.Add(m_FileNameExpress);

            #endregion FileNameExpress ~ 文件名表达式|如:*_bak.log


            #region ReadFileEncoding ~ 读取文件编码|gb2312/utf8|如:gb2312

            m_ReadFileEncoding = new StringInfo(ni.ReadFileEncoding);
            InfoList.Add(m_ReadFileEncoding);

            #endregion ReadFileEncoding ~ 读取文件编码|gb2312/utf8|如:gb2312


            #region EmailTextFileMaxLength ~ 读取的文件允许最大值|如果是0,则不限,否则超过最大值就不需要读|B为单位|如:0

            m_EmailTextFileMaxLength = new LongInfo(ni.EmailTextFileMaxLength);
            InfoList.Add(m_EmailTextFileMaxLength);

            #endregion EmailTextFileMaxLength ~ 读取的文件允许最大值|如果是0,则不限,否则超过最大值就不需要读|B为单位|如:0

            #region FileNameToLower ~ 文件是否小写比较|如:true

            m_FileNameToLower = new BoolInfo(ni.FileNameToLower);
            InfoList.Add(m_FileNameToLower);

            #endregion FileNameToLower ~ 文件是否小写比较|如:true



            #endregion 构造
        }