• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.ModuleMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DotNetNuke.UI.Skins.Controls.ModuleMessage的典型用法代码示例。如果您正苦于以下问题:C# ModuleMessage类的具体用法?C# ModuleMessage怎么用?C# ModuleMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModuleMessage类属于DotNetNuke.UI.Skins.Controls命名空间,在下文中一共展示了ModuleMessage类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IsReadyToSend

        private bool IsReadyToSend(List<string> roleNames, List<UserInfo> users, ref string message, ref ModuleMessage.ModuleMessageType messageType)
        {
            if (String.IsNullOrEmpty(txtSubject.Text) || String.IsNullOrEmpty(teMessage.Text))
            {
                message = Localization.GetString("MessageValidation", LocalResourceFile);
                messageType = ModuleMessage.ModuleMessageType.RedError;
                return false;
            }

            if (users.Count == 0 && roleNames.Count == 0)
            {
                message = string.Format(Localization.GetString("NoRecipients", LocalResourceFile), -1);
                messageType = ModuleMessage.ModuleMessageType.YellowWarning;
                return false;
            }

            return true;
        }
开发者ID:zyhfish,项目名称:Dnn.Newsletter,代码行数:18,代码来源:Newsletter.ascx.cs


示例2: AddModuleMessage

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// AddModuleMessage adds a module message
 /// </summary>
 /// <param name="message">The message</param>
 /// <param name="type">The type of message</param>
 /// <history>
 /// 	[cnurse]	08/24/2006
 /// </history>
 /// -----------------------------------------------------------------------------
 private void AddModuleMessage(string message, ModuleMessage.ModuleMessageType type)
 {
     UI.Skins.Skin.AddModuleMessage(this, Localization.GetString(message, LocalResourceFile), type);
 }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:14,代码来源:EditVendors.ascx.cs


示例3: SendMailSynchronously

        private void SendMailSynchronously(SendTokenizedBulkEmail email, out string strResult, out ModuleMessage.ModuleMessageType msgResult)
        {
            int mailsSent = email.SendMails();

            if (mailsSent > 0)
            {
                strResult = string.Format(Localization.GetString("MessagesSentCount", LocalResourceFile), mailsSent);
                msgResult = ModuleMessage.ModuleMessageType.GreenSuccess;
            }
            else
            {
                strResult = string.Format(Localization.GetString("NoMessagesSent", LocalResourceFile), email.SendingUser.Email);
                msgResult = ModuleMessage.ModuleMessageType.YellowWarning;
            }
        }
开发者ID:zyhfish,项目名称:Dnn.Newsletter,代码行数:15,代码来源:Newsletter.ascx.cs


示例4: PrepareEmail

        private bool PrepareEmail(SendTokenizedBulkEmail email, ref string message, ref ModuleMessage.ModuleMessageType messageType)
        {
            bool isValid = true;

            switch (teMessage.Mode)
            {
                case "RICH":
                    email.BodyFormat = MailFormat.Html;
                    break;
                default:
                    email.BodyFormat = MailFormat.Text;
                    break;
            }

            switch (cboPriority.SelectedItem.Value)
            {
                case "1":
                    email.Priority = MailPriority.High;
                    break;
                case "2":
                    email.Priority = MailPriority.Normal;
                    break;
                case "3":
                    email.Priority = MailPriority.Low;
                    break;
                default:
                    isValid = false;
                    break;
            }

            if (txtFrom.Text != string.Empty && email.SendingUser.Email != txtFrom.Text)
            {
                var myUser = email.SendingUser ?? new UserInfo();
                myUser.Email = txtFrom.Text;
                email.SendingUser = myUser;
            }

            if (txtReplyTo.Text != string.Empty && email.ReplyTo.Email != txtReplyTo.Text)
            {
                var myUser = new UserInfo { Email = txtReplyTo.Text };
                email.ReplyTo = myUser;
            }

            if (selLanguage.Visible && selLanguage.SelectedLanguages != null)
            {
                email.LanguageFilter = selLanguage.SelectedLanguages;
            }

            if (ctlAttachment.Url.StartsWith("FileID="))
            {
                int fileId = int.Parse(ctlAttachment.Url.Substring(7));
                var objFileInfo = FileManager.Instance.GetFile(fileId);
                //TODO: support secure storage locations for attachments! [sleupold 06/15/2007]
                email.AddAttachment(FileManager.Instance.GetFileContent(objFileInfo),
                                               new ContentType { MediaType = objFileInfo.ContentType, Name = objFileInfo.FileName });
            }

            switch (cboSendMethod.SelectedItem.Value)
            {
                case "TO":
                    email.AddressMethod = SendTokenizedBulkEmail.AddressMethods.Send_TO;
                    break;
                case "BCC":
                    email.AddressMethod = SendTokenizedBulkEmail.AddressMethods.Send_BCC;
                    break;
                case "RELAY":
                    email.AddressMethod = SendTokenizedBulkEmail.AddressMethods.Send_Relay;
                    if (string.IsNullOrEmpty(txtRelayAddress.Text))
                    {
                        message = string.Format(Localization.GetString("MessagesSentCount", LocalResourceFile), -1);
                        messageType = ModuleMessage.ModuleMessageType.YellowWarning;
                        isValid = false;
                    }
                    else
                    {
                        email.RelayEmailAddress = txtRelayAddress.Text;
                    }
                    break;
            }

            email.SuppressTokenReplace = !chkReplaceTokens.Checked;

            return isValid;
        }
开发者ID:zyhfish,项目名称:Dnn.Newsletter,代码行数:84,代码来源:Newsletter.ascx.cs


示例5: SendEmail

        private void SendEmail(List<string> roleNames, List<UserInfo> users, ref string message, ref ModuleMessage.ModuleMessageType messageType)
        {
            //it is awkward to ensure that email is disposed correctly because when sent asynch it should be disposed by the  asynch thread
            var email = new SendTokenizedBulkEmail(roleNames, users, /*removeDuplicates*/ true, txtSubject.Text, ConvertToAbsoluteUrls(teMessage.Text));

            bool isValid;
            try
            {
                isValid = PrepareEmail(email, ref message, ref messageType);
            }
            catch (Exception)
            {
                email.Dispose();
                throw;
            }

            if (isValid)
            {

                if (optSendAction.SelectedItem.Value == "S")
                {
                    try
                    {
                        SendMailSynchronously(email, out message, out messageType);
                    }
                    finally
                    {
                        email.Dispose();
                    }
                }
                else
                {
                    SendMailAsyncronously(email, out message, out messageType);
                    //dispose will be handled by async thread
                }
            }
        }
开发者ID:zyhfish,项目名称:Dnn.Newsletter,代码行数:37,代码来源:Newsletter.ascx.cs


示例6: SendMailAsyncronously

        private void SendMailAsyncronously(SendTokenizedBulkEmail email, out string message, out ModuleMessage.ModuleMessageType messageType)
        {
            //First send off a test message
            var strStartSubj = Localization.GetString("EMAIL_BulkMailStart_Subject.Text", Localization.GlobalResourceFile);
            if (!string.IsNullOrEmpty(strStartSubj)) strStartSubj = string.Format(strStartSubj, txtSubject.Text);

            var strStartBody = Localization.GetString("EMAIL_BulkMailStart_Body.Text", Localization.GlobalResourceFile);
            if (!string.IsNullOrEmpty(strStartBody)) strStartBody = string.Format(strStartBody, txtSubject.Text, UserInfo.DisplayName, email.Recipients().Count);

            var sendMailResult = Mail.SendMail(txtFrom.Text,
                txtFrom.Text,
                "",
                "",
                MailPriority.Normal,
                strStartSubj,
                MailFormat.Text,
                Encoding.UTF8,
                strStartBody,
                "",
                Host.SMTPServer,
                Host.SMTPAuthentication,
                Host.SMTPUsername,
                Host.SMTPPassword,
                Host.EnableSMTPSSL);

            if (string.IsNullOrEmpty(sendMailResult))
            {
                var objThread = new Thread(() => SendAndDispose(email));
                objThread.Start();
                message = Localization.GetString("MessageSent", LocalResourceFile);
                messageType = ModuleMessage.ModuleMessageType.GreenSuccess;
            }
            else
            {
                message = string.Format(Localization.GetString("NoMessagesSentPlusError", LocalResourceFile), sendMailResult);
                messageType = ModuleMessage.ModuleMessageType.YellowWarning;
            }
        }
开发者ID:zyhfish,项目名称:Dnn.Newsletter,代码行数:38,代码来源:Newsletter.ascx.cs


示例7: AddLocalizedModuleMessage

 /// <summary>
 /// AddLocalizedModuleMessage adds a localized module message
 /// </summary>
 /// <param name="message">The localized message</param>
 /// <param name="type">The type of message</param>
 /// <param name="display">A flag that determines whether the message should be displayed</param>
 protected void AddLocalizedModuleMessage(string message, ModuleMessage.ModuleMessageType type, bool display)
 {
     if (display)
     {
         UI.Skins.Skin.AddModuleMessage(this, message, type);
     }
 }
开发者ID:rjallepalli,项目名称:PIX_CMS,代码行数:13,代码来源:UserModuleBase.cs


示例8: AddModuleMessage

 /// <summary>
 /// AddModuleMessage adds a module message
 /// </summary>
 /// <param name="message">The message</param>
 /// <param name="type">The type of message</param>
 /// <param name="display">A flag that determines whether the message should be displayed</param>
 protected void AddModuleMessage(string message, ModuleMessage.ModuleMessageType type, bool display)
 {
     AddLocalizedModuleMessage(Localization.GetString(message, LocalResourceFile), type, display);
 }
开发者ID:rjallepalli,项目名称:PIX_CMS,代码行数:10,代码来源:UserModuleBase.cs


示例9: GetModuleMessageControl

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// GetModuleMessageControl gets an existing Message Control and sets its properties
 /// </summary>
 /// <param name="heading">The Message Heading</param>
 /// <param name="message">The Message Text</param>
 /// <param name="moduleMessageType">The type of message</param>
 /// <history>
 /// 	[cnurse]	12/04/2007  documented
 /// </history>
 /// -----------------------------------------------------------------------------
 public static ModuleMessage GetModuleMessageControl(string heading, string message, ModuleMessage.ModuleMessageType moduleMessageType)
 {
     return GetModuleMessageControl(heading, message, moduleMessageType, Null.NullString);
 }
开发者ID:davidsports,项目名称:Dnn.Platform,代码行数:15,代码来源:Skin.cs


示例10: AddPageMessage

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// AddPageMessage adds a Page Message control to the Skin
 /// </summary>
 /// <param name="heading">The Message Heading</param>
 /// <param name="message">The Message Text</param>
 /// <param name="page">The Page</param>
 /// <param name="moduleMessageType">The type of the message</param>
 /// <history>
 /// 	[cnurse]	12/04/2007  documented
 /// </history>
 /// -----------------------------------------------------------------------------
 public static void AddPageMessage(Page page, string heading, string message, ModuleMessage.ModuleMessageType moduleMessageType)
 {
     AddPageMessage(page, heading, message, moduleMessageType, Null.NullString);
 }
开发者ID:davidsports,项目名称:Dnn.Platform,代码行数:16,代码来源:Skin.cs


示例11: AddModuleMessage

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// AddModuleMessage adds a Moduel Message control to the Skin
 /// </summary>
 /// <param name="heading">The Message Heading</param>
 /// <param name="message">The Message Text</param>
 /// <param name="control">The current control</param>
 /// <param name="moduleMessageType">The type of the message</param>
 /// <history>
 /// 	[cnurse]	12/04/2007  documented
 /// </history>
 /// -----------------------------------------------------------------------------
 public static void AddModuleMessage(Control control, string heading, string message, ModuleMessage.ModuleMessageType moduleMessageType)
 {
     AddModuleMessage(control, heading, message, moduleMessageType, Null.NullString);
 }
开发者ID:davidsports,项目名称:Dnn.Platform,代码行数:16,代码来源:Skin.cs



注:本文中的DotNetNuke.UI.Skins.Controls.ModuleMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.DNNNode类代码示例发布时间:2022-05-24
下一篇:
C# Modules.ModuleInstanceContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap