C# Класс RemoteLedMatrix.MainPage

Main page of the RemoteLedMatrix application. Contains the actual controls for the led matrix, as well as the settings bar and instance.
Наследование: Windows.UI.Xaml.Controls.Page
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
CurrentConnection RemoteLedMatrix.Helpers.Connection
Instance MainPage
IsInSettings bool
_isPreviewing bool

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

Метод Описание
CheckAlwaysRunning ( bool force = null ) : void

Tries to keep the machine from locking/sleeping by periodically making a DisplayRequest

Connect ( Connection selectedConnection ) : System.Threading.Tasks.Task

Connects to a remote device over firmata

Disconnect ( ) : void

Disconnects the current connection and cleans up any related objects

MainPage ( ) : System
PopulateList ( ) : void

Populates the list of connections in the settings UI

RefreshConnections ( ) : Task

Refreshes the connections from the available device sources

Защищенные методы

Метод Описание
OnNavigatedTo ( NavigationEventArgs e ) : void
OnNavigatingFrom ( NavigatingCancelEventArgs e ) : void

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

Метод Описание
Application_Resuming ( object sender, object o ) : void
Application_Suspending ( object sender, SuspendingEventArgs e ) : void
CaptureTimerTick ( object sender, object e ) : void

Performs a capture every timer tick, to provide continuous streaming

CleanupCameraAsync ( ) : System.Threading.Tasks.Task

Cleans up the camera resources (after stopping the preview if necessary) and unregisters from MediaCapture events

ConvertDisplayOrientationToDegrees ( DisplayOrientations orientation ) : int

Converts the given orientation of the app on the screen to the corresponding rotation in degrees

DisplayInformation_OrientationChanged ( DisplayInformation sender, object args ) : void

This event will fire when the page is rotated

Display_Tapped ( object sender, TappedRoutedEventArgs e ) : void

Display button tapped event handler

FindCameraDeviceByPanelAsync ( Windows.Devices.Enumeration.Panel desiredPanel ) : Task

Queries the available video capture devices to try and find one mounted on the desired panel

GetPreviewFrameAsSoftwareBitmapAsync ( ) : System.Threading.Tasks.Task

Gets the current preview frame as a SoftwareBitmap, displays its properties in a TextBlock, and can optionally display the image in the UI and/or save it to disk as a jpg

GetPreviewFrameButton_Tapped ( object sender, TappedRoutedEventArgs e ) : void
InitializeCameraAsync ( ) : System.Threading.Tasks.Task

Initializes the MediaCapture, registers events, gets camera device information for mirroring and rotating, and starts preview

MediaCapture_Failed ( MediaCapture sender, MediaCaptureFailedEventArgs errorEventArgs ) : void
OnConnectionEstablished ( ) : void

OnConnectionFailed ( string message ) : void

Handler for failed connection event, logs and displays a UI message

OnConnectionLost ( string message ) : void

Handler for lost connection event, logs and displays a UI message

PreviewButton_Checked ( object sender, RoutedEventArgs e ) : void
PreviewButton_Click ( object sender, RoutedEventArgs e ) : void

Handler for clicking the preview button

PreviewButton_Unchecked ( object sender, RoutedEventArgs e ) : void
SetPreviewRotationAsync ( ) : System.Threading.Tasks.Task

Gets the current orientation of the UI in relation to the device and applies a corrective rotation to the preview

SettingButton_Click ( object sender, RoutedEventArgs e ) : void

Handler for clicking the setting button

StartPreviewAsync ( ) : System.Threading.Tasks.Task

Starts the preview and adjusts it for for rotation and mirroring after making a request to keep the screen on and unlocks the UI

StopPreviewAsync ( ) : System.Threading.Tasks.Task

Stops the preview and deactivates a display request, to allow the screen to go into power saving modes, and locks the UI

TestButton_Click ( object sender, RoutedEventArgs e ) : void

Handler for clicking the test button

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

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

Tries to keep the machine from locking/sleeping by periodically making a DisplayRequest
public CheckAlwaysRunning ( bool force = null ) : void
force bool Forces the request, even if AlwaysRunning isn't set
Результат void

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

Connects to a remote device over firmata
public Connect ( Connection selectedConnection ) : System.Threading.Tasks.Task
selectedConnection RemoteLedMatrix.Helpers.Connection Connection to connect to
Результат System.Threading.Tasks.Task

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

Disconnects the current connection and cleans up any related objects
public Disconnect ( ) : void
Результат void

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

public MainPage ( ) : System
Результат System

OnNavigatedTo() защищенный Метод

protected OnNavigatedTo ( NavigationEventArgs e ) : void
e Windows.UI.Xaml.Navigation.NavigationEventArgs
Результат void

OnNavigatingFrom() защищенный Метод

protected OnNavigatingFrom ( NavigatingCancelEventArgs e ) : void
e Windows.UI.Xaml.Navigation.NavigatingCancelEventArgs
Результат void

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

Populates the list of connections in the settings UI
public PopulateList ( ) : void
Результат void

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

Refreshes the connections from the available device sources
public RefreshConnections ( ) : Task
Результат Task

Описание свойств

CurrentConnection публичное свойство

public Connection,RemoteLedMatrix.Helpers CurrentConnection
Результат RemoteLedMatrix.Helpers.Connection

Instance публичное статическое свойство

public static MainPage Instance
Результат MainPage

IsInSettings публичное свойство

public bool IsInSettings
Результат bool

_isPreviewing публичное свойство

public bool _isPreviewing
Результат bool