Exemplo n.º 1
0
        private void CloseCycloMediaLayer(bool closeDocument)
        {
            if (CycloMediaGroupLayer != null)
            {
                if ((!ContainsCycloMediaLayer()) || closeDocument)
                {
                    RemoveLayers();
                }
            }

            if (closeDocument)
            {
                var arcEvents = ArcUtils.ActiveViewEvents;

                if (arcEvents != null)
                {
                    arcEvents.ItemDeleted -= ItemDeleted;
                    arcEvents.AfterDraw   -= Afterdraw;
                }

                CycloMediaLayer.LayerRemoveEvent -= OnLayerRemoved;
                GsRecentDataLayer.RemoveFromMenu();
                GsHistoricalDataLayer.RemoveFromMenu();
                GsCycloMediaOptions.RemoveFromMenu();
                GsMeasurementDetail.RemoveFromMenu();
            }
        }
Exemplo n.º 2
0
        private void OpenDocument()
        {
            try
            {
                CycloMediaLayer.ResetYears();
                var arcEvents = ArcUtils.ActiveViewEvents;

                if (arcEvents != null)
                {
                    arcEvents.ItemDeleted += ItemDeleted;
                    arcEvents.AfterDraw   += Afterdraw;
                }

                if (OpenDocumentEvent != null)
                {
                    OpenDocumentEvent();
                }

                if (ContainsCycloMediaLayer())
                {
                    AddLayers();
                }

                CycloMediaLayer.LayerRemoveEvent += OnLayerRemoved;
                GsRecentDataLayer.AddToMenu();
                GsHistoricalDataLayer.AddToMenu();
                GsCycloMediaOptions.AddToMenu();
                GsMeasurementDetail.AddToMenu();
                FrmMeasurement.Close();
                FrmIdentify.Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message, "GsExtension.OpenDocument");
            }
        }