Tooark.Notifications
2.1.8
dotnet add package Tooark.Notifications --version 2.1.8
NuGet\Install-Package Tooark.Notifications -Version 2.1.8
<PackageReference Include="Tooark.Notifications" Version="2.1.8" />
<PackageVersion Include="Tooark.Notifications" Version="2.1.8" />
<PackageReference Include="Tooark.Notifications" />
paket add Tooark.Notifications --version 2.1.8
#r "nuget: Tooark.Notifications, 2.1.8"
#:package Tooark.Notifications@2.1.8
#addin nuget:?package=Tooark.Notifications&version=2.1.8
#tool nuget:?package=Tooark.Notifications&version=2.1.8
Tooark.Notifications
Biblioteca para criação e gerenciamento de notificações e alertas, facilitando a comunicação e monitoramento para projetos .NET.
Conteúdo
Classes
As classes disponíveis são:
1. Item de Notificação
Funcionalidade: Representa a estrutura de um item de notificação com código de erro, chave e mensagem.
Propriedades:
Code
: O código de erro da notificação.Key
: A chave da notificação.Message
: A mensagem da notificação.
Métodos:
NotificationItem(string message)
: Cria uma nova instância deNotificationItem
com uma mensagem.NotificationItem(string message, string key)
: Cria uma nova instância deNotificationItem
com uma chave e uma mensagem.NotificationItem(string message, string key, string code)
: Cria uma nova instância deNotificationItem
com um código, uma chave e uma mensagem.ToString()
: Retorna a representação da instância deNotificationItem
como uma string.string
: Converte implicitamente a instância deNotificationItem
para uma string.NotificationItem
: Converte implicitamente uma string para uma instância deNotificationItem
.
2. Notificação
Funcionalidade: Representa uma classe abstrata que gerencia uma lista de notificações.
Propriedades:
Notifications
: Retorna a lista de notificações.IsValid
: Retorna True se a lista de notificações estiver vazia.Count
: Retorna o tamanho da lista de notificações.Codes
: Retorna a lista de códigos de erros das notificações.Keys
: Retorna a lista de chaves das notificações.Messages
: Retorna a lista de mensagens das notificações.
Métodos:
AddNotification(NotificationItem notification)
: Adiciona item de notificação à lista de notificações com base em um item de notificação.AddNotification(Type property, string message)
: Adiciona item de notificação à lista de notificações com base em uma propriedade e uma mensagem.AddNotification(Type property, string message, string code)
: Adiciona item de notificação à lista de notificações com base em uma propriedade, uma mensagem e um código de erro.AddNotification(string message, string key)
: Adiciona item de notificação à lista de notificações com base em uma mensagem e uma chave.AddNotification(string message, string key, string code)
: Adiciona item de notificação à lista de notificações com base em uma mensagem, uma chave e um código de erro.AddNotifications(ICollection<NotificationItem> notifications)
: Adiciona uma coleção de notificações à lista de notificações com base em uma coleção de itens de notificação.AddNotifications(Notification notification)
: Adiciona a lista de notificações de uma notificação à lista de notificações com base em uma notificação.AddNotifications(params Notification[] notifications)
: Adiciona uma coleção de notificações à lista de notificações com base em uma coleção de notificações.Clear()
: Limpa a lista de notificações.
Exemplo de Uso
Item de Notificação
// Exemplo de uso
var notification1 = new NotificationItem("Mensagem de exemplo");
var notification2 = new NotificationItem("Mensagem de exemplo", "ChaveExemplo");
var notification3 = new NotificationItem("Mensagem de exemplo", "ChaveExemplo", "T.ERR");
Notificação
// Exemplo de uso
public class MyNotification : Notification
{
public void NotifyError(string message)
{
AddNotification(new NotificationItem("Error", message, "XPTO1"));
}
}
var myNotification = new MyNotification();
myNotification.NotifyError("Ocorreu um erro.");
var isValid = myNotification.IsValid; // False
var count = myNotification.Count; // 1
var codes = myNotification.Codes; // ["XPTO1"]
var keys = myNotification.Keys; // ["Error"]
var messages = myNotification.Messages; // ["Ocorreu um erro."]
var notifications = myNotification.Notifications; // [NotificationItem("Error", "Ocorreu um erro.", "XPTO1")]
Contribuição
Contribuições são bem-vindas! Sinta-se à vontade para abrir issues e pull requests no repositório Tooark.Notifications.
Licença
Este projeto está licenciado sob a licença BSD 3-Clause. Veja o arquivo LICENSE para mais detalhes.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Tooark.Notifications:
Package | Downloads |
---|---|
Tooark.Validations
Package for managing validations and standards for .NET applications. |
|
Tooark.Exceptions
Package for creating exceptions for .NET applications. |
|
Tooark.Entities
Package for managing base entities in .NET applications. |
|
Tooark.Dtos
Package for managing base DTOs in .NET applications. |
|
Tooark
Package with all Tooark resources for .NET applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.1.8 | 293 | 6/26/2025 |
2.1.7 | 295 | 6/17/2025 |
2.1.6 | 445 | 6/15/2025 |
2.1.5 | 211 | 6/14/2025 |
2.1.4 | 201 | 6/3/2025 |
2.1.3.3 | 203 | 6/3/2025 |
2.1.3.2 | 202 | 6/3/2025 |
2.1.3 | 190 | 6/3/2025 |
2.1.2 | 316 | 5/17/2025 |
2.1.1 | 139 | 5/3/2025 |
2.1.0 | 143 | 5/3/2025 |
2.0.8 | 158 | 4/26/2025 |
2.0.7 | 241 | 4/22/2025 |
2.0.6 | 241 | 4/20/2025 |
2.0.5 | 234 | 3/14/2025 |
2.0.4 | 549 | 3/14/2025 |
2.0.3 | 217 | 3/14/2025 |
2.0.2 | 218 | 3/13/2025 |
2.0.1 | 204 | 3/13/2025 |
2.0.0 | 483 | 3/13/2025 |