mobileCache = new MobileCache("put your path here the folder that contains the cache"); MobileServiceConnection con = new MobileServiceConnection(); con.Url = (@http:// + ServerType._StaticArcGISServerName + "/arcgis/services/Mobile_Services/" + AppSettings._StaticSynchronizationName + "/MapServer/Mobileserver"); con.CreateCache(mobileCache.StoragePath); mobileCache.Open(); foreach (Layer layer in mobileCache.Layers) { FeatureLayer featureLayer = (FeatureLayer)layer; FeatureLayerSyncAgent layerSyncAgent = new FeatureLayerSyncAgent(featureLayer); layerSyncAgent.MapDocumentConnection = con; layerSyncAgent.SynchronizationDirection = SyncDirection.UploadOnly; SyncResults theSyncResults = new SyncResults(); theSyncResults = layerSyncAgent.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.