Corrected some Sonar issues

Changed a little bit the Open and Set credentials User controls
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-02 14:21:59 +02:00
parent 7b88461333
commit 654bd6b4e5
16 changed files with 16 additions and 98 deletions

View File

@@ -1,20 +1,20 @@
namespace ModernKeePass.Common
{
public class Constants
public static class Constants
{
public class Navigation
public static class Navigation
{
public static string MainPage => nameof(MainPage);
public static string EntryPage => nameof(EntryPage);
public static string GroupPage => nameof(GroupPage);
}
public class File
public static class File
{
public static int OneMegaByte => 1048576;
}
public class Settings
public static class Settings
{
public static string SaveSuspend => nameof(SaveSuspend);
public static string Sample => nameof(Sample);

View File

@@ -1,56 +0,0 @@
using System;
using System.Threading.Tasks;
using Windows.UI.Popups;
namespace ModernKeePass.Common
{
public static class MessageDialogHelper
{
public static async Task ShowActionDialog(string title, string contentText, string actionButtonText, string cancelButtonText, UICommandInvokedHandler actionCommand, UICommandInvokedHandler cancelCommand)
{
// Create the message dialog and set its content
var messageDialog = CreateBasicDialog(title, contentText, cancelButtonText, cancelCommand);
// Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
messageDialog.Commands.Add(new UICommand(actionButtonText, actionCommand));
// Show the message dialog
await messageDialog.ShowAsync().AsTask().ConfigureAwait(false);
}
public static async Task ShowErrorDialog(Exception exception)
{
if (exception == null) return;
// Create the message dialog and set its content
var messageDialog = CreateBasicDialog(exception.Message, exception.StackTrace, "OK");
// Show the message dialog
await messageDialog.ShowAsync().AsTask().ConfigureAwait(false);
}
public static async Task ShowNotificationDialog(string title, string message)
{
var dialog = CreateBasicDialog(title, message, "OK");
// Show the message dialog
await dialog.ShowAsync().AsTask().ConfigureAwait(false);
}
private static MessageDialog CreateBasicDialog(string title, string message, string dismissActionText, UICommandInvokedHandler cancelCommand = null)
{
// Create the message dialog and set its content
var messageDialog = new MessageDialog(message, title);
// Add commands and set their callbacks
messageDialog.Commands.Add(new UICommand(dismissActionText, cancelCommand));
// Set the command that will be invoked by default
messageDialog.DefaultCommandIndex = 1;
// Set the command to be invoked when escape is pressed
messageDialog.CancelCommandIndex = 1;
return messageDialog;
}
}
}

View File

@@ -1,6 +1,4 @@
using ModernKeePass.Application.Database.Models;
namespace Messages
namespace Messages
{
public class DatabaseAlreadyOpenedMessage
{