-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from stavroskasidis/release/1.0
Release/1.0
- Loading branch information
Showing
101 changed files
with
3,128 additions
and
997 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace BlazorDialog | ||
{ | ||
internal class BlazorDialogStore : IBlazorDialogStore | ||
{ | ||
private Dictionary<string, Dialog> registeredDialogs = new Dictionary<string, Dialog>(); | ||
|
||
public Dialog GetById(string id) | ||
{ | ||
if (registeredDialogs.ContainsKey(id)) | ||
{ | ||
return registeredDialogs[id]; | ||
} | ||
|
||
throw new ArgumentException($"No dialog found for id '{id}'", nameof(id)); | ||
} | ||
|
||
public void Register(Dialog blazorDialog) | ||
{ | ||
if (blazorDialog?.Id == null) | ||
{ | ||
throw new ArgumentException("BlazorDialog Id is null", nameof(blazorDialog)); | ||
} | ||
registeredDialogs[blazorDialog.Id] = blazorDialog; | ||
} | ||
|
||
public void Unregister(Dialog blazorDialog) | ||
{ | ||
if (blazorDialog.Id != null && registeredDialogs.ContainsKey(blazorDialog.Id)) | ||
{ | ||
registeredDialogs.Remove(blazorDialog.Id); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.