C# Класс MBC.App.WPF.FieldControl

The FieldControl class is a WPF control that graphically displays the state of a Field object. The FieldControl must be given the IBattleshipController index that is being displayed on this Field. Usage of this class is simple by utilizing three class members: SetController(int) - Sets the controller index in a Field. SetField(Field) - Sets the Field to display. UpdateFieldDisplay() - Updates the FieldControl to display the Field's current state.
Наследование: System.Windows.Controls.UserControl
Показать файл Открыть проект

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

Свойство Тип Описание
ControllerColorProperty System.Windows.DependencyProperty

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

Метод Описание
SetController ( int ibc ) : void
UpdateFieldDisplay ( ) : void

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

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

Creates the graphics that represent the ships that will be displayed. Internally used.

FieldControl ( ) : System
FieldLoaded ( object sender, RoutedEventArgs e ) : void

Invoked when the FieldControl has been loaded into the WPF interface.

LayShips ( ) : void

Sets the Rectangle objects that represent the ships that will be displayed. Internally used.

LayShots ( ) : void

Sets the Ellipse objects that represent the opponent controller's shots which will be displayed on the grid. Internally used.

MakeGrid ( int rows, int cols ) : void

Generates the WPF grid with a specified number of rows and columns. Internally used.

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

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

public SetController ( int ibc ) : void
ibc int
Результат void

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

public UpdateFieldDisplay ( ) : void
Результат void

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

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

The Color property that this FieldControl uses to display a certain controller.
public static DependencyProperty,System.Windows ControllerColorProperty
Результат System.Windows.DependencyProperty