markus / KCOM / Events / CreateCommand.cs @ 873011c4
이력 | 보기 | 이력해설 | 다운로드 (2.45 KB)
1 |
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 |
using static KCOM.Controls.Sample; |
27 |
|
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 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo).ToList() |
61 |
.ForEach(i => |
62 |
{ |
63 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
64 |
}); |
65 |
|
66 |
MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup() |
67 |
{ |
68 |
IsUndo = false, |
69 |
Event = EventType.Create, |
70 |
EventTime = DateTime.Now, |
71 |
MarkupDataColl = new List<Multi_UndoData>() |
72 |
}; |
73 |
|
74 |
Multi_UndoData multi_UndoData = new Multi_UndoData() |
75 |
{ |
76 |
Markup = control |
77 |
}; |
78 |
UndoData.MarkupDataColl.Add(multi_UndoData); |
79 |
|
80 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
81 |
|
82 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
83 |
MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
84 |
|
85 |
control.ApplyOverViewData(); |
86 |
} |
87 |
} |
88 |
} |