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

C# MsgType类代码示例

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

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



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

示例1: ConsoleMsg

        private static void ConsoleMsg(string msg, MsgType mt)
        {
            switch (mt)
            {
                case MsgType.FunctionCall:
                    Console.BackgroundColor = ConsoleColor.Black;
                    Console.ForegroundColor = ConsoleColor.Green;
                    break;
                case MsgType.Info:
                    Console.BackgroundColor = ConsoleColor.Black;
                    Console.ForegroundColor = ConsoleColor.DarkGreen;
                    break;
                case MsgType.Error:
                    Console.BackgroundColor = ConsoleColor.Black;
                    Console.ForegroundColor = ConsoleColor.Red;
                    break;
                case MsgType.NewCall:
                    Console.BackgroundColor = ConsoleColor.DarkRed;
                    Console.ForegroundColor = ConsoleColor.Green;
                    break;
                default:
                    Console.BackgroundColor=ConsoleColor.White;
                    Console.ForegroundColor=ConsoleColor.Black;
                    msg = $"Unknown Message Type: {mt}. {msg}";
                    break;
            }

            msg = $"{DateTime.Now.ToString("yyMMdd-HHmm")} {msg}";
            Console.WriteLine(msg);
        }
开发者ID:FuriousLogic,项目名称:DelayRepay,代码行数:30,代码来源:DRHelper.cs


示例2: GetMessage

 public static string GetMessage(MsgType msgType, string messageID, string para1, string para2)
 {
     string result = GetMessage(msgType, messageID);
     result = System.Text.RegularExpressions.Regex.Replace(result, "%1", para1);
     result = System.Text.RegularExpressions.Regex.Replace(result, "%2", para2);
     return result;
 }
开发者ID:yalunwang,项目名称:family,代码行数:7,代码来源:LiveConfig.cs


示例3: Message

 public static string Message(string msg, MsgType type)
 {
     String result = "";
     if (type.Equals(MsgType.Success))
     {
         result = @"<div class=""notification msgsuccess"">
                    <a class=""close""></a>
                    <p>" + msg + "</p></div>";
     }
     else if (type.Equals(MsgType.Information))
     {
         result = @"<div class=""notification msginfo"">
                    <a class=""close""></a>
                    <p>" + msg + "</p></div>";
     }
     else if (type.Equals(MsgType.Alert))
     {
         result = @"<div class=""notification msgalert"">
                    <a class=""close""></a>
                    <p>" + msg + "</p></div>";
     }
     else if (type.Equals(MsgType.Error))
     {
         result = @"<div class=""notification msgerror"">
                    <a class=""close""></a>
                    <p>" + msg + "</p></div>";
     }
     return result;
 }
开发者ID:pravastech,项目名称:TimeSheet,代码行数:29,代码来源:login.aspx.cs


示例4: ShowMessage

 public void ShowMessage(string msg, MsgType msgType)
 {
     string title;
     switch (msgType)
     {
         case MsgType.Info:
             title = "Bilgi";
             break;
         case MsgType.Warning:
             title = "Uyarı";
             break;
         case MsgType.Error:
             title = "Hata";
             break;
         default:
             title = null;
             break;
     };
     var script = String.Format(@"$.msgBox({{
             title: '{2}',
             content: '{0}',
             type: '{1}',
             buttons: [{{ value: 'Ok' }}],
         }});", msg, msgType.ToString().ToLower(), title);
     ClientScript += script + "\r\n";
 }
开发者ID:Bfan23,项目名称:scaworldui,代码行数:26,代码来源:PageMaster.Master.cs


示例5: Msg

 public Msg(string text, MsgType type, Exception ex)
 {
     Text = text;
     Type = type;
     Ex = ex;
     CreateDate = DateTime.Now;
 }
开发者ID:cesaroll,项目名称:LinkHub,代码行数:7,代码来源:Msg.cs


示例6: GetMessageList

        public static Dictionary<string, string> GetMessageList(AppLanguage Language, MsgType msgType)
        {
            XmlNode nodex = null;
            Dictionary<string, string> dic = new Dictionary<string, string>();

            switch (Language)
            {
                case AppLanguage.CN:
                    if (docCN == null)
                    {
                        docCN = new XmlDocument();
                        docCN.Load(ApplicationConfiguration.AppRoot + @"\LanguageMessage\zh-CN.xml");
                    }
                    nodex = docCN.SelectSingleNode("//root/" + msgType.ToString());
                    break;
            }
            if (nodex != null && nodex.ChildNodes != null)
            {
                foreach (XmlNode node in nodex.ChildNodes)
                {
                    dic.Add(node.Attributes["value"].Value, node.InnerText);
                }
            }
            return dic;
        }
开发者ID:yalunwang,项目名称:family,代码行数:25,代码来源:LiveConfig.cs


示例7: OnMsg

    public override void OnMsg(MsgType msgType, object msg)
    {
        switch (msgType)
        {
        case MsgType.MissionBottleNum:
            mLevel = (int)msg;
            LevelData mlevelData = GameManager.Instance.mGameDataManager.GetLevelData(mLevel);
            int smallNum = 0;
            int mediuNum = 0;
            int bigNum = 0;

            mlevelData.BottleGetDataGroup.ApplyAllItem(C => {
                switch (C.mFragmentType)
                {
                case FragmentType.Big:
                    bigNum+= C.GetFragNum;
                    break;
                case FragmentType.Medium:
                    mediuNum += C.GetFragNum;
                    break;
                case FragmentType.Small:
                    smallNum += C.GetFragNum;
                    break;
                }
            });
            mBottleGrouup[0].SetMyFragments(smallNum,FragmentType.Small);
            mBottleGrouup[1].SetMyFragments(mediuNum,FragmentType.Medium);
            mBottleGrouup[2].SetMyFragments(bigNum,FragmentType.Big);

            GameManager.Instance.StartGame (mLevel);
            UIManager.Instance.SendMsg(UIType.GamePlay,MsgType.PauseGame,mLevel);
            break;
        }
    }
开发者ID:Attila22,项目名称:LittleBard,代码行数:34,代码来源:MissionUI.cs


示例8: ShowAlert

    public void ShowAlert(string text, MsgType msgType)
    {
        string baseClass = "alert msgBox text-center";
        Panel panel = Master.FindControl("msg") as Panel;
        Label lbl = Master.FindControl("lblMsg") as Label;
        if (panel == null)
        {
            panel = Master.Master.FindControl("msg") as Panel;
            lbl = Master.Master.FindControl("lblMsg") as Label;
        }
        panel.Visible = true;
        switch (msgType)
        {
            case MsgType.Success:
                panel.CssClass = baseClass + " alert-success";
                break;
            case MsgType.Error:
                panel.CssClass = baseClass + " alert-danger";
                break;
            case MsgType.Warning:
                panel.CssClass = baseClass + " alert-warning";
                break;

        }

        lbl.Text = text;
    }
开发者ID:samercs,项目名称:ArchiveSystem,代码行数:27,代码来源:UICaltureBase.cs


示例9: GetMsgLength

 private static int GetMsgLength(MsgType msg)
 {    int result=0;
      switch (msg)
      {
          case MsgType.CheckWC:
              result=CheckWCIndex.MsgArrayLength;
              break;
          case MsgType.DataCollectionIndex:
              result=DataCollectionIndex.MsgArrayLength;
              break;
          case MsgType.TestCompletedIndex:
              result=TestCompletedIndex.MsgArrayLength;
              break;
          case MsgType.QueryBoxInfoIndex:
              result = QueryBoxInfoIndex.MsgArrayLength;
              break;
          case MsgType.QueryMBInfoIndex:
              result = QueryMBInfoIndex.MsgArrayLength;
              break;
          case MsgType.Get_LabelLocation:
              result = GetLabelLocationIndex.MsgArrayLength;
              break;
          case MsgType.Process_Completed:
              result = ProcessCompletedIndex.MsgArrayLength;
              break;  
      
      }
       return result;
 }
开发者ID:wra222,项目名称:testgit,代码行数:29,代码来源:Tool.cs


示例10: ChatMessage

 public ChatMessage(String txt, Color c, MsgType type = MsgType.Global, int sender = -1)
 {
     this.Color = c;
     this.Text = txt;
     this.Type = type;
     this.Sender = sender;
     this.Timestamp = DateTime.Now;
 }
开发者ID:Pychnight,项目名称:Chat-Assistant,代码行数:8,代码来源:Message.cs


示例11: CheckLogging

 public bool CheckLogging(MsgType msgType)
 {
     bool flag = true;
     if (!Logging.useFileLogging && !Logging.useConsoleLogging)
         flag = false;
     else if (msgType < Logging.msgFileLevel && msgType < Logging.msgConsoleLevel)
         flag = false;
     return flag;
 }
开发者ID:x893,项目名称:BTool,代码行数:9,代码来源:Logging.cs


示例12: Message

        public Message(Mobile from, string sub, string msg, MsgType type)
        {
            c_From = from;
            c_Msg = msg;
            c_Subject = sub;
            c_Type = type;

            c_Received = DateTime.Now;
        }
开发者ID:Jascen,项目名称:UOSmart,代码行数:9,代码来源:Message.cs


示例13: SendMsg

 public void SendMsg(UIType type,MsgType msgType,object arg)
 {
     BaseUI UI = null;
     if(UIInstsanceGroup.TryGetValue(type,out UI))
     {
         if(UI.gameObject.activeSelf)
             UI.OnMsg(msgType,arg);
     }
 }
开发者ID:Attila22,项目名称:LittleBard,代码行数:9,代码来源:UIManager.cs


示例14: SendClientMsg

        //给服务器发送上线信息
        public void SendClientMsg(MsgType type, int blockTypes, string msg)
        {
            //发送开始信息
                var message = (int)type + " " + hostName + " " + IPHost.ToString() + " " + "4530"+" "+blockTypes + " " + msg;

                //将消息发送给服务器端
                var outputBuffer = Encoding.Unicode.GetBytes(message);
                socket.BeginSend(outputBuffer, 0, outputBuffer.Length, SocketFlags.None, null, null);
                textBox1.Text = "connect to the server";
        }
开发者ID:zhaoxiaochao,项目名称:Teteris,代码行数:11,代码来源:Form1.cs


示例15: Message

        /////////////////////////////////////////////////////////////////////////////
        // LogService operations
        public void Message(MsgType type, string format, params object[] arg)
        {
            string text = string.Format(format, arg);

            this.Writer = new StreamWriter(FileName, true);
            this.Writer.WriteLine(DateTime.Now.ToString("[HH:mm:ss]") + ' ' + text);
            this.Writer.Close();

            if (Log != null) Log(this, new LogEventArgs(ref text, type));
        }
开发者ID:shilinxu,项目名称:honglt-myproject,代码行数:12,代码来源:LogService.cs


示例16: SendFriendMsg

        public void SendFriendMsg(MsgType type, int blockTypes, string msg, IPEndPoint ipPort)
        {
            //消息格式为  消息类型:用户名:IP地址:端口:方块类型:操作消息
            string massage = string.Format("{0}:{1}:{2}:{3}:{4}:{5}", (int)type, hostName, IPHost.ToString(), myPort, blockTypes, msg);
            //将消息转换为可 网络发送的 字节
            byte[] msgs = Encoding.Default.GetBytes(massage);

            //发送        信息,  长度,   好友IP地址
            myClient.Send(msgs, msgs.Length, ipPort);
        }
开发者ID:zhaoxiaochao,项目名称:Teteris,代码行数:10,代码来源:Form1.cs


示例17: AddText

 private void AddText(MsgType msgtype, string msg)
 {
     richTextBox1.Invoke(new EventHandler(delegate
     {
         richTextBox1.SelectedText = string.Empty;
         richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont, FontStyle.Bold);
         richTextBox1.SelectionColor = MsgTypeColor[(int)msgtype];
         richTextBox1.AppendText(msg);
         richTextBox1.ScrollToCaret();
     }));
 }
开发者ID:kairen,项目名称:embedded-homework,代码行数:11,代码来源:Form1.cs


示例18: ApplicationEngineTrigger

 /// <summary>
 /// 发送待办(默认消息需要公司ID)
 /// </summary>
 /// <param name="UserAndForm">接收用户与FormID</param>
 /// <param name="SystemCode">系统代号</param>
 /// <param name="ModelCode">模块代号</param>
 /// <param name="strCompanyID">公司ID</param>
 /// <param name="strXml">业务数据XML</param>
 /// <param name="msgType">消息类型</param>
 public void ApplicationEngineTrigger(List<CustomUserMsg> UserAndForm, string SystemCode, string ModelCode, string strCompanyID, string strXml, MsgType msgType)
 {
     string ss = "";
     foreach (CustomUserMsg list in UserAndForm)
     {
         ss += "FormID:" + list.FormID + "UserID:" + list.UserID;
     }
     Tracer.Debug("ApplicationEngineTrigger()UserAndForm:" + ss + "SystemCode:" + SystemCode + "ModelCode:" + ModelCode + "strCompanyID:" + strCompanyID + "strXml:" + strXml + "msgType:" + msgType.ToString() + "");
     EngineServicesBLL bll = new EngineServicesBLL();
     bll.ApplicationEngineTrigger(UserAndForm, SystemCode, ModelCode, strCompanyID, strXml, msgType);
 }
开发者ID:SaintLoong,项目名称:TMFlow,代码行数:20,代码来源:EngineWcfGlobalFunction.svc.cs


示例19: GetAlertClass

 public static string GetAlertClass(MsgType type)
 {
     switch (type)
     {
         case MsgType.Error:
             return "error";
         case MsgType.Success:
             return "success";
         case MsgType.Info:
             return "info";
         default:
             return "";
     }
 }
开发者ID:jneufeld,项目名称:cs319,代码行数:14,代码来源:MsgViewModel.cs


示例20: SendMsg

        public SendMsg(MsgType msgType, params string[] args)
        {
            this.msgType = msgType;

            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < args.Length; i++)
            {
                sb.Append(args[i]);

                if (i != args.Length - 1)
                    sb.Append(",");
            }

            this.msg_content = Encoding.ASCII.GetBytes(sb.ToString().Trim());
            this.msg_content_len = this.msg_content.Length;
        }
开发者ID:skt90u,项目名称:skt90u-framework-dotnet,代码行数:16,代码来源:SendMsg.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MultiDictionary类代码示例发布时间:2022-05-24
下一篇:
C# MsgHeader类代码示例发布时间: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