<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using the new Synchronize() in ArcGIS for Windows Mobile Questions</title>
    <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15963#M141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are upgrading from 9.3 to 10.0 and have a problem implementing the new Synchronize() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the available information we have implemented the following code segment to replace the GetDataAsynch() method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!mobileCache1.IsOpen)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mobileCache1.Close();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileCache1.Storagepath= localStoragePath;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileCache1.DeleteCache();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileServiceConnection1.Url = &amp;lt;server url&amp;gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileServiceConnection1.WebClientProtocolType=WebClientProtocolType.BinaryWebService;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileSync = new MobileCacheSyncAgent(mobileCache1, mobileServiceConnection1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileServiceConnection1.CreateCache(mobileCache1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileCachre1.Open()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileSync.Synchronize();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map1.MapLayers.AddRange(mobileCache1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map1.Refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code creates the cache on the mobile device but with the follwoing undesirable side effects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) When the synchronization starts, the moble device map shows a blank map with only the word "Map" displayed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) The "ScaleBar" is not displayed, so there is not visual feedback to indicate that the Synchronization is running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once the synchronization completes the map is displayed properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do we need to do to our code to make the new Synchronize() method display as the deprecated GetDataAsync() method?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Aug 2010 11:46:10 GMT</pubDate>
    <dc:creator>StephenStarke</dc:creator>
    <dc:date>2010-08-23T11:46:10Z</dc:date>
    <item>
      <title>Using the new Synchronize()</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15963#M141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are upgrading from 9.3 to 10.0 and have a problem implementing the new Synchronize() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the available information we have implemented the following code segment to replace the GetDataAsynch() method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!mobileCache1.IsOpen)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; mobileCache1.Close();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileCache1.Storagepath= localStoragePath;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileCache1.DeleteCache();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileServiceConnection1.Url = &amp;lt;server url&amp;gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileServiceConnection1.WebClientProtocolType=WebClientProtocolType.BinaryWebService;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileSync = new MobileCacheSyncAgent(mobileCache1, mobileServiceConnection1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileServiceConnection1.CreateCache(mobileCache1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileCachre1.Open()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mobileSync.Synchronize();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map1.MapLayers.AddRange(mobileCache1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map1.Refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code creates the cache on the mobile device but with the follwoing undesirable side effects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) When the synchronization starts, the moble device map shows a blank map with only the word "Map" displayed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) The "ScaleBar" is not displayed, so there is not visual feedback to indicate that the Synchronization is running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once the synchronization completes the map is displayed properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do we need to do to our code to make the new Synchronize() method display as the deprecated GetDataAsync() method?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Aug 2010 11:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15963#M141</guid>
      <dc:creator>StephenStarke</dc:creator>
      <dc:date>2010-08-23T11:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using the new Synchronize()</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15964#M142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Stephen,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you find solution to this problem. I am in the same situation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When Calling Synchornize() while posting EDITS on server there is no indication that sychronization is taking place as this is Sycn operation and NOt ASynch.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2011 23:11:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15964#M142</guid>
      <dc:creator>ATSIT</dc:creator>
      <dc:date>2011-09-25T23:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using the new Synchronize()</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15965#M143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On a per layer basis, try using FeatureLayerSyncAgent and its Synchronize method.&amp;nbsp; I believe this is still synchronous but provides feedback via ProgressChanged and StateChanged events.&amp;nbsp; It also provides a FeatureLayerSyncResults object as the return result of calling Synchronize.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 09:10:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15965#M143</guid>
      <dc:creator>StephenDickinson</dc:creator>
      <dc:date>2011-10-03T09:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using the new Synchronize()</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15966#M144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After you've created your cache, loop through the layers you want to sync and add them to a&amp;nbsp; MobileCacheSyncAgent, then you can call BeginDownloadExtent on the MobileCacheSyncAgent and it will do async downloads for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry it's not complete code - I just pulled bits and pieces to show the concepts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //property for mobile sync agent
&amp;nbsp; public MobileCacheSyncAgent SyncMaster { get; set; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //snippet which initializes the sync agents for download
&amp;nbsp; SyncMaster.SyncAgents.Clear();
&amp;nbsp; SetupSyncAgents();
&amp;nbsp; SyncMaster.BeginDownloadExtent(mobileCache1.GetInitialExtent(), 0, 0, DownloadExtent, Guid.NewGuid());


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //procedure to setup the sync agents for downloads
&amp;nbsp; private void SetupSyncAgents() {
&amp;nbsp;&amp;nbsp; foreach (Layer l in this.mobileCache1.Layers) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (l is FeatureLayer) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fl = (FeatureLayer)l;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureLayerSyncAgent agent = new FeatureLayerSyncAgent(fl);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agent.MapDocumentConnection = this.mobileServiceConnection1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agent.SynchronizationDirection = SyncDirection.DownloadOnly;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SyncMaster.SyncAgents.Add(agent);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; if (l is RasterLayer) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var rl = (RasterLayer)l;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RasterLayerSyncAgent agent = new RasterLayerSyncAgent(rl);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agent.Extent = this.map1.GetExtent();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agent.MapDocumentConnection = this.mobileServiceConnection1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SyncMaster.SyncAgents.Add(agent);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:38:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15966#M144</guid>
      <dc:creator>StevenSchuldt</dc:creator>
      <dc:date>2021-12-10T20:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using the new Synchronize()</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15967#M145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, good point, this will work for downloading data asynchronously (using the callback parameter of the BeginDownloadExtent method to indicate completion).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just want to add in reply to the second post in this thread: My understanding is that there isn't a comparable way of uploading data asynchronously i.e. there isn't a BeginUploadExtent method.&amp;nbsp; Therefore, you might need to use FeatureLayerSyncAgent and its Synchronize method for this case.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 08:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/using-the-new-synchronize/m-p/15967#M145</guid>
      <dc:creator>StephenDickinson</dc:creator>
      <dc:date>2011-10-11T08:51:19Z</dc:date>
    </item>
  </channel>
</rss>

