C# Класс VncSharpWpf.RemoteDesktopWpf

The RemoteDesktop control takes care of all the necessary RFB Protocol and GUI handling, including mouse and keyboard support, as well as requesting and processing screen updates from the remote VNC host. Most users will choose to use the RemoteDesktop control alone and not use any of the other protocol classes directly.
Наследование: System.Windows.Controls.UserControl
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
GetPassword AuthenticateDelegate

Private Properties

Свойство Тип Описание
ConvertKeyToAscii char
GetKeyboardLayout System.IntPtr
GetKeyboardState bool
InitializeComponent void
InsureConnection void
KeyDownEventHandler void
KeyUpEventHandler void
ManageKeyDownAndKeyUp void
MapVirtualKeyEx uint
MouseDownUpMoveEventHandler void
MouseWHeelEventHandler void
PressKeys void
SetState void
SizeChangedEventHandler void
System void
ToUnicodeEx int
UpdateRemotePointer void

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

Метод Описание
Authenticate ( string password ) : void

Authenticate with the VNC Host using a user supplied password.

Connect ( string host ) : void

Connect to a VNC Host and determine whether or not the server requires a password.

Connect ( string host, bool viewOnly ) : void

Connect to a VNC Host and determine whether or not the server requires a password.

Connect ( string host, bool viewOnly, bool scaled ) : void

Connect to a VNC Host and determine whether or not the server requires a password.

Connect ( string host, int display ) : void

Connect to a VNC Host and determine whether or not the server requires a password.

Connect ( string host, int display, bool viewOnly ) : void

Connect to a VNC Host and determine whether or not the server requires a password.

Connect ( string host, int display, bool viewOnly, bool scaled ) : void

Connect to a VNC Host and determine whether or not the server requires a password.

ConnectedFromServerEventHandler ( object sender, bool authentication ) : void

Event Handler for Event "ConnectedFromServer"

Disconnect ( ) : void

Stops the remote host from sending further updates and disconnects.

FillServerClipboard ( ) : void

Fills the remote server's clipboard with the text in the client's clipboard, if any.

FillServerClipboard ( string text ) : void

Fills the remote server's clipboard with text.

FullScreenUpdate ( ) : void

Get a complete update of the entire screen from the remote host.

You should allow users to call FullScreenUpdate in order to correct corruption of the local image. This will simply request that the next update be for the full screen, and not a portion of it. It will not do the update while blocking.

Listen ( string host, int port = 5500, bool viewOnly = false, bool scaled = false ) : void

Wait for a connection from VNC Server.

RemoteDesktopWpf ( ) : System
SendSpecialKeys ( SpecialKeys keys ) : void

Sends a keyboard combination that would otherwise be reserved for the client PC.

Keyboard combinations are Pressed and then Released, while single keys (e.g., SpecialKeys.Ctrl) are only pressed so that subsequent keys will be modified.

SendSpecialKeys ( SpecialKeys keys, bool release ) : void

Sends a keyboard combination that would otherwise be reserved for the client PC.

Keyboard combinations are Pressed and then Released, while single keys (e.g., SpecialKeys.Ctrl) are only pressed so that subsequent keys will be modified.

SetInputMode ( bool viewOnly ) : void

Changes the input mode to view-only or interactive.

SetScalingMode ( bool scaled ) : void

Set the remote desktop's scaling mode.

StopListen ( ) : void

Stop Listening.

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

Метод Описание
Initialize ( ) : void

After protocol-level initialization and connecting is complete, the local GUI objects have to be set-up, and requests for updates to the remote host begun.

OnClipboardChanged ( ) : void
OnConnectComplete ( ConnectEventArgs e ) : void

Dispatches the ConnectComplete event if any targets have registered.

OnConnectionLost ( ) : void

Dispatches the ConnectionLost event if any targets have registered.

OnStoppedListen ( ) : void
SetupDesktop ( ) : void

Creates and initially sets-up the local bitmap that will represent the remote desktop image.

VncClientConnectionLost ( object sender, EventArgs e ) : void

RemoteDesktop listens for ConnectionLost events from the VncClient object.

VncServerCutText ( object sender, EventArgs e ) : void
VncUpdate ( object sender, VncEventArgs e ) : void

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

Метод Описание
ConvertKeyToAscii ( Key key ) : char

Convert Key to Ascii Character.

GetKeyboardLayout ( uint idThread ) : IntPtr
GetKeyboardState ( byte lpKeyState ) : bool
InitializeComponent ( ) : void
InsureConnection ( bool connected ) : void

Insures the state of the connection to the server, either Connected or Not Connected depending on the value of the connected argument.

KeyDownEventHandler ( object sender, System.Windows.Input.KeyEventArgs e ) : void
KeyUpEventHandler ( object sender, System.Windows.Input.KeyEventArgs e ) : void
ManageKeyDownAndKeyUp ( System.Windows.Input.KeyEventArgs e, bool isDown ) : void
MapVirtualKeyEx ( uint uCode, uint uMapType, IntPtr dwhkl ) : uint
MouseDownUpMoveEventHandler ( object sender, MouseEventArgs e ) : void
MouseWHeelEventHandler ( object sender, System.Windows.Input.MouseWheelEventArgs e ) : void
PressKeys ( uint keys, bool release ) : void

Given a list of keysym values, sends a key press for each, then a release.

SetState ( RuntimeState newState ) : void
SizeChangedEventHandler ( object sender, RoutedEventArgs e ) : void

EventHandler for Image Size Change

System ( int connectionId, object target ) : void
ToUnicodeEx ( uint wVirtKey, uint wScanCode, byte lpKeyState, [ pwszBuff, int cchBuff, uint wFlags, IntPtr dwhkl ) : int
UpdateRemotePointer ( ) : void

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

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

Authenticate with the VNC Host using a user supplied password.
Thrown if the RemoteDesktop control is already Connected. See . Thrown if the password is null.
public Authenticate ( string password ) : void
password string The user's password.
Результат void

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

Connect to a VNC Host and determine whether or not the server requires a password.
Thrown if host is null. Thrown if display is negative. Thrown if the RemoteDesktop control is already Connected. See .
public Connect ( string host ) : void
host string The IP Address or Host Name of the VNC Host.
Результат void

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

Connect to a VNC Host and determine whether or not the server requires a password.
Thrown if host is null. Thrown if display is negative. Thrown if the RemoteDesktop control is already Connected. See .
public Connect ( string host, bool viewOnly ) : void
host string The IP Address or Host Name of the VNC Host.
viewOnly bool Determines whether mouse and keyboard events will be sent to the host.
Результат void

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

Connect to a VNC Host and determine whether or not the server requires a password.
Thrown if host is null. Thrown if display is negative. Thrown if the RemoteDesktop control is already Connected. See .
public Connect ( string host, bool viewOnly, bool scaled ) : void
host string The IP Address or Host Name of the VNC Host.
viewOnly bool Determines whether mouse and keyboard events will be sent to the host.
scaled bool Determines whether to use desktop scaling or leave it normal and clip.
Результат void

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

Connect to a VNC Host and determine whether or not the server requires a password.
Thrown if host is null. Thrown if display is negative. Thrown if the RemoteDesktop control is already Connected. See .
public Connect ( string host, int display ) : void
host string The IP Address or Host Name of the VNC Host.
display int The Display number (used on Unix hosts).
Результат void

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

Connect to a VNC Host and determine whether or not the server requires a password.
Thrown if host is null. Thrown if display is negative. Thrown if the RemoteDesktop control is already Connected. See .
public Connect ( string host, int display, bool viewOnly ) : void
host string The IP Address or Host Name of the VNC Host.
display int The Display number (used on Unix hosts).
viewOnly bool Determines whether mouse and keyboard events will be sent to the host.
Результат void

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

Connect to a VNC Host and determine whether or not the server requires a password.
Thrown if host is null. Thrown if display is negative. Thrown if the RemoteDesktop control is already Connected. See .
public Connect ( string host, int display, bool viewOnly, bool scaled ) : void
host string The IP Address or Host Name of the VNC Host.
display int The Display number (used on Unix hosts).
viewOnly bool Determines whether mouse and keyboard events will be sent to the host.
scaled bool Determines whether to use desktop scaling or leave it normal and clip.
Результат void

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

Event Handler for Event "ConnectedFromServer"
public ConnectedFromServerEventHandler ( object sender, bool authentication ) : void
sender object
authentication bool
Результат void

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

Stops the remote host from sending further updates and disconnects.
Thrown if the RemoteDesktop control is not already in the Connected state. See .
public Disconnect ( ) : void
Результат void

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

Fills the remote server's clipboard with the text in the client's clipboard, if any.
public FillServerClipboard ( ) : void
Результат void

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

Fills the remote server's clipboard with text.
public FillServerClipboard ( string text ) : void
text string The text to put in the server's clipboard.
Результат void

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

Get a complete update of the entire screen from the remote host.
You should allow users to call FullScreenUpdate in order to correct corruption of the local image. This will simply request that the next update be for the full screen, and not a portion of it. It will not do the update while blocking.
Thrown if the RemoteDesktop control is not in the Connected state. See .
public FullScreenUpdate ( ) : void
Результат void

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

After protocol-level initialization and connecting is complete, the local GUI objects have to be set-up, and requests for updates to the remote host begun.
Thrown if the RemoteDesktop control is already in the Connected state. See .
protected Initialize ( ) : void
Результат void

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

Wait for a connection from VNC Server.
public Listen ( string host, int port = 5500, bool viewOnly = false, bool scaled = false ) : void
host string Hostname or IP Address
port int Listening Port
viewOnly bool Set true if you use viewonly mode
scaled bool Set true if you use scaled mode
Результат void

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

protected OnClipboardChanged ( ) : void
Результат void

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

Dispatches the ConnectComplete event if any targets have registered.
Thrown if the RemoteDesktop control is not in the Connected state.
protected OnConnectComplete ( ConnectEventArgs e ) : void
e ConnectEventArgs A ConnectEventArgs object with information about the remote framebuffer's geometry.
Результат void

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

Dispatches the ConnectionLost event if any targets have registered.
Thrown if the RemoteDesktop control is in the Connected state.
protected OnConnectionLost ( ) : void
Результат void

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

protected OnStoppedListen ( ) : void
Результат void

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

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

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

Sends a keyboard combination that would otherwise be reserved for the client PC.
Keyboard combinations are Pressed and then Released, while single keys (e.g., SpecialKeys.Ctrl) are only pressed so that subsequent keys will be modified.
Thrown if the RemoteDesktop control is not in the Connected state.
public SendSpecialKeys ( SpecialKeys keys ) : void
keys SpecialKeys SpecialKeys is an enumerated list of supported keyboard combinations.
Результат void

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

Sends a keyboard combination that would otherwise be reserved for the client PC.
Keyboard combinations are Pressed and then Released, while single keys (e.g., SpecialKeys.Ctrl) are only pressed so that subsequent keys will be modified.
Thrown if the RemoteDesktop control is not in the Connected state.
public SendSpecialKeys ( SpecialKeys keys, bool release ) : void
keys SpecialKeys SpecialKeys is an enumerated list of supported keyboard combinations.
release bool
Результат void

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

Changes the input mode to view-only or interactive.
public SetInputMode ( bool viewOnly ) : void
viewOnly bool True if view-only mode is desired (no mouse/keyboard events will be sent).
Результат void

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

Set the remote desktop's scaling mode.
public SetScalingMode ( bool scaled ) : void
scaled bool Determines whether to use desktop scaling or leave it normal and clip.
Результат void

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

Creates and initially sets-up the local bitmap that will represent the remote desktop image.
Thrown if the RemoteDesktop control is not already in the Connected state. See .
protected SetupDesktop ( ) : void
Результат void

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

Stop Listening.
public StopListen ( ) : void
Результат void

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

RemoteDesktop listens for ConnectionLost events from the VncClient object.
protected VncClientConnectionLost ( object sender, EventArgs e ) : void
sender object The VncClient object that raised the event.
e System.EventArgs An empty EventArgs object.
Результат void

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

protected VncServerCutText ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

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

protected VncUpdate ( object sender, VncEventArgs e ) : void
sender object
e VncEventArgs
Результат void

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

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

Points to a Function capable of obtaining a user's password. By default this means using the PasswordDialog.GetPassword() function; however, users of RemoteDesktop can replace this with any function they like, so long as it matches the delegate type.
public AuthenticateDelegate GetPassword
Результат AuthenticateDelegate