From 6f4a9c7f52bd6618aa29e66f3cd413d3621f7909 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 26 Jan 2022 19:37:19 +0900 Subject: [PATCH] [Modify] Replace it --- Example3/Chat.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Example3/Chat.cs b/Example3/Chat.cs index b1a3f4d7..2aee3e3a 100644 --- a/Example3/Chat.cs +++ b/Example3/Chat.cs @@ -12,13 +12,18 @@ namespace Example3 private string _prefix; public Chat () - : this (null) { + _prefix = "anon#"; } - public Chat (string prefix) - { - _prefix = !prefix.IsNullOrEmpty () ? prefix : "anon#"; + public string Prefix { + get { + return _prefix; + } + + set { + _prefix = !value.IsNullOrEmpty () ? value : "anon#"; + } } private string getName ()