blob: cd0ad20ad29528b7803f8cdeb9e5511c4d30901f (
plain)
| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 06 00 00 00 1f f3 ff | .PNG........IHDR................ |
| 0020 | 61 00 00 00 09 70 48 59 73 00 00 0e c4 00 00 0e c4 01 95 2b 0e 1b 00 00 01 3a 49 44 41 54 78 5e | a....pHYs..........+.....:IDATx^ |
| 0040 | a5 93 3f 4b c3 50 14 c5 4f 1e 82 24 a9 7b a1 8b fa 05 4c 67 a9 54 c7 12 45 10 45 dc 9c c5 4f 60 | ..?K.P..O..$.{....Lg.T..E.E...O` |
| 0060 | c4 8a 38 eb e0 14 c1 82 43 b0 83 4a 20 b8 5a 10 21 9b df 20 3a 67 72 68 22 4e 31 07 12 08 49 5e | ..8.....C..J..Z.!...:grh"N1...I^ |
| 0080 | 1c fa 83 9b f7 27 f7 dc 7b 72 21 90 11 c7 f1 47 1a 06 1a 48 92 04 02 72 8c e9 ef 94 45 86 68 40 | .....'..{r!....G...H...r....E.h@ |
| 00a0 | a0 81 83 fb 3d bc 07 6f 67 0d 6e 9a 0b a4 0e 70 fa 72 c2 90 ba 11 f8 1f ba 90 ba 51 0a 43 4b 20 | ....=..og.n....p.r.........Q.CK. |
| 00c0 | 61 e3 66 0d 39 ab cb 3d 5c 0c 2e b9 3d 57 55 75 38 87 02 a6 69 a2 8c e7 79 c8 69 cd b7 60 74 d8 | a.f.9..=\...=WUu8...i...y.i..`t. |
| 00e0 | 1c 5f 00 26 dc 88 ba e4 a7 c7 e7 8a d8 e8 74 61 ef df 61 67 65 f7 1a 40 57 d3 34 16 40 d1 c1 12 | ._.&..........ta..age..@W.4.@... |
| 0100 | 80 4f 94 d8 ba 1d e0 a8 77 4c 21 bb 1e e6 42using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
using Tango.Core;
using Tango.SharedUI.Helpers;
namespace Tango.Scripting.IDE
{
public abstract class ProjectItem : ExtendedObject, IProjectItem
{
private static Dictionary<String, BitmapSource> _imageCache;
static ProjectItem()
{
_imageCache = new Dictionary<string, BitmapSource>();
}
public string Name { get; set; }
public ObservableCollection<IProjectItem> Items { get; set; }
public ProjectItem()
{
Items = new ObservableCollection<IProjectItem>();
}
public abstract BitmapSource Image { get; }
public abstract FrameworkElement OnGetView();
private FrameworkElement GetView()
{
return OnGetView();
}
protected static BitmapSource GetImage(String name)
{
if (_imageCache.ContainsKey(name))
{
return _imageCache[name];
}
else
{
var image = ResourceHelper.GetImageFromResources(name);
_imageCache.Add(name, image);
return image;
}
}
public abstract bool CanOpen { get; }
public FrameworkElement View => GetView();
}
}
|