C# Класс PowerArgs.Cli.FocusManager

A class that manages the focus of a CLI application
Наследование: ObservableObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( ConsoleControl c ) : void

Adds the current control to the current focus context

ClearFocus ( ) : void

Clears the focus, but preserves the focus index

FocusManager ( ) : System

Initializes the focus manager

Pop ( ) : void

Pops the current focus context. This should be called if you've implemented a modal dialog like experience and your dialog has just closed. Pop() will automatically restore focus on the previous context.

Push ( ) : void

Pushes a new focus context onto the stack. This is useful, for example, when a dialog appears above all other controls and you want to limit focus to the dialog to acheive a modal affect. You must remember to call pop when your context ends.

Remove ( ConsoleControl c ) : void

Removes the control from all focus contexts

TryMoveFocus ( bool forward = true ) : bool

Tries to move the focus forward or backwards

TryRestoreFocus ( ) : bool

Tries to restore the focus on the given context

TrySetFocus ( ConsoleControl newFocusControl ) : bool

Tries to set focus on the given control.

Приватные методы

Метод Описание
CycleFocusIndex ( bool forward ) : bool

Описание методов

Add() публичный Метод

Adds the current control to the current focus context
public Add ( ConsoleControl c ) : void
c ConsoleControl The control to add
Результат void

ClearFocus() публичный Метод

Clears the focus, but preserves the focus index
public ClearFocus ( ) : void
Результат void

FocusManager() публичный Метод

Initializes the focus manager
public FocusManager ( ) : System
Результат System

Pop() публичный Метод

Pops the current focus context. This should be called if you've implemented a modal dialog like experience and your dialog has just closed. Pop() will automatically restore focus on the previous context.
public Pop ( ) : void
Результат void

Push() публичный Метод

Pushes a new focus context onto the stack. This is useful, for example, when a dialog appears above all other controls and you want to limit focus to the dialog to acheive a modal affect. You must remember to call pop when your context ends.
public Push ( ) : void
Результат void

Remove() публичный Метод

Removes the control from all focus contexts
public Remove ( ConsoleControl c ) : void
c ConsoleControl The control to remove
Результат void

TryMoveFocus() публичный Метод

Tries to move the focus forward or backwards
public TryMoveFocus ( bool forward = true ) : bool
forward bool If true then the manager will try to move forwards, otherwise backwards
Результат bool

TryRestoreFocus() публичный Метод

Tries to restore the focus on the given context
public TryRestoreFocus ( ) : bool
Результат bool

TrySetFocus() публичный Метод

Tries to set focus on the given control.
public TrySetFocus ( ConsoleControl newFocusControl ) : bool
newFocusControl ConsoleControl the control to focus.
Результат bool