示例#1
0
        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;
        }
示例#2
0
 public ResEditor(MapRes mapRes)
 {
     InitializeComponent();
     this.mapRes = mapRes;
 }
示例#3
0
 private void AddResToResLibListBox(MapRes res)
 {
     TextListBoxItem t = new TextListBoxItem(res);
     t.OnEdit += OnEditResFromLib;
     t.OnDel += OnDelResFromLib;
     resLibListBox.Items.Add(t);
 }
示例#4
0
 internal void RemoveMapRes(MapRes mapRes)
 {
     ResList.Remove(mapRes);
     this.NeedSave = true;
 }
示例#5
0
 /// <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;
 }