当前位置: 首页>>代码示例>>C#>>正文


C# MessageType.Equals方法代码示例

本文整理汇总了C#中MessageType.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# MessageType.Equals方法的具体用法?C# MessageType.Equals怎么用?C# MessageType.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageType的用法示例。


在下文中一共展示了MessageType.Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FormatMessage

        /* ======================== SUPPORT FUNCTIONS ============================= */
        private String FormatMessage(String msg, MessageType type, int level)
        {
            String prefix = "[^b" + GetPluginName() + "^n]:" + level + " ";

            if (Thread.CurrentThread.Name != null) prefix += "Thread(^b^5" + Thread.CurrentThread.Name + "^0^n): ";

            if (type.Equals(MessageType.Warning))
            prefix += "^1^bWARNING^0^n: ";
            else if (type.Equals(MessageType.Error))
            prefix += "^1^bERROR^0^n: ";
            else if (type.Equals(MessageType.Exception))
            prefix += "^1^bEXCEPTION^0^n: ";
            else if (type.Equals(MessageType.Debug))
            prefix += "^9^bDEBUG^n: ";

            return prefix + msg;
        }
开发者ID:redzito,项目名称:multi-balancer,代码行数:18,代码来源:MULTIbalancer.cs

示例2: FormatMessage

        public String FormatMessage(String msg, MessageType type)
        {
            String prefix = "[^b" + GetPluginName() + "^n] ";

            if (type.Equals(MessageType.Warning))
            prefix += "^1^bWARNING^0^n: ";
            else if (type.Equals(MessageType.Error))
            prefix += "^1^bERROR^0^n: ";
            else if (type.Equals(MessageType.Exception))
            prefix += "^1^bEXCEPTION^0^n: ";

            return prefix + msg;
        }
开发者ID:CaveMan150,项目名称:procon-basic-plugin,代码行数:13,代码来源:BasicPlugin.cs

示例3: GetUserMessages

        /// <summary>
        /// Get all messages of current user.
        /// </summary>
        /// <param name="userID">Sender user idetifier.</param>
        /// <param name="type">Type of message.</param>
        /// <param name="selectType">Type of message selecting.</param>
        /// <returns>List of user messages.</returns>
        public static IEnumerable<Message> GetUserMessages(
            Guid userID, MessageType type, MessageSelectType selectType)
        {
            IEnumerable<Message> recordList = null;
            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                if (type.Equals(MessageType.Posted))
                {
                    switch (selectType)
                    {
                        case MessageSelectType.All:
                            {
                                recordList = record.Messages
                                    .Where(w => w.FromID == userID && !w.IsDeletedBySender)
                                    .OrderByDescending(o => o.SendDate)
                                    .Select(s => new Message
                                    {
                                        MessageID = s.MessageID,
                                        FromID = s.FromID,
                                        ToID = s.ToID,
                                        SendDate = s.SendDate,
                                        Header = s.Header,
                                        Text = s.Text,
                                        Status = s.Status,
                                        IsDeletedBySender = s.IsDeletedBySender,
                                        IsDeletedByReceiver = s.IsDeletedByReceiver
                                    })
                                    .ToList();
                            }
                            break;
                        case MessageSelectType.OnlyNew:
                            {
                            }
                            break;
                        case MessageSelectType.OnlyOld:
                            {
                            }
                            break;
                    }
                }
                else
                {
                    switch (selectType)
                    {
                        case MessageSelectType.All:
                            {
                                recordList = record.Messages
                                    .Where(w => w.ToID == userID && !w.IsDeletedByReceiver)
                                    .OrderByDescending(o => o.SendDate)
                                    .Select(s => new Message
                                    {
                                        MessageID = s.MessageID,
                                        FromID = s.FromID,
                                        ToID = s.ToID,
                                        SendDate = s.SendDate,
                                        Header = s.Header,
                                        Text = s.Text,
                                        Status = s.Status,
                                        IsDeletedBySender = s.IsDeletedBySender,
                                        IsDeletedByReceiver = s.IsDeletedByReceiver
                                    })
                                    .ToList();
                            }
                            break;
                        case MessageSelectType.OnlyNew:
                            {
                            }
                            break;
                        case MessageSelectType.OnlyOld:
                            {
                            }
                            break;
                    }
                }
            }

            return recordList;
        }
开发者ID:ausatov,项目名称:SocialNetwork,代码行数:85,代码来源:MessageRepository.cs

示例4: GetMenuEventLogModel

 /****** 获取菜单点击的信息 **************/
 private MenuEventLog GetMenuEventLogModel(MessageType msgType)
 {
     MenuEventLog menuLog = new MenuEventLog();
     var root = doc.DocumentElement;
     menuLog.FromUserName = root.SelectSingleNode("FromUserName").InnerText;
     menuLog.clickTime = FormatTime(root.SelectSingleNode("CreateTime").InnerText);
     string menuKey = root.SelectSingleNode("EventKey").InnerText;
     if (msgType.Equals(MessageType.EventView))
     {
         int index = menuKey.IndexOf("=");
         int endIndex = menuKey.IndexOf("&");
         if (endIndex > index)
             menuKey = menuKey.Substring(index + 1, endIndex - index - 1);
     }
     menuLog.menuId = menuKey;
     return menuLog;
 }
开发者ID:mildrock,项目名称:wechat,代码行数:18,代码来源:DataDealBll.cs


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