コード例 #1
0
        protected override void OnUpdate()
        {
            try
            {
                GsExtension extension = GsExtension.GetExtension();

                if (extension != null)
                {
                    CycloMediaGroupLayer cyclGroupLayer = extension.CycloMediaGroupLayer;
                    bool historicalEnabled = (cyclGroupLayer != null) && cyclGroupLayer.HistoricalLayerEnabled;

                    if (!historicalEnabled && FrmRecordingHistory.IsVisible)
                    {
                        FrmRecordingHistory.CloseForm();
                    }

                    Enabled = ((ArcMap.Application != null) && extension.Enabled && historicalEnabled);
                    Checked = FrmRecordingHistory.IsVisible;
                }
            }
            catch (Exception ex)
            {
                _logClient.Error("GsRecordingHistory.OnUpdate", ex.Message, ex);
                Trace.WriteLine(ex.Message, "GsRecordingHistory.OnUpdate");
            }
        }
コード例 #2
0
 protected override void OnClick()
 {
     try
     {
         OnUpdate();
         FrmRecordingHistory.OpenCloseSwitch();
     }
     catch (Exception ex)
     {
         _logClient.Error("GsRecordingHistory.OnClick", ex.Message, ex);
         MessageBox.Show(ex.Message, Resources.GsCycloMediaOptions_OnClick_Globespotter_integration_Addin_Error_);
     }
 }