From 0cb2335b48ed1ab155138d8a504267d9f88db236 Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 1 Apr 2014 15:20:50 +0900 Subject: [PATCH] Fix a few for Example3 --- Example3/Chat.cs | 5 +++-- Example3/Echo.cs | 4 ++-- Example3/Program.cs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Example3/Chat.cs b/Example3/Chat.cs index 77a67879..06d1c536 100644 --- a/Example3/Chat.cs +++ b/Example3/Chat.cs @@ -19,12 +19,13 @@ namespace Example3 public Chat (string prefix) { - _prefix = prefix ?? "anon#"; + _prefix = !prefix.IsNullOrEmpty () ? prefix : "anon#"; } private string getName () { - return Context.QueryString ["name"] ?? (_prefix + getNum ()); + var name = Context.QueryString ["name"]; + return !name.IsNullOrEmpty () ? name : (_prefix + getNum ()); } private static int getNum () diff --git a/Example3/Echo.cs b/Example3/Echo.cs index a6c5569b..a682027e 100644 --- a/Example3/Echo.cs +++ b/Example3/Echo.cs @@ -10,8 +10,8 @@ namespace Example3 { var name = Context.QueryString ["name"]; var msg = !name.IsNullOrEmpty () - ? String.Format ("'{0}' to {1}", e.Data, name) - : e.Data; + ? String.Format ("'{0}' to {1}", e.Data, name) + : e.Data; Send (msg); } diff --git a/Example3/Program.cs b/Example3/Program.cs index d0c4b3a1..eb22301d 100644 --- a/Example3/Program.cs +++ b/Example3/Program.cs @@ -16,7 +16,7 @@ namespace Example3 _httpsv = new HttpServer (4649); //_httpsv = new HttpServer (4649, true); // For Secure Connection #if DEBUG - // Changing logging level + // Changing the logging level _httpsv.Log.Level = LogLevel.Trace; #endif /* For Secure Connection @@ -39,7 +39,7 @@ namespace Example3 // Not to remove inactive clients in WebSocket services periodically //_httpsv.KeepClean = false; - // Setting document root path + // Setting the document root path _httpsv.RootPath = ConfigurationManager.AppSettings ["RootPath"]; // Setting HTTP method events