5cover/Dialogs

View on GitHub
Dialogs/Dialog.cs

Summary

Maintainability
A
1 hr
Test Coverage

Method Show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public ButtonBase? Show(nint hwnd)
    {
        if (CurrentPage.IsShown)
        {
            throw new InvalidOperationException("The dialog is already being shown.");
Severity: Minor
Found in Dialogs/Dialog.cs - About 1 hr to fix

    Method Callback has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Wontfix

        protected HRESULT Callback(HWND hwnd, TaskDialogNotification msg, nint wParam, nint lParam, nint refData)
    Severity: Minor
    Found in Dialogs/Dialog.cs - About 35 mins to fix

      Incorrect end of line character(s) found.
      Open

      namespace Scover.Dialogs;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      /// <summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      /// </summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <value>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// Could not show the dialog because Windows Task Dialogs require Windows Vista or later.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <inheritdoc cref="Show()"/>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <param name="hwnd">
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              CurrentPage.UpdateRequested += PerformUpdate;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <inheritdoc cref="TaskDialogCallbackProc"/>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Gets the current page.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// cref="WindowLocation.CenterScreen"/>.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  throw new PlatformNotSupportedException("Can't show the dialog becuase Windows Task Dialogs require Windows Vista or later.", e);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              return CurrentPage.HandleNotification(notif);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      public class Dialog
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// currently being displayed in the dialog.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Shows a modal dialog with the active window attached to the calling thread's message queue as a
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <exception cref="PlatformNotSupportedException">
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <exception cref="EntryPointNotFoundException">
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// One or more required <see langword="extern"/> functions could not be found.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      /// features than a message box.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              => CurrentPage = page;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Forcefully closes this dialog, ignoring navigation.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// When this method is called, the returned button of show methods will be <see cref="Button.Cancel"/>.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </param>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <inheritdoc cref="Show()"/>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              CurrentPage.IsShown = true;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                      TaskDialogIndirect(config, out int pnButton, out _, out _).ThrowIfFailed();
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      /// A dialog box that displays information and receives simple input from the user. Like a message box, it
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public nint Handle { get; protected set; }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public virtual void Close() => CurrentPage.Exit();
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      using Vanara.PInvoke;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      using static Vanara.PInvoke.ComCtl32;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <value>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </value>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// The <see cref="ButtonBase"/> that was clicked, or <see langword="null"/> if the dialog was closed
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <exception cref="System.ComponentModel.Win32Exception">
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Shows a dialog.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public Page CurrentPage { get; protected set; }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// The location of the dialog window when it is first shown. Default value is <see
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// parent.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <returns>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// programmatically.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </exception>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <param name="parent">The parent window to use.</param>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  using (new ComCtlV6ActivationContext())
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public ButtonBase? Show() => Show(ParentWindow.Active);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Shows a dialog.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              if (CurrentPage.IsShown)
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              Notification notif = new(msg, wParam, lParam);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public const char MnemonicPrefix = '&';
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public Dialog(Page page)
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <remarks>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              catch (EntryPointNotFoundException e) when (Environment.OSVersion.Platform != PlatformID.Win32NT || Environment.OSVersion.Version < new Version(6, 0, 6000))
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              finally
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  CurrentPage.UpdateRequested -= PerformUpdate;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </remarks>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public ButtonBase? Show(ParentWindow parent) => Show(parent.Hwnd);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          protected HRESULT Callback(HWND hwnd, TaskDialogNotification msg, nint wParam, nint lParam, nint refData)
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// If the dialog has not yet been shown, the first page of the dialog, otherwise the page that is
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public WindowLocation StartupLocation { get; set; }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                      return CurrentPage.GetClickedButton(pnButton);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          protected void PerformUpdate(Page sender, Action<PageUpdateInfo> update) => update(new(Handle));
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </exception>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </exception>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// The parent window handle. The dialog will be modal if the value differs from 0.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>The mnemonic (accelerator) prefix used by all dialog controls.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </value>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <exception cref="InvalidOperationException">The dialog is already being shown.</exception>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              var config = CurrentPage.SetupConfig(Callback, hwnd, StartupLocation);
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              try
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              {
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      /// is formatted by the operating system according to parameters you set. However, a dialog has many more
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <param name="page">The page of the dialog.</param>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// Gets the window handle of the dialog, or 0 if the dialog is currently not being shown.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// An error occured while displaying the dialog.
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Performs an update using <see cref="Handle"/>.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// <summary>Gets or sets the window startup location.</summary>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          public ButtonBase? Show(nint hwnd)
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              }
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

              Handle = hwnd.DangerousGetHandle();
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

          /// </returns>
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  throw new InvalidOperationException("The dialog is already being shown.");
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

                  CurrentPage.IsShown = false;
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      Incorrect end of line character(s) found.
      Open

      
      
      Severity: Minor
      Found in Dialogs/Dialog.cs by editorconfig

      There are no issues that match your filters.

      Category
      Status