Class DialogUtils
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
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:
- show a Yes/No message box with text messageBoxText and caption messageBoxCaption.
- 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
AskUserWhetherToDoThingwhether to ask user
messageBoxText
stringtext of message box (if and only if askUser = ASK_BEFORE_DOING
messageBoxCaption
stringcaption of message box (if and only if askUser = ASK_BEFORE_DOING
Returns
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
ColourA Colour representing a 24-bit opaque color.
alpha
intThe alpha component of the returned Color.
Returns
GetColorAlpha(uint)
Gets a translucent Color from the alpha component and RGB values of value
.
public static Color GetColorAlpha(uint value)
Parameters
value
uintA 32-bit color value in ABGR format.
Returns
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