Table of Contents

Class DialogUtils

Namespace
Npp.DotNet.Plugin.Winforms
Assembly
Npp.DotNet.Plugin.dll

Provides readonly access to Notepad++'s GUI connector, with some additional helper methods.

public static class DialogUtils
Inheritance
DialogUtils
Inherited Members

Properties

NotepadGUI

Connector to Notepad++'s GUI.

public static PluginDialogBase NotepadGUI { get; }

Property Value

PluginDialogBase

Methods

AskBeforeDoingSomething(AskUserWhetherToDoThing, string, string)

Based on the value of askUser, do one of three things:
DONT_DO_DONT_ASK: return false (don't do the thing)
ASK_BEFORE_DOING:

  1. show a Yes/No message box with text messageBoxText and caption messageBoxCaption.
  2. if and only if the user clicks Yes, return true.
    DO_WITHOUT_ASKING: return true (do the thing without asking)
public static bool AskBeforeDoingSomething(AskUserWhetherToDoThing askUser, string messageBoxText, string messageBoxCaption)

Parameters

askUser AskUserWhetherToDoThing

whether to ask user

messageBoxText string

text of message box (if and only if askUser = ASK_BEFORE_DOING

messageBoxCaption string

caption of message box (if and only if askUser = ASK_BEFORE_DOING

Returns

bool

GetColorAlpha(Colour, int)

Gets a translucent Color from the RGB values of rgb and the given alpha value.

public static Color GetColorAlpha(Colour rgb, int alpha = 255)

Parameters

rgb Colour

A Colour representing a 24-bit opaque color.

alpha int

The alpha component of the returned Color.

Returns

Color

GetColorAlpha(uint)

Gets a translucent Color from the alpha component and RGB values of value.

public static Color GetColorAlpha(uint value)

Parameters

value uint

A 32-bit color value in ABGR format.

Returns

Color

TryCopyToClipboard(string)

Trying to copy an empty string or null to the clipboard raises an error.
This shows a message box if the user tries to do that.

public static void TryCopyToClipboard(string text)

Parameters

text string