Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
480
Refresh Data on Timer
posted

Currently I have a map that loads shapefiles, then hits a WCF service to build some symbols based on the data.  I have a timer setup to call the wcf which I build the symbols from.  It seems to keep adding symbols each time I reload the data.  Is there  away around that?

 

some relevant code

DispatcherTimer Dtimer = new DispatcherTimer();

public

MainPage()

{

InitializeComponent();

Dtimer.Interval = new TimeSpan(0, 0, 30);

Dtimer.Tick +=new EventHandler(Dtimer_Tick);

Dtimer.Start();

}

protected void Dtimer_Tick(object s, EventArgs args)

{

CDBServiceClient Client5 = new CDBServiceClient();

Client5.CustomerServiceListCompleted += new EventHandler<CustomerServiceListCompletedEventArgs>(Client5_CustomerServiceListCompleted);

Client5.CustomerServiceListAsync();

mylabel.Content ="Last Updated:" + DateTime.Now;

}

private void MapLayer_Imported(object sender, MapLayerImportEventArgs e)

{

if (e.Action == MapLayerImportAction.End)

{

CDBServiceClient Client5 = new CDBServiceClient();

Client5.CustomerServiceListCompleted += new EventHandler<CustomerServiceListCompletedEventArgs>(Client5_CustomerServiceListCompleted);

Client5.CustomerServiceListAsync();

}

}