C# Class RoverOperator.Content.GPSViewViewModel

Inheritance: INotifyPropertyChanged
Mostra file Open project: jpadillak/Concordia_Capstone2013-14 Class Usage Examples

Public Properties

Property Type Description
_addTargetCommand RelayCommand
_removeTargetCommand RelayCommand
canAddTarget bool
map MarsRover.Map

Public Methods

Method Description
GPSViewViewModel ( Dispatcher d ) : System
targetPin_MouseRightButtonUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Right click event to remove target (best way to do this even though using commands seems to be more elegant)

updateTargetDetails ( ) : void

Updates the information in the details view

Protected Methods

Method Description
OnPropertyChanged ( string name ) : void

Private Methods

Method Description
ExecuteAddTargetCommand ( ) : void

Add the target pin to target list

ExecuteRemoveTargetCommand ( ) : void

(DEPRECATED) Remove the target pin to target list

RefreshMap ( ) : void

Force map refresh when the rover pin gets updated.

UpdateGPS ( GPSCoordinates gpsCoordinates ) : void
addTarget ( MarsRover.Location targetLocation ) : void

Add a target to the map (triggered by Add button)

degreesToRadians ( double degrees ) : double

Convert degrees to radians

determineCanAddTarget ( ) : void

Decide whether or not to allow the command to execute

formatRoverPin ( ) : void

Change the style of the rover pin

formatTargetPin ( Pushpin targetPin ) : void

Change the style of the target pins

getDistance ( MarsRover.Location location1, MarsRover.Location location2 ) : double

Get distance in kilometers between two locations

removeTarget ( Pushpin targetToRemove ) : void

Remove target from map (triggered by right clocking on a pushpin)

setRoverPinLocation ( ) : void

(DEPRECATED) Binds the rover location data being sent by StatusUpdater to PushPin on the Map

updateRoverLocation ( ) : void

Update location of rover pin (triggered by the update of rovercoordinates

validateCoordinateString ( string coordinateString, double &coordinate ) : bool

Data validation on user entered coordinates

Method Details

GPSViewViewModel() public method

public GPSViewViewModel ( Dispatcher d ) : System
d System.Windows.Threading.Dispatcher
return System

OnPropertyChanged() protected method

protected OnPropertyChanged ( string name ) : void
name string
return void

targetPin_MouseRightButtonUp() public method

Right click event to remove target (best way to do this even though using commands seems to be more elegant)
public targetPin_MouseRightButtonUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
return void

updateTargetDetails() public method

Updates the information in the details view
public updateTargetDetails ( ) : void
return void

Property Details

_addTargetCommand public_oe property

public RelayCommand _addTargetCommand
return RelayCommand

_removeTargetCommand public_oe property

public RelayCommand _removeTargetCommand
return RelayCommand

canAddTarget public_oe property

public bool canAddTarget
return bool

map public_oe property

public Map,MarsRover map
return MarsRover.Map