프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Events / CreateCommand.cs @ 95c73392

이력 | 보기 | 이력해설 | 다운로드 (2.43 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
            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
61
            {
62
                ViewerDataModel.Instance.UndoDataList.Remove(i);
63
            });
64
65
            MarkupToPDF.Common.Undo_data UndoData = new Undo_data()
66
            {
67
                IsUndo = false,
68
                Event = Event_Type.Create,
69
                EventTime = DateTime.Now,
70
                Markup_List = new List<Multi_Undo_data>()
71
            };
72
73
            Multi_Undo_data multi_Undo_Data = new Multi_Undo_data()
74
            {
75
                Markup = control
76
            };
77
            UndoData.Markup_List.Add(multi_Undo_Data);
78
79
            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
80
81 39f0624f ljiyeon
            ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
82 4eb052e4 ljiyeon
                MarkupParser.MarkupToString(multi_Undo_Data.Markup, App.ViewInfo.UserID), Event_Type.Create, null, null);
83
84 f513c215 humkyung
            control.ApplyOverViewData();
85
        }
86
    }
87
}
클립보드 이미지 추가 (최대 크기: 500 MB)