Table of Contents

Class AppUtils

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

General application utility methods.

public static class AppUtils
Inheritance
AppUtils

Fields

OpenUrlOverride

Gets or sets a function that opens a URL in the default browser. This function can be used to override the default behavior and is called when OpenUrl(string?) is invoked.

Properties

FirstWindowChildOrEmpty

Gets first child of the first window or an empty control.

FrameworkIdentifier

Gets identifier for the net framework used in the application.

Methods

CreateFirstWindowClone(bool)

Creates clone of the first window and optionally shows it on the screen.

CreateMainWindowClone(bool)

Creates clone of the main window and optionally shows it on the screen.

ExecuteApp(string, string, string?, bool, bool)

Executes application with the specified parameters.

ExecuteTerminalCommand(string, string?, bool, bool)

Executes terminal command redirecting output and error streams to Log(object?, LogItemKind).

GetMyTargetFrameworkName()

Gets this application target framework in the form like 'net8.0' or 'net462'.

GetUIVersion()

Gets library version as string.

OpenLogFile()

Opens log file LogFilePath in the default editor of the operating system.

OpenTerminalAndRunCommand(string?, string?)

Opens terminal and runs command there.

OpenTerminalAndRunEcho(string)

Opens terminal and runs 'echo' command with the specified text string there.

OpenUrl(string?)

Opens url in the default browser.

ProcessStart(string, string?, string?)

Uses Process to start the application.

ProcessStartEx(ProcessStartInfo)

Uses Process to start the application.

RepeatAction(int, Action)

Repeats action specified number of times.

SegmentAndQuoteCommandLine(string?)

Splits command line string into array and adds double quotes to the elements if they contain spaces.

SegmentCommandLine(string?, bool)

Splits command line string into array.

SetSystemAppearanceIfDebug()

Sets the application's appearance to match the system appearance if the application is running in debug mode and a debugger is attached. Also sets the appearance to dark mode if the command line argument is specified to enable dark mode.

ShellExecute(string?, string?, string?)