當前位置: 首頁>>代碼示例>>C#>>正文


C# Logger.Report方法代碼示例

本文整理匯總了C#中System.Logger.Report方法的典型用法代碼示例。如果您正苦於以下問題:C# Logger.Report方法的具體用法?C# Logger.Report怎麽用?C# Logger.Report使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Logger的用法示例。


在下文中一共展示了Logger.Report方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ParseColors

		    public ParseColors(Environments env, Logger log) {
                this.env = env;
			    if (!File.Exists(env.ROOT + "lib" + env.DELIM + "colors.csv")) {
				    log.Report(2, "ParseColors", "File colors.csv does not exist");
				    return;
			    }
		    }
開發者ID:Ghost53574,項目名稱:CSdk,代碼行數:7,代碼來源:ParseColors.cs

示例2: Database

		    public Database(Environments env) {
                log = new Logger(env);
                this.env = env;
                db = String.Format("{0}dat{1}store",env.ROOT,env.DELIM);
			    log.Report(0, "Database", "Creating DB");
			    Create();
			    Check();
		    }
開發者ID:Ghost53574,項目名稱:CSdk,代碼行數:8,代碼來源:Database.cs

示例3: Speaker

        public Speaker(Language.Country language)
        {
            //ensure bools are defaulted to off.
                        AsyncMode = false;
                        UseSSML = false;

                        _language = language;
                        ss = new SpeechSynthesizer();
                        ss.SetOutputToDefaultAudioDevice();
                        try
                            {
                                if (UseSSML)
                                    {
                                        return;
                                    }
                                switch (_language)
                                    {
                                        case Language.Country.eng:
                                            ss.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-GB, Hazel)");
                                            break;
                                        case Language.Country.fin:
                                            ss.SelectVoice("Microsoft Server Speech Text to Speech Voice (fi-FI, Heidi)");
                                            break;
                                        case Language.Country.nor:
                                            ss.SelectVoice("Microsoft Server Speech Text to Speech Voice (nb-NO, Hulda)");
                                            break;
                                        case Language.Country.rus:
                                            ss.SelectVoice("Microsoft Server Speech Text to Speech Voice (ru-RU, Elena)");
                                            break;
                                        case Language.Country.swe:
                                            ss.SelectVoice("Microsoft Server Speech Text to Speech Voice (sv-SE, Hedvig)");
                                            break;
                                        default:
                                            ss.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-GB, Hazel)");
                                            break;
                                    }
                            }
                        catch (NullReferenceException e)
                            {
                                // Woop.
                                Logger logging = new Logger(true);
                                logging.Report(ToString(), e.StackTrace);
                                logging.Dispose();
                            }
        }
開發者ID:TommyAGK,項目名稱:Flex3,代碼行數:45,代碼來源:Speaker.cs

示例4: Speak

        //default the speed to "no change"
        public void Speak(string message, int speed = 0)
        {
            try
                            {
                                PromptBuilder builder = new PromptBuilder();
                                builder.AppendText(message);
                                //suddenly voices!
                                ss.Rate = speed;
                                if (UseSSML)
                                    {
                                        string ssmlString = "<speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\"";

                                        switch (_language)
                                            {
                                                case Language.Country.eng:
                                                    ssmlString += " xml:lang=\"en-GB\">";
                                                    break;
                                                case Language.Country.fin:
                                                    ssmlString += " xml:lang=\"fi-FI\">";
                                                    break;
                                                case Language.Country.nor:
                                                    ssmlString += " xml:lang=\"nb-NO\">";
                                                    break;
                                                case Language.Country.rus:
                                                    ssmlString += " xml:lang=\"ru-RU\">";
                                                    break;
                                                case Language.Country.swe:
                                                    ssmlString += " xml:lang=\"sv-SE\">";
                                                    break;
                                                default:
                                                    ssmlString += " xml:lang=\"en-GB\">";
                                                    break;
                                            }

                                        ssmlString += "<s>" + message + "</s/></speak>";

                                        if (AsyncMode)
                                            {
                                                ss.SpeakSsmlAsync(ssmlString);
                                            }
                                        else
                                            {
                                                ss.SpeakSsml(ssmlString);
                                            }
                                    }
                            }
                        catch (Exception e)
                            {
                                Logger logging = new Logger(true);
                                logging.Report(ToString(), e.StackTrace);
                                logging.Dispose();

                            }
        }
開發者ID:TommyAGK,項目名稱:Flex3,代碼行數:55,代碼來源:Speaker.cs


注:本文中的System.Logger.Report方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。