MobileCache mobileCache = new MobileCache("physical location of your mobilecache on the field computer"); MobileServiceConnection msc = new MobileServiceConnection(); msc.Url = "your arcgisserver name + /arcgis/services/ + name of the service + /MapServer/Mobileserver"); msc.CreateCache(mobileCache.StoragePath); mobileCache.Open(); foreach (Layer aLayer in mobileCache.Layers) { if(aLayer.Name == "the name of the layer you are trying to sync") { FeatureLayer aFeatureLayer = (FeatureLayer)aLayer; FeatureLayerSyncAgent flsa = new FeatureLayerSyncAgent(aFeatureLayer); flsa.MapDocumentConnection = msc; flsa.SynchronizationDirection = SyncDirection.Bidirectional; SyncResults results = new SyncResults(); results = flsa.Synchronize(); } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.