Skip to content

Commit

Permalink
Add constructor with ToastType only
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Phillips authored and Nathan Phillips committed Jan 7, 2025
1 parent a0c46e6 commit 264cdf9
Showing 1 changed file with 15 additions and 35 deletions.
50 changes: 15 additions & 35 deletions blazorbootstrap/Models/ToastMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,47 @@ public ToastMessage()
Id = Guid.NewGuid();
}

public ToastMessage(ToastType type, string message)
public ToastMessage(ToastType type)
: this()
{
Id = Guid.NewGuid();
Type = type;
}

public ToastMessage(ToastType type, string message)
: this(type)
{
Message = message;
}

public ToastMessage(ToastType type, string title, string message)
: this(type, message)
{
Id = Guid.NewGuid();
Type = type;
Title = title;
Message = message;
}

public ToastMessage(ToastType type, IconName iconName, string title, string message)
: this(type, title, message)
{
Id = Guid.NewGuid();
Type = type;
IconName = iconName;
Title = title;
Message = message;
}

public ToastMessage(ToastType type, string customIconName, string title, string message)
: this(type, title, message)
{
Id = Guid.NewGuid();
Type = type;
CustomIconName = customIconName;
Title = title;
Message = message;
}

public ToastMessage(ToastType type, IconName iconName, string title, string helpText, string message)
public ToastMessage(ToastType type, IconName iconName, string title, string helpText, string message, bool autoHide = false)
: this(type, iconName, title, message)
{
Id = Guid.NewGuid();
Type = type;
IconName = iconName;
Title = title;
HelpText = helpText;
Message = message;
}

public ToastMessage(ToastType type, string customIconName, string title, string helpText, string message)
{
Id = Guid.NewGuid();
Type = type;
CustomIconName = customIconName;
Title = title;
HelpText = helpText;
Message = message;
AutoHide = autoHide;
}

public ToastMessage(ToastType type, string customIconName, string title, string helpText, string message, bool autoHide)
public ToastMessage(ToastType type, string customIconName, string title, string helpText, string message, bool autoHide = false)
: this(type, customIconName, title, message)
{
Id = Guid.NewGuid();
Type = type;
CustomIconName = customIconName;
Title = title;
HelpText = helpText;
Message = message;
AutoHide = autoHide;
}

Expand Down

0 comments on commit 264cdf9

Please sign in to comment.