private Module1()
 {
     FrameworkApplication.State.Deactivate("planet_state_connection");
     ProjectOpenedEvent.Subscribe(OnProjectOpen);
     ProjectClosedEvent.Subscribe(OnProjectClose);
     ProjectSavingEvent.Subscribe(OnProjectSaving);
 }
        protected StreetSmart()
        {
            ProjectClosedEvent.Subscribe(OnProjectClosed);
            _currentDispatcher = Dispatcher.CurrentDispatcher;
            _inRestart         = false;
            _inClose           = false;

            _apiKey    = ApiKey.Instance;
            _settings  = Settings.Instance;
            _constants = ConstantsViewer.Instance;

            _login = Login.Instance;
            _login.PropertyChanged += OnLoginPropertyChanged;

            _configuration = FileConfiguration.Instance;
            _configuration.PropertyChanged += OnConfigurationPropertyChanged;

            _openNearest                  = new List <string>();
            _crossCheck                   = null;
            _lastSpatialReference         = null;
            _configurationPropertyChanged = new List <string>();

            GetVectorLayerListAsync();

            ModulestreetSmart streetSmartModule = ModulestreetSmart.Current;

            _viewerList           = streetSmartModule.ViewerList;
            _measurementList      = streetSmartModule.MeasurementList;
            _cycloMediaGroupLayer = streetSmartModule.CycloMediaGroupLayer;

            Initialize();
        }
Exemplo n.º 3
0
 protected ImportPlatViewModel()
 {
     CheckNewLayers();
     ProjectClosedEvent.Subscribe(OnProjectClosed);
     //Subscribe to ActiveMapViewChangedEvent in order to get the layers in the map
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
 }
        protected override bool Initialize()
        {
            //listen to project open/close events
            ProjectOpenedEvent.Subscribe(onProjectOpened);
            ProjectClosedEvent.Subscribe(onProjectClosed);

            return(base.Initialize());
        }
Exemplo n.º 5
0
 protected SymbolsViewModel()
 {
     SearchPauseSearching = true;
     #region Events
     //Subscribe to ProjectItemsChangedEvent to update ProjecyStyles
     ProjectItemsChangedEvent.Subscribe(OnProjectItemsChanged);
     ProjectClosedEvent.Subscribe(OnProjectClosed);
     //Subscribe to ActiveMapViewChangedEvent in order to get the layers in the map
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
     LayersAddedEvent.Subscribe(OnLayersAdded);
     LayersRemovedEvent.Subscribe(OnLayersemoved);
     //Subscribe to Graphic Elements selection changed event
     ElementSelectionChangedEvent.Subscribe(OnGraphicsElementSelectionChanged);
     #endregion
     BindingOperations.EnableCollectionSynchronization(_layersInMap, _layersInMapLock);
     _           = GetLayersInMapAsync();
     _patchTypes = new Dictionary <StyleItemType, SymbolPatchType>
     {
         { StyleItemType.LineSymbol, SymbolPatchType.ZigzagLine },
         { StyleItemType.PolygonSymbol, SymbolPatchType.BoundaryPoly }
     };
     //Get the Styles in the project
     ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(true));
     ProjectFilterStyles.Add(new SymbolSearcherSearchFilter());
     foreach (var pi in Project.Current.GetItems <StyleProjectItem>())
     {
         ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(false, pi));
     }
     if (SelectedProjectFilterStyle == null && ProjectFilterStyles.Count > 0)
     {
         SelectedProjectFilterStyle = ProjectFilterStyles[0];
     }
     //Get the various StyleItemTypes in Pro.
     foreach (StyleItemType sit in Enum.GetValues(typeof(StyleItemType)))
     {
         if (sit == 0)
         {
             continue;
         }
         StyleItemTypeValues.Add(sit);
     }
     SelectedStyleItemType = StyleItemTypeValues.FirstOrDefault();
     SearchPauseSearching  = false;
 }
        protected SymbolSearcherDockpaneViewModel()
        {
            System.Diagnostics.Debug.WriteLine($@"==== SymbolPicker constructor start");
            //Subscribe to ProjectItemsChangedEvent to update ProjecyStyles
            ProjectItemsChangedEvent.Subscribe(OnProjectItemsChanged);
            ProjectClosedEvent.Subscribe(OnProjectClosed);
            //Subscribe to ActiveMapViewChangedEvent in order to get the layers in the map
            ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
            _           = GetLayersInMapAsync();
            _patchTypes = new Dictionary <StyleItemType, SymbolPatchType>
            {
                { StyleItemType.LineSymbol, SymbolPatchType.ZigzagLine },
                { StyleItemType.PolygonSymbol, SymbolPatchType.BoundaryPoly }
            };
            BindingOperations.EnableCollectionSynchronization(_filterStyleItems, _StyleProjectItemsLock);
            BindingOperations.EnableCollectionSynchronization(_layersInMap, _layersInMapLock);

            // if current project is null the OnProjectItemsChanged event will take care of FilterStyles
            if (Project.Current != null)
            {
                // setting up the search filter StyleItem list for the combo happens in OnProjectItemsChanged unless the project is already open
                FilterStyles.Add(new SymbolSearcherSearchFilter(true));
                FilterStyles.Add(new SymbolSearcherSearchFilter());
                foreach (var pi in Project.Current.GetItems <StyleProjectItem>())
                {
                    FilterStyles.Add(new SymbolSearcherSearchFilter(false, pi));
                }
                if (SelectedFilterStyle == null && FilterStyles.Count > 0)
                {
                    // select the default search type
                    SelectedFilterStyle = FilterStyles[1];
                }
                SearchPauseSearching = false;
                System.Diagnostics.Debug.WriteLine($@"==== SearchPauseSearching false");
            }
            System.Diagnostics.Debug.WriteLine($@"==== SymbolPicker constructor end");

            // set the start value to line type
            SelectedSearchType = SearchTypes[3];
        }
        /// <summary>
        /// CTor
        /// </summary>
        public OpenMapviewsDockpaneViewModel()
        {
            BindingOperations.EnableCollectionSynchronization(ListOfMapviews, _lockCollection);

            // create a simulated list of mapviews
            // either when a project is opened or if a project is already open
            ProjectOpenedEvent.Subscribe((ProjectEventArgs e) => { CreateMapviewItemsAsync(); });
            if (Project.Current != null)
            {
                CreateMapviewItemsAsync();
            }

            ProjectClosedEvent.Subscribe((ProjectEventArgs e) =>
            {
                // cleanup temp folder
                if (!string.IsNullOrEmpty(_temporaryPath))
                {
                    System.IO.Directory.Delete(_temporaryPath, true);
                }
                _temporaryPath = string.Empty;
            });
        }
Exemplo n.º 8
0
 protected GlobeSpotter()
 {
     ProjectClosedEvent.Subscribe(OnProjectClosed);
 }
 /// <summary>
 /// Module constructor.  Subscribe to the ProjectOpened and ProjectClosed events.
 /// </summary>
 private Module1()
 {
     ProjectOpenedEvent.Subscribe(OnProjectOpen);
     ProjectClosedEvent.Subscribe(OnProjectClosed);
 }
Exemplo n.º 10
0
 private SapConfigModule()
 {
     ProjectOpenedEvent.Subscribe(OnProjectOpen);
     ProjectClosedEvent.Subscribe(OnProjectClose);
 }