| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 f4 00 00 02 be 08 06 00 00 00 54 fd ec | .PNG........IHDR.............T.. |
| 0020 | 1d 00 00 00 04 67 41 4d 41 00 00 b1 8f 0b fc 61 05 00 00 00 09 70 48 59 73 00 00 0e c2 00 00 0e | .....gAMA......a.....pHYs....... |
| 0040 | c2 01 15 28 4a 80 00 00 00 18 74 45 58 74 53 6f 66 74 77 61 72 65 00 70 61 69 6e 74 2e 6e 65 74 | ...(J.....tEXtSoftware.paint.net |
| 0060 | 20 34 2e 30 2e 39 6c 33 7e 4e 00 00 ff 8e 49 44 41 54 78 5e ec dd 67 b4 ae 59 55 e8 f9 2b 20 2a | .4.0.9l3~N....IDATx^..g..YU..+.* |
| 0080 | 82 a2 62 0e 98 10 73 ce 62 c6 ac a8 68 81 0a 18 08 92 14 24 0a 82 80 25 39 5b 58 45 2a 50 6a 0b | ..b...s.b...h......$...%9[XE*Pj. |
| 00a0 | 14 82 60 95 62 40 45 c4 00 46 a0 40 e2 a0 48 ea 70 f4 1d 7d bd a3 2f 6d 95 ad d4 ee f5 7b ba fe | ..`.b@E..F.@..H.p..}../m.....{.. |
| 00c0 | 7b cc 7a 7c 0f 75 0e ed b7 ee 0f 73 ac 34 d7 5c 73 cd b8 d6 7a de 7d ce 7f fb a7 7f fa a7 6b 3e | {.z|.u.....s.4.\s...z.}.......k> |
| 00e0 | e7 39 cf b9 e9 2f fe e2 2f de e6 5e f7 ba d7 ad 1f f8 c0 07 fe e8 3d ee 71 8f 5b de e7 3e f7 d9 | .9.../../..^..........=.q.[..>.. |
| 0100 | ca ff 1f fe bf 0d cb 1e 6e 71 a8 7f 0f cb 76 6e f9 e0 07 3f f8 16 e0 be f7 bd ef 36 ef e7 7e ee | ........nq....vn...?.......6..~. |
| 0120 | e7 ae 82 f3 a0 07 3d e8 64 2c dc 53 c1 c3 1e f6 b0 b3 e0 dd ef 7e f7 3b a1 fb 5f 09 8f 7c e4 23 | ......=.d,.S.........~.;.._..|.# |
| 0140 | cf 5a 36 7f d6 a1 b1 43 f0 d0 87 3e f4 2a b8 73 ee 7e ec ec b3 cf be c5 c3 1f fe f0 b3 94 c6 d4 | .Z6....C...>.*.s.~.............. |
| 0160 | 1f f2 90 87 6c 63 ea 13 57 ff 1c 8b d6 9e e6 7f 05 90 e9 99 d2 9d fc 01 f3 67 fb 10 b4 e7 fd 7e | ....lc..W................g.....~ |
| 0180 | a6 1c 92 cd 9c 33 e5 70 a6 30 d7 a1 1b 25 48 17 ff 95 f0 98 c7 3c e6 ac c7 3d ee 71 ff a9 9f 4d | .....3.p.0...%H......<...=.q...M |
| 01a0 | 29 8d 1d 1a bf 3a 30 07 8d 60 8e 69 47 77 3f a6 ef 9c 73 ce 39 38 2f a8 1f de a3 1f fd e8 13 7c | )....:0..`.iGw?...s.98/........| |
| 01c0 | 7b 79 e2 13 9f 78 d6 13 9e f0 84 ad af 35 e0 c2 6b af 8f 7d ec 63 b7 52 1b 18 d7 7e d4 a3 1e 75 | {y...x.......5..k..}.c.R...~...u |
| 01e0 | 95 3e 78 d1 47 b3 39 f1 06 f4 c1 51 06 87 70 f6 78 f1 59 1b b4 ae d2 9a 4f 7d ea 53 cf 3a f7 dc | .>x.G.9....Q..p.x.Y.....O}.S.:.. |
| 0200 | 73 cf fa e5 5f fe e5 ad ad 5e 1f 40 c3 58 6d 34 c2 03 c6 f4 35 bf b1 27 3f f9 c9 27 f8 73 fe 84 | s..._....^.@.Xm4....5..'?..'.s.. |
| 0220 | 3d ad 3d c4 87 f2 fc f3 cf df ca a7 3d ed 69 67 fd ca af fc ca 2d d0 d7 d7 3a e7 9d 77 de 59 cf | =.=.........=.ig.....-...:..w.Y. |
| 0240 | 7c e6 33 6f 61 ec c2 0b 2f bc f5 f3 9f ff fc 1b ae 5c fd 7e 57 07 ff 6d 4d f8 a0 e7 3e f7 b9 17 | |.3oa.../........\.~W..mM...>... |
| 0260 | df ff fe f7 7f cf 8f fe e8 8f be e7 27 7e e2 27 ae b8 c5 2d 6e f1 6f ab be 95 87 e0 fb be ef fb | ............'~.'...-n.o......... |
| 0280 | fe ed 7b bf f7 7b ff ed 07 7f f0 07 b7 f6 59 67 9d b5 f5 69 d7 5f fd 07 7e using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
using Tango.Scripting.IDE.Windows;
using Tango.SharedUI;
namespace Tango.Scripting.IDE.Notifications
{
public class DefaultNotificationManager : INotificationManager
{
public Task<TViewModel> ShowDialog<TViewModel, TView>(TViewModel viewModel, TView view)
where TViewModel : IDEDialogViewModel
where TView : FrameworkElement
{
TaskCompletionSource<TViewModel> source = new TaskCompletionSource<TViewModel>();
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
DialogWindow window = new DialogWindow();
window.Title = viewModel.Title;
window.Content = view;
view.DataContext = viewModel;
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.Owner = Application.Current.MainWindow;
viewModel.Accepted += () =>
{
window.Close();
source.SetResult(viewModel);
};
viewModel.Canceled += () =>
{
window.Close();
source.SetResult(viewModel);
};
window.ShowDialog();
}));
return source.Task;
}
public Task<TViewModel> ShowDialog<TViewModel>(TViewModel viewModel) where TViewModel : IDEDialogViewModel
{
var modelName = typeof(TViewModel).Name;
var viewName = modelName.Replace("VM", "");
var viewType = typeof(TViewModel).Assembly.GetType(typeof(TViewModel).Namespace + "." + viewName);
var view = Activator.CreateInstance(viewType) as FrameworkElement;
return ShowDialog(viewModel, view);
}
public Task<TViewModel> ShowDialog<TViewModel>() where TViewModel : IDEDialogViewModel
{
return ShowDialog(Activator.CreateInstance<TViewModel>());
}
public Task ShowError(string title, string message)
{
throw new NotImplementedException();
}
public Task ShowInfo(string title, string message)
{
throw new NotImplementedException();
}
public ProgressNotificationHandler ShowProgress(string title, string message, bool canCancel = false)
{
throw new NotImplementedException();
}
public Task<bool> ShowQuestion(string title, string message)
{
throw new NotImplementedException();
}
public Task ShowSuccess(string title, string message)
{
throw new NotImplementedException();
}
public Task ShowWarning(string title, string message)
{
throw new NotImplementedException();
}
private Task ShowMessageBox(String title, String message, bool hasCancel, BitmapSource icon)
{
return null;
}
}
}
|