markus / KCOM / Events / CopyCommand.cs @ 26ec6226
이력 | 보기 | 이력해설 | 다운로드 (2.44 KB)
1 | b37ef4b3 | 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 | |||
27 | namespace KCOM |
||
28 | { |
||
29 | public class CopyCommand |
||
30 | { |
||
31 | private static readonly CopyCommand _instance = new CopyCommand(); |
||
32 | |||
33 | // Explicit static constructor to tell C# compiler |
||
34 | // not to mark type as beforefieldinit |
||
35 | static CopyCommand() |
||
36 | { |
||
37 | } |
||
38 | |||
39 | private CopyCommand() |
||
40 | { |
||
41 | } |
||
42 | |||
43 | public static CopyCommand Instance |
||
44 | { |
||
45 | get |
||
46 | { |
||
47 | return _instance; |
||
48 | } |
||
49 | } |
||
50 | |||
51 | /// <summary> |
||
52 | /// copy 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 | 26ec6226 | taeseongkim | |
75 | Clipboard.SetText(MarkupData,TextDataFormat.Text); |
||
76 | b37ef4b3 | humkyung | } |
77 | } |
||
78 | } |
||
79 | } |
||
80 | } |
||
81 | } |