프로젝트

일반

사용자정보

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

markus / KCOM / Events / CutCommand.cs @ 6dcbe4a7

이력 | 보기 | 이력해설 | 다운로드 (2.68 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

    
27
namespace KCOM
28
{
29
    public class CutCommand
30
    {
31
        private static readonly CutCommand _instance = new CutCommand();
32

    
33
        // Explicit static constructor to tell C# compiler
34
        // not to mark type as beforefieldinit
35
        static CutCommand()
36
        {
37
        }
38

    
39
        private CutCommand()
40
        {
41
        }
42

    
43
        public static CutCommand Instance
44
        {
45
            get
46
            {
47
                return _instance;
48
            }
49
        }
50

    
51
        /// <summary>
52
        /// cut selected controls
53
        /// </summary>
54
        /// <author>humkyung</author>
55
        /// <date>2019.06.18</date>
56
        /// <param name="comments"></param>
57
        public void Execute()
58
        {
59
            if (Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count > 0)
60
            {
61
                string MarkupData = string.Empty;
62

    
63
                foreach (var item in Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children)
64
                {
65
                    string id = string.Empty;
66
                    if (item.GetType().Name == "AdornerFinal")
67
                    {
68
                        foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
69
                        {
70
                            var data = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
71
                            id = (InnerItem.Symbol_ID != null) ? "|SymbolID|" + InnerItem.Symbol_ID : "";
72
                            MarkupData += "|OR|" + data.ConvertData + id;
73

    
74
                            ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
75
                            null, Event_Type.Delete, data.CommentID, null);
76
                        }
77

    
78
                        Clipboard.SetText(MarkupData);
79
                    }
80
                }
81

    
82
                Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Clear();
83
            }
84
        }
85
    }
86
}
클립보드 이미지 추가 (최대 크기: 500 MB)