public MapResView(MapRes res, bool isCanDrag = false) { Res = res; IsCanDrag = isCanDrag; BitmapImage bi = new BitmapImage(new Uri(res.Path, UriKind.Absolute)); Source = bi; Width = bi.PixelWidth; Height = bi.PixelHeight; Row = -1;Col = -1; this.MouseMove += OnMouseMove; this.MouseLeftButtonDown += OnMouseDown; this.MouseLeftButtonUp += OnMouseLeftButtonUp; }
public ResEditor(MapRes mapRes) { InitializeComponent(); this.mapRes = mapRes; }
private void AddResToResLibListBox(MapRes res) { TextListBoxItem t = new TextListBoxItem(res); t.OnEdit += OnEditResFromLib; t.OnDel += OnDelResFromLib; resLibListBox.Items.Add(t); }
internal void RemoveMapRes(MapRes mapRes) { ResList.Remove(mapRes); this.NeedSave = true; }
/// <summary> /// 添加一个资源文件 /// </summary> /// <param name="path">文件的路径</param> public List<MapRes> AddMapRes(string[] path) { List<MapRes> result = new List<MapRes>(); if (path != null) { MapRes r; foreach (string p in path) { r = new MapRes(p); ResList.Add(r); result.Add(r); } this.NeedSave = true; } return result; }