Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constructor with ToastType only #993

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading