예제 #1
0
        private async Task ShowInternalAsync(CurrencyName dialog, string errorMessage)
        {
            dialog.ErrorMessage = errorMessage;

            ContentDialogResult result = await dialog.ShowAsync();

            if ((result == ContentDialogResult.Primary || dialog.IsEnterPressed) && !String.IsNullOrEmpty(dialog.UniqueCode))
            {
                await commandDispatcher.HandleAsync(new CreateCurrency(dialog.UniqueCode, dialog.Symbol));
            }
        }
예제 #2
0
        private async Task ShowInternalAsync(CurrencyName dialog, string errorMessage)
        {
            dialog.ErrorMessage = errorMessage;

            ContentDialogResult result = await dialog.ShowAsync();

            if ((result == ContentDialogResult.Primary || dialog.IsEnterPressed) && !String.IsNullOrEmpty(dialog.UniqueCode))
            {
                try
                {
                    // TODO: Not working after rewrite to commands.
                    await commandDispatcher.HandleAsync(new CreateCurrency(dialog.UniqueCode, dialog.Symbol));
                }
                catch (CurrencyAlreadyExistsException)
                {
                    await ShowInternalAsync(dialog, messageBuilder.CurrencyAlreadyExists(dialog.UniqueCode));
                }
            }
        }