markus / KCOM / Events / CreateCommand.cs @ 762737cd
이력 | 보기 | 이력해설 | 다운로드 (2.3 KB)
1 | f513c215 | humkyung | using KCOM.Common; |
---|---|---|---|
2 | using KCOM.Controls; |
||
3 | using KCOM.Views; |
||
4 | using MarkupToPDF.Common; |
||
5 | using MarkupToPDF.Controls.Parsing; |
||
6 | using Newtonsoft.Json; |
||
7 | using Newtonsoft.Json.Converters; |
||
8 | using Newtonsoft.Json.Linq; |
||
9 | using Newtonsoft.Json.Serialization; |
||
10 | using System; |
||
11 | using System.Collections; |
||
12 | using System.Collections.Generic; |
||
13 | using System.ComponentModel; |
||
14 | using System.Data; |
||
15 | using System.IO; |
||
16 | using System.Linq; |
||
17 | using System.Reflection; |
||
18 | using System.Runtime.Serialization.Formatters; |
||
19 | using System.Runtime.Serialization.Formatters.Binary; |
||
20 | using System.Runtime.Serialization.Json; |
||
21 | using System.Text; |
||
22 | using System.Windows; |
||
23 | using System.Windows.Media; |
||
24 | using System.Xml; |
||
25 | using System.Xml.Serialization; |
||
26 | 4eb052e4 | ljiyeon | using static KCOM.Controls.Sample; |
27 | f513c215 | humkyung | |
28 | namespace KCOM |
||
29 | { |
||
30 | public class CreateCommand |
||
31 | { |
||
32 | private static readonly CreateCommand _instance = new CreateCommand(); |
||
33 | |||
34 | // Explicit static constructor to tell C# compiler |
||
35 | // not to mark type as beforefieldinit |
||
36 | static CreateCommand() |
||
37 | { |
||
38 | } |
||
39 | |||
40 | private CreateCommand() |
||
41 | { |
||
42 | } |
||
43 | |||
44 | public static CreateCommand Instance |
||
45 | { |
||
46 | get |
||
47 | { |
||
48 | return _instance; |
||
49 | } |
||
50 | } |
||
51 | |||
52 | /// <summary> |
||
53 | /// push given control to undo stack |
||
54 | /// </summary> |
||
55 | /// <author>humkyung</author> |
||
56 | /// <date>2019.06.12</date> |
||
57 | /// <param name="comments"></param> |
||
58 | public void Execute(CommentUserInfo control) |
||
59 | { |
||
60 | ab7fe8c0 | humkyung | ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo).ToList() |
61 | .ForEach(i => |
||
62 | { |
||
63 | ViewerDataModel.Instance.UndoDataList.Remove(i); |
||
64 | }); |
||
65 | f513c215 | humkyung | |
66 | 02a9f323 | humkyung | MarkupToPDF.Common.UndoDataGroup UndoDataGroup = new UndoDataGroup() |
67 | f513c215 | humkyung | { |
68 | IsUndo = false, |
||
69 | 02a9f323 | humkyung | Event = EventType.Create |
70 | f513c215 | humkyung | }; |
71 | |||
72 | 19d602e0 | humkyung | UndoData multi_UndoData = new UndoData(control); |
73 | 02a9f323 | humkyung | UndoDataGroup.MarkupDataColl.Add(multi_UndoData); |
74 | f513c215 | humkyung | |
75 | 02a9f323 | humkyung | ViewerDataModel.Instance.UndoDataList.Add(UndoDataGroup); |
76 | f513c215 | humkyung | |
77 | 39f0624f | ljiyeon | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
78 | 873011c4 | humkyung | MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
79 | 4eb052e4 | ljiyeon | |
80 | f513c215 | humkyung | control.ApplyOverViewData(); |
81 | } |
||
82 | } |
||
83 | } |