Last active
February 9, 2019 17:54
-
-
Save dkuida/1e7e108f5e116522d4a7603c25d35cc1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Example | |
| { | |
| public class ActiveMap : IMap | |
| { | |
| private readonly Map _map; | |
| public ActiveMap(Map map) | |
| { | |
| _map = map; | |
| } | |
| public IReadOnlyList<Layer> GetLayersAsFlattenedList() | |
| { | |
| return _map.GetLayersAsFlattenedList(); | |
| } | |
| public Task<(List<Geometry>, List<Geometry>)> GetSelectedGeometries() | |
| { | |
| return QueuedTask.Run(() => | |
| { | |
| var selection = MapView.Active.Map.GetSelection(); | |
| selection | |
| .ForEachWithIndex((mapElement, index) => | |
| { | |
| // logic | |
| }); | |
| return (parcelGeometries, sideWalkGeometries); | |
| }); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Example | |
| { | |
| public class MapSteps | |
| { | |
| private readonly UINotifier _notifier; | |
| private readonly CadasterModuleStore _appStore; | |
| private const string ParcelLayerWorkspace = "temp_parcels"; | |
| private const string ParcelLayer = "Parcels"; | |
| public ILayerManagement ParcelWorkspaceLayerManager { private get; set; } = | |
| new LayerManagement(ParcelLayerWorkspace); | |
| public ILayerManagement ParcelLayerManager { private get; set; } = new LayerManagement(ParcelLayer); | |
| private readonly IMap _activeMap; | |
| public MapSteps(CadasterModuleStore appStore, UINotifier notifier, IMap activeMap) | |
| { | |
| _notifier = notifier; | |
| _appStore = appStore; | |
| _activeMap = activeMap; | |
| _appStore.ParcelProcessState.Subscribe(async state => | |
| { | |
| try | |
| { | |
| switch (state.FlowCurrentStep) | |
| { | |
| // UI update logic | |
| } | |
| } | |
| catch (Exception e) | |
| { | |
| LoggerSingleton.Instance.Logger.Warn(e); | |
| } | |
| }); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ArcGIS.Desktop.Framework.Dialogs; | |
| namespace Example | |
| { | |
| public interface UINotifier | |
| { | |
| void Notify(string message); | |
| } | |
| public class MessageBoxNotifier : UINotifier | |
| { | |
| public void Notify(string message) | |
| { | |
| MessageBox.Show(message); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment