C# Class RSSWeatherGraphicTracker.RSSWeather

Show file Open project: Esri/arcobjects-sdk-community-samples Class Usage Examples

Public Methods

Method Description
Init ( IBasicMap mapOrGlobe ) : void
RSSWeather ( ) : System
Remove ( ) : void
UpdateTracker ( WeatherItemEventArgs weatherItemInfo ) : void

Private Methods

Method Description
AddWeatherItem ( long zipCode, double Lat, double Lon ) : void

Makes a request against RSS Weather service and add update the table

CreateGeographicSpatialReference ( ) : ISpatialReference

create a WGS1984 geographic coordinate system. In this case, the underlying data provided by the service is in WGS1984.

DownloadIcon ( string iconPath, int &width, int &height ) : Bitmap

given a bitmap url, saves it on the local machine and returns its size

GetSymbol ( int iconCode, string iconPath ) : IGraphicTrackerSymbol

get the specified symbol from the symbols table.

InitializeLocations ( ) : void

Initialize the location table. Gets the location from a featureclass

InitializeSymbol ( string iconPath, int &iconWidth, int &iconHeight, Bitmap &bitmap ) : IGraphicTrackerSymbol

Initialize a character marker symbol for a given bitmap path

InitializeTables ( ) : void

initialize the main table as well as the symbols table. The base class calls new on the table and adds a default ID field.

OnUpdateTimer ( object sender, System.Timers.ElapsedEventArgs e ) : void

run the thread that does the update of the weather data

OnWeatherItemAddedEvent ( object sender, WeatherItemEventArgs args ) : void

weather ItemAdded event handler

gets fired when an item is added to the table

PopulateGraphicTracker ( ) : void
PopulateLocationsTable ( ) : void

Load the information from the MajorCities featureclass to the locations table

ThreadProc ( ) : void

the main update thread for the data.

Since the information is coming from a web service which might take a while to respond, it is not logical to let the application hang while waiting for response. Therefore, running the request on a different thread frees the application to continue working while waiting for a response. Please note that in this case, synchronization of shared resources must be addressed, otherwise you might end up getting unexpected results.

ToFontDisp ( System font ) : stdole.IFontDisp
ToRGBColor ( System color ) : IRgbColor

Method Details

Init() public method

public Init ( IBasicMap mapOrGlobe ) : void
mapOrGlobe IBasicMap
return void

RSSWeather() public method

public RSSWeather ( ) : System
return System

Remove() public method

public Remove ( ) : void
return void

UpdateTracker() public method

public UpdateTracker ( WeatherItemEventArgs weatherItemInfo ) : void
weatherItemInfo WeatherItemEventArgs
return void