25 lines
566 B
C#
25 lines
566 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace CustomComponents.Exceptions
|
|||
|
{
|
|||
|
public class ContentException : Exception
|
|||
|
{
|
|||
|
public ContentException(bool state) : base(CustomMessage(state)){ }
|
|||
|
|
|||
|
private static string CustomMessage(bool state)
|
|||
|
{
|
|||
|
if(state)
|
|||
|
{
|
|||
|
return "TextBox is empty however null flag is checked.";
|
|||
|
}
|
|||
|
|
|||
|
return "TextBox is empty. You better write something!";
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|