using KGIS.Framework.Platform;
using KGIS.Framework.Utils.Helper;
using KGIS.Framework.Views;
using System;
using System.Collections.Generic;
using System.Linq;
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.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Kingo.Plugin.MapView.Views.AppMenuView
{
///
/// ShortcutKeyDescription.xaml 的交互逻辑
///
public partial class UCShortcutKeyDescription : UserControl, KGIS.Framework.Views.IDockPanel2
{
public static UCShortcutKeyDescription Instance { get; set; }
public UCShortcutKeyDescription()
{
DevExpress.Xpf.Core.ThemeManager.SetTheme(this, DevExpress.Xpf.Core.Theme.Office2013LightGray);
InitializeComponent();
Instance = this;
this.CloseViewHandler += UCShortcutKeyDescription_CloseViewHandler;
InitPanel();
BindData();
}
private void BindData()
{
try
{
Dictionary dic = new Dictionary();
dic.Add("编辑保存", "Ctrl+S");
dic.Add("编辑工具", "Ctrl+Q");
dic.Add("插入节点", "I");
dic.Add("删除节点", "Ctrl+D");
dic.Add("新增面", "Ctrl+Z");
dic.Add("共边画面", "Ctrl+G");
dic.Add("分割图斑", "Ctrl+F");
dic.Add("合并图斑", "Ctrl+H");
dic.Add("裁减图斑", "Ctrl+L");
dic.Add("边界调整", "Ctrl+T");
dic.Add("共点移动", "Ctrl+B");
dic.Add("拆分多部件", "Ctrl+N");
dic.Add("显示图形节点", "V");
dic.Add("撤销", "Ctrl+Z");
dic.Add("恢复", "Ctrl+Y");
dic.Add("删除", "Delete");
dic.Add("复制", "Ctrl+C");
dic.Add("粘贴", "Ctrl+V");
dic.Add("地图框选照片", "X");
//dic.Add("追踪", "Ctrl+U");
//dic.Add("捕捉", "Alt+B");
dic.Add("变更提取", "Ctrl+P");
dic.Add("辅助图层开关", "O");
dic.Add("放大地图", "W");
dic.Add("缩小地图", "S");
dic.Add("刷新地图窗口", "F5");
dic.Add("全选照片", "Ctrl+A");
dic.Add("全屏照片", "F11");
dic.Add("选择照片", "回车(Enter)");
dic.Add("全屏照片透明显示", "P");
dic.Add("上一张照片", "←");
dic.Add("下一张照片", "→");
dic.Add("质检结果", "1");
dic.Add("建库数据", "2");
dic.Add("基础数据库", "3");
dic.Add("国家下发监测图斑", "4");
dic.Add("历年耕地", "5");
dic.Add("临时用地范围", "6");
dic.Add("用地管理信息", "7");
dic.Add("专项数据", "8");
dic.Add("栅格数据", "9");
dic.Add("关闭Dock窗口", "Ctrl+W");
List lst = new List();
foreach (var item in dic)
{
lst.Add(new ShortcutEntity() { code = item.Value, name = item.Key });
}
gridPackage.ItemsSource = null;
gridPackage.ItemsSource = lst;
}
catch (Exception ex)
{
MessageHelper.ShowError(ex.Message);
}
}
private void UCShortcutKeyDescription_CloseViewHandler(object sender, EventArgs e)
{
Instance = null;
}
#region IDockPanel2 接口继承
public Platform Platform { get; set; }
public Guid ID { get; set; }
public KGIS.Framework.Views.DockStyle DockAreas { get; set; }
public System.Drawing.Size FloatSize { get; set; }
public int DockWidth { get; set; }
public int DockHeight { get; set; }
public KGIS.Framework.Views.DockStyle DefaultArea { get; set; }
public bool ShowCloseButton { get; set; }
public bool ShowAutoHideButton { get; set; }
public string Title { get; set; }
private Grid currentheadergrid { get; set; }
public bool IsShowInMap { get; set; }
public event EventHandler CloseViewHandler;
public void Close()
{
//Env.Instance.KMap.LoadProjectCompleteEvent -= Platform_LoadProjectEvent;
//Env.Instance.KMap.CloseProjectCompleteEvent -= Platform_CloseProjectEvent;
//this.Platform.ClosePanel(this);
}
public void InitPanel()
{
this.ID = new Guid("A347EB08-E68F-4CB7-BFDB-B841F4D85846");
this.DockAreas = DockStyle.DockLeft | DockStyle.DockRight | DockStyle.Float;
this.FloatSize = new System.Drawing.Size(600, 670);
this.DockWidth = 550;
this.DefaultArea = DockStyle.DockRight;
this.ShowCloseButton = true;
this.ShowAutoHideButton = true;
this.Title = "快捷键说明";
}
private void Platform_LoadProjectEvent(object sender, object e)
{
try
{
this.Close();
}
catch (Exception ex)
{
MessageHelper.ShowError(ex.Message);
}
}
private void Platform_CloseProjectEvent(object sender, object e)
{
try
{
this.Close();
}
catch (Exception ex)
{
MessageHelper.ShowError(ex.Message);
}
}
public void Show(bool IsHide = false)
{
}
public void ShowPanel()
{
Instance = this;
Platform.Instance.OpenView(this, false);
}
public void ClosePanel()
{
Instance = null;
Platform.Instance.CloseView(this);
}
public void ClosePanelInvoke()
{
Instance = null;
CloseViewHandler?.Invoke(this, null);
}
#endregion
}
public class ShortcutEntity
{
public string code { get; set; }
public string name { get; set; }
}
}