Hi,I am trying to download data from my server without having to click on Manage Edits > Get Data, I want have a single click button to download the data. The code posted below should work with a fully customized solution, but I am curious as to how I can modify the code so that it can be used to download data just like the Get Data method that ESRI provides.
MobileCache m_mobileCache1;
m_mobileCache1 = new MobileCache(@C:\user\MobileCache);
m_mobileCache1.Open();
Map mMap = new Map();
mMap.MapLayers.AddRange(m_mobileCache1);
if (m_mobileCache1.CacheExists)
{
m_mobileCache1.Close();
m_mobileCache1.DeleteCache();
}
MobileServiceConnection con = new MobileServiceConnection();
con.Url = @"http://server/arcgis/services/Test_Mobile_Services/Radiation_Data_V1_B11/MapServer/Mobileserver";
con.CreateCache(m_mobileCache1);
m_mobileCache1.Open();
MobileCacheSyncAgent agent = new MobileCacheSyncAgent(m_mobileCache1);
agent.MapDocumentConnection = con;
agent.DownloadExtent(m_mobileCache1.GetExtent(), 0, 0);
mMap.MapLayers.AddRange(m_mobileCache1);
Thanks,Akhil P.