本文整理汇总了C#中MsgType类的典型用法代码示例。如果您正苦于以下问题:C# MsgType类的具体用法?C# MsgType怎么用?C# MsgType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MsgType类属于命名空间,在下文中一共展示了MsgType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例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";
}
示例5: Msg
public Msg(string text, MsgType type, Exception ex)
{
Text = text;
Type = type;
Ex = ex;
CreateDate = DateTime.Now;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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";
}
示例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));
}