示例#1
0
        private void InitGridItems(List <ZForge.Controls.PropertyGridEx.CustomProperty> list)
        {
            EMailArgs Args = new EMailArgs();

            if (this.GlobalOperation == false)
            {
                mItemUseGlobal = new CustomProperty(Translator.Instance.T("是否使用Email报警全局设置"), this.UseGlobal, false, this.CategoryText, Translator.Instance.T("确定是否使用[使用偏好]中的全局设置"), true);
                list.Add(mItemUseGlobal);
            }

            mItemAction               = new CustomProperty(Translator.Instance.T("EMail报警方式"), Args.GetValue(this.Action), false, this.CategoryText, Translator.Instance.T("设置启用或者不启用EMail报警"), true);
            mItemAction.ValueMember   = "Key";
            mItemAction.DisplayMember = "Value";
            mItemAction.Datasource    = Args.ACTIONS;
            list.Add(mItemAction);

            mItemToAddress = new CustomProperty(Translator.Instance.T("接收者EMail地址"), this.ToAddress, false, this.CategoryText, Translator.Instance.T("设置报警接收者的邮箱地址"), true);
            list.Add(mItemToAddress);

            mItemSmtpAddress = new CustomProperty(Translator.Instance.T("SMTP服务器地址"), this.SMTPAddress, false, this.CategoryText, Translator.Instance.T("设置发送邮件的SMTP服务器地址"), true);
            list.Add(mItemSmtpAddress);

            mItemSmtpPort = new CustomProperty(Translator.Instance.T("SMTP服务器端口"), this.SMTPPort.ToString(), false, this.CategoryText, Translator.Instance.T("设置发送邮件的SMTP服务器端口, 通常为25; 如果是SSL连接, 通常是465; 如果您使用的是Gmail账号, 这里应该设置成25."), true);
            list.Add(mItemSmtpPort);

            mItemUsername = new CustomProperty(Translator.Instance.T("SMTP用户名"), this.Username, false, this.CategoryText, Translator.Instance.T("设置邮件发送的用户名, 如果您使用的是Gmail账号, 这里需要填入完整的Email地址."), true);
            list.Add(mItemUsername);

            mItemPassword            = new CustomProperty(Translator.Instance.T("SMTP用户密码"), this.Password, false, this.CategoryText, Translator.Instance.T("设置邮件发送的密码"), true);
            mItemPassword.IsPassword = true;
            list.Add(mItemPassword);

            mItemSSL = new CustomProperty(Translator.Instance.T("是否是SSL连接"), this.SSL, false, this.CategoryText, Translator.Instance.T("设置是否是SSL连接, 如果您使用的是Gmail账号, 请设置为True"), true);
            list.Add(mItemSSL);

            mItemTimeout = new CustomProperty(Translator.Instance.T("邮件发送超时设置"), this.Timeout.ToString(), false, this.CategoryText, Translator.Instance.T("设置邮件发送的超时, 缺省为10秒"), true);
            list.Add(mItemTimeout);

            mItemAttachImage = new CustomProperty(Translator.Instance.T("邮件包含图片"), this.mAttachImage, false, this.CategoryText, Translator.Instance.T("设置在邮件中是否包含图片"), true);
            list.Add(mItemAttachImage);

            foreach (ZForge.Controls.PropertyGridEx.CustomProperty i in list)
            {
                i.Tag = this.ID;
            }
            this.SyncUI();
        }
示例#2
0
        private void InitGridItems(List<ZForge.Controls.PropertyGridEx.CustomProperty> list)
        {
            EMailArgs Args = new EMailArgs();

            if (this.GlobalOperation == false)
            {
                mItemUseGlobal = new CustomProperty(Translator.Instance.T("是否使用Email报警全局设置"), this.UseGlobal, false, this.CategoryText,Translator.Instance.T("确定是否使用[使用偏好]中的全局设置"), true);
                list.Add(mItemUseGlobal);
            }

            mItemAction = new CustomProperty(Translator.Instance.T("EMail报警方式"), Args.GetValue(this.Action), false, this.CategoryText, Translator.Instance.T("设置启用或者不启用EMail报警"), true);
            mItemAction.ValueMember = "Key";
            mItemAction.DisplayMember = "Value";
            mItemAction.Datasource = Args.ACTIONS;
            list.Add(mItemAction);

            mItemToAddress = new CustomProperty(Translator.Instance.T("接收者EMail地址"), this.ToAddress, false, this.CategoryText, Translator.Instance.T("设置报警接收者的邮箱地址"), true);
            list.Add(mItemToAddress);

            mItemSmtpAddress = new CustomProperty(Translator.Instance.T("SMTP服务器地址"), this.SMTPAddress, false, this.CategoryText, Translator.Instance.T("设置发送邮件的SMTP服务器地址"), true);
            list.Add(mItemSmtpAddress);

            mItemSmtpPort = new CustomProperty(Translator.Instance.T("SMTP服务器端口"), this.SMTPPort.ToString(), false, this.CategoryText, Translator.Instance.T("设置发送邮件的SMTP服务器端口, 通常为25; 如果是SSL连接, 通常是465; 如果您使用的是Gmail账号, 这里应该设置成25."), true);
            list.Add(mItemSmtpPort);

            mItemUsername = new CustomProperty(Translator.Instance.T("SMTP用户名"), this.Username, false, this.CategoryText, Translator.Instance.T("设置邮件发送的用户名, 如果您使用的是Gmail账号, 这里需要填入完整的Email地址."), true);
            list.Add(mItemUsername);

            mItemPassword = new CustomProperty(Translator.Instance.T("SMTP用户密码"), this.Password, false, this.CategoryText, Translator.Instance.T("设置邮件发送的密码"), true);
            mItemPassword.IsPassword = true;
            list.Add(mItemPassword);

            mItemSSL = new CustomProperty(Translator.Instance.T("是否是SSL连接"), this.SSL, false, this.CategoryText, Translator.Instance.T("设置是否是SSL连接, 如果您使用的是Gmail账号, 请设置为True"), true);
            list.Add(mItemSSL);

            mItemTimeout = new CustomProperty(Translator.Instance.T("邮件发送超时设置"), this.Timeout.ToString(), false, this.CategoryText, Translator.Instance.T("设置邮件发送的超时, 缺省为10秒"), true);
            list.Add(mItemTimeout);

            mItemAttachImage = new CustomProperty(Translator.Instance.T("邮件包含图片"), this.mAttachImage, false, this.CategoryText, Translator.Instance.T("设置在邮件中是否包含图片"), true);
            list.Add(mItemAttachImage);

            foreach (ZForge.Controls.PropertyGridEx.CustomProperty i in list)
            {
                i.Tag = this.ID;
            }
            this.SyncUI();
        }