/// <summary> /// Called when the user clicks a command. /// </summary> /// <remarks>Note to inheritors: override OnClick and use this method to /// perform the actual work of the custom command.</remarks> public override void OnClick() { ILayer currentLayer = CommandAPI.GetCurrentLayer(this.m_hookHelper); if (currentLayer != null) { new frmLayerTransparency(this.m_hookHelper.FocusMap, currentLayer) { Owner = EnviVars.instance.MainForm }.ShowDialog(); } }
public override void OnClick() { ILayer currentLayer = CommandAPI.GetCurrentLayer(this.m_hookHelper); frmLayerProperty frmLayerProperty = new frmLayerProperty(currentLayer); try { frmLayerProperty.Owner = EnviVars.instance.MainForm; frmLayerProperty.ShowDialog(); } catch (Exception ex) { Log.WriteLog(typeof(CmdLayerProperty), ex); } }
/// <summary> /// Called when the user clicks a command. /// </summary> /// <remarks>Note to inheritors: override OnClick and use this method to /// perform the actual work of the custom command.</remarks> public override void OnClick() { try { ILayer currentLayer = CommandAPI.GetCurrentLayer(this.m_hookHelper); if (currentLayer != null) { (this.m_hookHelper.FocusMap as IActiveView).Extent = currentLayer.AreaOfInterest; this.m_hookHelper.ActiveView.Refresh(); //logger.Log(LogLevel.Info, EventType.UserManagement, AppMessage.MSG0105, null); } } catch (Exception ex) { GFS.BLL.Log.WriteLog(typeof(CmdRemoveLayer), ex); } }
/// <summary> /// Called when the user clicks a command. /// </summary> /// <remarks>Note to inheritors: override OnClick and use this method to /// perform the actual work of the custom command.</remarks> public override void OnClick() { try { ILayer currentLayer = CommandAPI.GetCurrentLayer(this.m_hookHelper); if (currentLayer != null) { if (!(currentLayer is MapServerRESTLayer)) { IDataLayer2 pDataLayer = currentLayer as IDataLayer2; pDataLayer.Disconnect(); } this.m_hookHelper.ActiveView.FocusMap.DeleteLayer(currentLayer); (this.m_hookHelper.ActiveView.FocusMap as IActiveView).Refresh(); GFS.BLL.EnviVars.instance.TOCControl.Update(); } } catch (Exception ex) { //logger.Log(LogLevel.Error, EventType.UserManagement, AppMessage.MSG0104, ex); GFS.BLL.Log.WriteLog(typeof(CmdRemoveLayer), ex); } }