You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.0 KiB
97 lines
3.0 KiB
using DevExpress.XtraBars; |
|
using ESRI.ArcGIS.Carto; |
|
using ESRI.ArcGIS.Controls; |
|
using ESRI.ArcGIS.esriSystem; |
|
using ESRI.ArcGIS.Geodatabase; |
|
using ESRI.ArcGIS.Geometry; |
|
using ESRI.ArcGIS.SystemUI; |
|
using KGIS.Framework.Maps; |
|
using KGIS.Framework.Platform; |
|
using KGIS.Framework.Utils; |
|
using KGIS.Framework.Utils.Helper; |
|
using KGIS.Framework.Views; |
|
using Kingo.PluginServiceInterface; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Runtime.InteropServices; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using System.Windows; |
|
using System.Windows.Controls; |
|
using System.Windows.Data; |
|
using System.Windows.Documents; |
|
using System.Windows.Forms; |
|
using System.Windows.Input; |
|
using System.Windows.Media; |
|
using System.Windows.Media.Imaging; |
|
using System.Windows.Navigation; |
|
using System.Windows.Shapes; |
|
using UIShell.OSGi; |
|
using ICommand = ESRI.ArcGIS.SystemUI.ICommand; |
|
|
|
namespace Kingo.Plugin.BHTB_Extract.View |
|
{ |
|
/// <summary> |
|
/// 卷帘工具 的交互逻辑 |
|
/// </summary> |
|
public partial class RollerShuttersView : BaseWindow |
|
{ |
|
public List<ILayer> MapLayerList { get; set; } = new List<ILayer>(); |
|
public event EventHandler<object> OKComplate; |
|
|
|
public RollerShuttersView(object hook) |
|
{ |
|
InitializeComponent(); |
|
|
|
wndLayerListImageComboBox.Items.Clear(); |
|
GetLayers(); |
|
|
|
} |
|
private void wndLayerListImageComboBox_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) |
|
{ |
|
MapLayerList = MapsManager.Instance.MapService.GetAllLayerInMap<ILayer>(); |
|
wndLayerListImageComboBox.ItemsSource = MapLayerList.Select(n => n.Name); |
|
} |
|
private void GetLayers() |
|
{ |
|
try |
|
{ |
|
MapLayerList = MapsManager.Instance.MapService.GetAllLayerInMap<ILayer>(); |
|
wndLayerListImageComboBox.ItemsSource = MapLayerList.Select(n => n.Name); |
|
if (MapLayerList.Count > 0) |
|
wndLayerListImageComboBox.SelectedIndex = 0; |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("卷帘工具图层列表获取失败!" + ex); |
|
return; |
|
} |
|
} |
|
private void rollerShutterBtn_Click(object sender, RoutedEventArgs e) |
|
{ |
|
try |
|
{ |
|
if (MapLayerList == null || MapLayerList.Count == 0) |
|
{ |
|
MessageHelper.ShowWarning("请先添加图层数据!"); |
|
return; |
|
} |
|
int index = wndLayerListImageComboBox.SelectedIndex; |
|
if (index < 0) |
|
{ |
|
MessageHelper.ShowWarning("请选择目标图层!"); |
|
return; |
|
} |
|
ILayer layer = MapLayerList[index]; |
|
OKComplate?.Invoke(layer, null); |
|
} |
|
catch (Exception ex) |
|
{ |
|
LogAPI.Debug("卷帘工具设置失败!" + ex); |
|
return; |
|
} |
|
} |
|
|
|
} |
|
}
|
|
|