/// <summary> /// Constructor for a new Kato Sink. /// </summary> /// <param name="roomId">The Id that is obtained from the room you want the messages to show in.</param> /// <param name="name">The name that is used in the room.</param> /// <param name="renderer">The renderer that should be used for the message.</param> public KatoSink(string roomId, string name, KatoRenderer renderer) { if (String.IsNullOrWhiteSpace(roomId)) { throw new ArgumentException("roomId can not be null or empty", "roomId"); } if (!Regex.IsMatch(roomId, "^[a-f0-9]+$")) { throw new ArgumentException(String.Format("{0} is not a valid room Id.", roomId), "roomId"); } if (String.IsNullOrWhiteSpace(name)) { throw new ArgumentException("name can not be null or empty", "name"); } RoomId = roomId; Name = name; Renderer = renderer; _settings = new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), }; }
/// <summary> /// Constructor for a new Kato Sink. /// </summary> /// <param name="roomId">The Id that is obtained from the room you want the messages to show in.</param> /// <param name="name">The name that is used in the room.</param> /// <param name="renderer">The renderer that should be used for the message.</param> public KatoSink(string roomId, string name, KatoRenderer renderer) { if (String.IsNullOrWhiteSpace(roomId)) { throw new ArgumentException("roomId can not be null or empty", "roomId"); } if (!Regex.IsMatch(roomId, "^[a-f0-9]+$")) { throw new ArgumentException(String.Format("{0} is not a valid room Id.", roomId), "roomId"); } if (String.IsNullOrWhiteSpace(name)) { throw new ArgumentException("name can not be null or empty", "name"); } RoomId = roomId; Name = name; Renderer = renderer; _settings = new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver(), }; }