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


C# MessageType.ToString方法代码示例

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


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

示例1: SetRedirectMessage

        protected void SetRedirectMessage(MessageType messageType, string message)
        {
            if (String.IsNullOrEmpty(message))
            {
                return;
            }

            if(!TempData.ContainsKey(messageType.ToString()))
            {
                TempData.Add(messageType.ToString(), new List<string>());
            }

            ((List<string>)TempData[messageType.ToString()]).Add(message);
        }
开发者ID:mattapayne,项目名称:nKanban,代码行数:14,代码来源:AbstractBaseController.cs

示例2: Log

 public static void Log(MessageType logLevel, string message, params object[] fmt)
 {
     if (debugInstance != null)
         debugInstance.logMessageQueue.Enqueue(String.Format("[{0}] {1}: {2}", DateTime.Now.ToString("hh:mm:ss"), logLevel.ToString(), String.Format(message, fmt)));
     else
         throw new NullReferenceException("Tried to log a message, but log queue is not initialized");
 }
开发者ID:RaidMax,项目名称:TLog,代码行数:7,代码来源:Log.cs

示例3: append

        public static bool append(String message, MessageType mt)
        {
            try
            {
                // get name of calling module and function
                System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace();
                System.Reflection.MethodBase mb = stackTrace.GetFrame(0).GetMethod(); // =this function
                String name = mb.Name;
                for(int i = 1; i < stackTrace.FrameCount; i++)
                {
                    mb = stackTrace.GetFrame(i).GetMethod();
                    if(mb.Name != name)
                        break;
                }

                //Build and then write the (CSV formatted) line to todays log file
                String logName = getLogName();
                String dateStamp = DateTime.Today.ToString("yyyyMMdd");
                String timeStamp = DateTime.Now.ToString("HH:mm:ss.fff");
                String line = String.Format("{0},{1},{2},{3},{4},\"{5}\"{6}", dateStamp, timeStamp, mb.Module, mb.Name, mt.ToString(), message.Replace(',',';').Replace('"','\''), Environment.NewLine);
                System.IO.File.AppendAllText(logName, line);
            }
            catch(Exception ex)
            {
                // Log errors for testing, but ignore when live
                System.Diagnostics.Debug.WriteLine(ex.Message);
                return false;
            }
            return true;
        }
开发者ID:cbinding,项目名称:stellar,代码行数:30,代码来源:Log.cs

示例4: FormedMessage

 public static string FormedMessage(string msg, MessageType type)
 {
     var res = new StringBuilder();
     string id = "infoMsg" + Guid.NewGuid().ToString();
     res.AppendFormat("<div id='{0}' class='alert {1}' onclick='$(this).hide();'>{2}</div>", id, type.ToString(),
                      msg);
     return res.ToString();
 }
开发者ID:dmelnikov,项目名称:DWKit,代码行数:8,代码来源:MessageHelper.cs

示例5: Show

    public void Show(MessageType messageType, string message)
    {
        CloseButton.Visible = ShowCloseButton;
        litMessage.Text = message;

        panelMessageBox.CssClass = messageType.ToString().ToLower();
        this.Visible = true;
    }
开发者ID:anthonied,项目名称:tcrm,代码行数:8,代码来源:MessageBox.ascx.cs

示例6: Write

 public static void Write(MessageType type, String category, String id, String textWithFormat, params object[] objs)
 {
     Console.WriteLine("[{0}] {1} - {2} ({3}): {4}",
         type.ToString(),
         DateTime.Now.ToLocalTime(),
         category,
         id ?? "0",
         String.Format(textWithFormat, objs));
 }
开发者ID:AleksandarDev,项目名称:LD26,代码行数:9,代码来源:LoggerService.cs

示例7: AddMessage

 /// <summary>
 /// 输出信息
 /// </summary>
 /// <param name="messageType"></param>
 /// <param name="message"></param>
 public static void AddMessage(MessageType messageType, string message)
 {
     stringBuilder.Clear();
     stringBuilder.Append("[" + DateTime.Now.ToString() + "]");
     stringBuilder.Append(" " + messageType.ToString() + ": " + message);
     stringBuilder.Append(Environment.NewLine);
     WriteLogToFile(stringBuilder.ToString());
     ShowLogHandle();
 }
开发者ID:penzz,项目名称:FTPMonitor,代码行数:14,代码来源:LogManager.cs

示例8: BasicTextLogger

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="iFullPath">Full path of the log file to create.</param>
        /// <param name="iMessageTypes">The type of messages that you would like logged, anything else is ignored.</param>
        private BasicTextLogger(String iFullPath, MessageType iMessageTypes)
        {
            cStrFullPath = iFullPath;
            cFSmOutput = File.Open(iFullPath, FileMode.Append, FileAccess.Write, FileShare.Read);
            cSWrOutput = new StreamWriter(cFSmOutput);
            cSWrOutput.AutoFlush = true;
            cMTeTypes = iMessageTypes;

            WriteLine(MessageType.debug, "Debugger initialised to display '{0}' messages.", iMessageTypes.ToString());
        }
开发者ID:devoctomy,项目名称:AutoClose,代码行数:15,代码来源:BasicTextLogger.cs

示例9: GetMailMessageToSend

        public virtual MailMessage GetMailMessageToSend(MessageType messageType, string subject, object model, RecipientModel recipientModel)
        {
            var mailMessage = new MailMessage{Subject = subject};
            var mailAddress = new MailAddress(recipientModel.Email, recipientModel.FullName);
            mailMessage.To.Add(mailAddress);

            this.ViewData = new ViewDataDictionary(model);
            PopulateBody(mailMessage, viewName: messageType.ToString());

            return mailMessage;
        }
开发者ID:StuartLeitch,项目名称:MvcFrameworkTest,代码行数:11,代码来源:Mailer.cs

示例10: ShowMessage

 public void ShowMessage(MessageType messageType, string message, bool showAfterRedirect = false)
 {
     var messageTypeKey = messageType.ToString();
     if (showAfterRedirect)
     {
         this.TempData[messageTypeKey] = message;
     }
     else
     {
         this.ViewData[messageTypeKey] = message;
     }
 }
开发者ID:hahmed,项目名称:issue_tracker,代码行数:12,代码来源:ApplicationController.cs

示例11: Show

    public void Show(MessageType messageType, string message, int height, int width)
    {
        CloseButton.Visible = ShowCloseButton;
        litMessage.Text = message;

        MessageBox.Height = height;
        MessageBox.Width = width;
        MessageBox.CssClass = messageType.ToString().ToLower();

        ModalPopupExtenderMessage.Show();
        this.Visible = true;
    }
开发者ID:progressiveinfotech,项目名称:PRO-FY13-18_Habib-al-Mulla,代码行数:12,代码来源:MyMessageBox.ascx.cs

示例12: ShowMessage

 public static void ShowMessage(this Controller controller, MessageType messageType, string message, bool showAfterRedirect = false)
 {
     var messageTypeKey = messageType.ToString();
     if (showAfterRedirect)
     {
         controller.TempData[messageTypeKey] = message;
     }
     else
     {
         controller.ViewData[messageTypeKey] = message;
     }
 }
开发者ID:anandan,项目名称:Kendo,代码行数:12,代码来源:ControllerExtensions.cs

示例13: CreateMessage

        // Public methods.
        public static IMessage CreateMessage(MessageType type, MemoryStream stream, ILogger logger)
        {
            IMessage message = GenerateMessage(type);

            if (null != message) {
                message.SerializeFrom(stream);
            }
            else {
                logger.Error<MessageFactory>("Unable to serialize message of type {0} from {1}", type.ToString(), BitConverter.ToString(stream.GetBuffer()));
            }

            return message;
        }
开发者ID:saladyears,项目名称:SettlersOnline,代码行数:14,代码来源:MessageFactory.cs

示例14: BeginMessage

        public void BeginMessage(MessageType messageType)
        {
            Result = Message.Create(messageType);

            #if DEBUG
            var count = 2;
            if (messageType == MessageType.Request) count++;
            Debug.BeginStruct(count);
            Debug.BeginItem();
            Debug.WritePropertyName("messageType");
            Debug.WriteStringValue(messageType.ToString());
            Debug.EndItem();
            #endif
        }
开发者ID:flwn,项目名称:HmLib,代码行数:14,代码来源:MessageBuilder.cs

示例15: WriteErrorMessage

 public string WriteErrorMessage(MessageType errorType)
 {
     string str = _rm.GetString("ChartError_" + errorType.ToString());
     switch ( errorType )
     {
         case MessageType.NoStation:
             return String.Format(str, _stName);
         case MessageType.NoStationVariable:
             return String.Format(str, _stName, _varName);
         default:
             break;
     }
     return str;
 }
开发者ID:jirikadlec2,项目名称:hydrodata,代码行数:14,代码来源:MessageWriter.cs


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