예제 #1
0
 public static void SetToaster(IMatToaster toaster)
 {
     if (_toaster == null)
     {
         _toaster = toaster;
     }
 }
예제 #2
0
 public GenerateReportAction(EtherClient client, NavigationManager uriHelper, IMatToaster toaster, ILogger <GenerateReportAction> logger)
 {
     _client     = client;
     _navigation = uriHelper;
     _toaster    = toaster;
     _logger     = logger;
 }
예제 #3
0
 public static void AddErrors(this IMatToaster toaster, IEnumerable <string> errors)
 {
     foreach (var error in errors)
     {
         toaster.Add(error, MatToastType.Danger);
     }
 }
예제 #4
0
 public UserService(HttpClient httpClient
                    , IMatToaster Toaster
                    , NavigationManager NavigationManager)
 {
     _NavigationManager = NavigationManager;
     _Toaster           = Toaster;
     _httpClient        = httpClient;
 }
 public SignalRService(IMatToaster toaster, IConfiguration configuration, IAccessTokenProvider tokenProvider, SignOutSessionStateManager sessionStateManager, NavigationManager navigationManager)
 {
     _toaster             = toaster ?? throw new ArgumentNullException();
     _configurtion        = configuration ?? throw new ArgumentNullException();
     _tokenProvider       = tokenProvider;
     _sessionStateManager = sessionStateManager;
     _navigationManager   = navigationManager;
 }
예제 #6
0
 public EtherClient(HttpClient httpClient, NavigationManager navigation, IMatToaster toaster, ILogger <EtherClient> logger)
 {
     // WebAssemblyHttpMessageHandler.DefaultCredentials = FetchCredentialsOption.Include;
     _httpClient            = httpClient;
     _navigation            = navigation;
     _toaster               = toaster;
     _logger                = logger;
     httpClient.BaseAddress = GetApiUrl();
 }
예제 #7
0
 public static void NotifyResult(this IMatToaster toaster, Result result, string dataName)
 {
     if (result.OperationPass)
     {
         toaster.NotifySuccess("Modification effectuée", dataName + " sauvegardé avec succès");
     }
     else
     {
         toaster.NotifyFail("Echec de la modification", dataName + " n'a pu être modifié." + "\n\r" + result.ErrorMessage);
     }
 }
 public AuthService(HttpClient httpClient, ILocalStorageService localStorageService
                    , NavigationManager NavigationManager
                    , AuthenticationStateProvider authenticationStateProvider
                    , IMatToaster Toaster)
 {
     _Toaster = Toaster;
     _authenticationStateProvider = authenticationStateProvider;
     _NavigationManager           = NavigationManager;
     _httpClient          = httpClient;
     _localStorageService = localStorageService;
 }
예제 #9
0
 public SharedTools(IMatToaster toast,
                    ILocalStorageService localStorage,
                    ISessionStorageService sessionStorage,
                    NavigationManager uriHelper,
                    SessionManager session)
 {
     Toast          = toast;
     LocalStorage   = localStorage;
     SessionStorage = sessionStorage;
     UriHelper      = uriHelper;
     Session        = session;
 }
예제 #10
0
 public ErrorSuccesApiHandler(
     IBaseApi apiClient,
     INotificationsService notificationsService,
     IAuthService authService,
     IMatToaster matToaster,
     ILogger <ErrorSuccesApiHandler> logger)
 {
     _apiClient            = apiClient;
     _notificationsService = notificationsService;
     _authService          = authService;
     _matToaster           = matToaster;
     _logger = logger;
 }
예제 #11
0
        /// <summary>
        ///     Displays a notification with information about successful encryption or decryption.
        /// </summary>
        /// <param name="notification"></param>
        /// <param name="crypt">Mode of text conversion(encryption or decryption).</param>
        /// <exception cref="ArgumentOutOfRangeException">Unknown conversion mode.</exception>
        public static void ShowSuccessCrypt(this IMatToaster notification, Cipher.CryptMode crypt)
        {
            switch (crypt)
            {
            case Cipher.CryptMode.Decrypt:
                notification.Add("The text has been successfully decrypted.", MatToastType.Success, "Successfully");
                break;

            case Cipher.CryptMode.Encrypt:
                notification.Add("The text has been successfully encrypted.", MatToastType.Success, "Successfully");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(crypt), crypt, null);
            }
        }
예제 #12
0
 public static async Task CatchAndDisplayErrors(this IMatToaster matToaster, Func <Task> action)
 {
     try
     {
         await action();
     }
     catch (AccessTokenNotAvailableException exception)
     {
         exception.Redirect();
     }
     catch (BussinessException ex)
     {
         matToaster.Add(
             message: ex.GetErrorMessage(),
             type: MatToastType.Danger,
             title: "Operation Failed");
     }
 }
예제 #13
0
 /// <summary>
 ///     Displays a notification with information about successful file upload.
 /// </summary>
 /// <param name="notification"></param>
 public static void ShowSuccessUploading(this IMatToaster notification)
 {
     notification.Add("The file was uploaded successfully.", MatToastType.Success, "Successfully");
 }
예제 #14
0
 public static void NotifyFail(this IMatToaster toaster, string title, string message)
 {
     toaster.Add(message, MatToastType.Danger, title);
 }
예제 #15
0
 public FetchPullRequests(EtherClient client, IMatToaster toaster)
 {
     _client  = client;
     _toaster = toaster;
 }
예제 #16
0
 public PoopersViewModel(HttpClientService httpClientService, IMatToaster toaster)
 {
     m_httpClientService = httpClientService;
     m_toaster           = toaster;
 }
예제 #17
0
 public UserService(UserRepository userRepo, IMatToaster toaster)
 {
     _userRepo = userRepo;
     Toaster   = toaster;
 }
예제 #18
0
 public ViewNotifier(IMatToaster matToaster)
 {
     this.matToaster = matToaster;
 }
예제 #19
0
 public static void NotifySuccess(this IMatToaster toaster, string title, string message)
 {
     toaster.Add(message, MatToastType.Success, title);
 }
예제 #20
0
 /// <summary>
 ///     Display a notification with information about the error.
 /// </summary>
 /// <param name="notification"></param>
 /// <param name="errorMessage">Text of the error that will be displayed inside the notification.</param>
 public static void ShowError(this IMatToaster notification, string errorMessage)
 {
     notification.Add(errorMessage, MatToastType.Danger, "Error");
 }
예제 #21
0
 public ToasterService(IMatToaster toaster)
 {
     _toaster = toaster;
 }
예제 #22
0
 public FetchWorkItems(EtherClient client, IMatToaster toaster)
 {
     _client  = client;
     _toaster = toaster;
 }
예제 #23
0
 public static void ShowSuccessSending(this IMatToaster notification)
 {
     notification.Add("The message was sent successfully!", MatToastType.Success, "Successfully");
 }
예제 #24
0
 public HelperService(NavigationManager navigationManager, IMatToaster toaster)
 {
     this._navigationManager = navigationManager;
     this._toaster           = toaster;
 }
예제 #25
0
 public DeleteProfile(EtherClient client, IMatToaster toaster)
 {
     _client  = client;
     _toaster = toaster;
 }
예제 #26
0
 public DeleteRepository(EtherClient client, IMatToaster toaster)
 {
     _client  = client;
     _toaster = toaster;
 }