markus / KCOM / Common / TempFile.cs @ 2007ecaa
이력 | 보기 | 이력해설 | 다운로드 (24.3 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.Windows.Threading; |
25 |
using System.Xml; |
26 |
using System.Xml.Serialization; |
27 |
|
28 |
namespace KCOM |
29 |
{ |
30 |
public class TempFile |
31 |
{ |
32 |
//public static string TempFolder = AppDomain.CurrentDomain.BaseDirectory + "Temp"; |
33 |
//public static string TempFolder = Path.GetTempPath() + "\\MARKUS"; |
34 |
//public static string TempFilePath = TempFolder + "\\" + App.ViewInfo.DocumentItemID + ".tmp"; |
35 |
|
36 |
public static string TempFolder |
37 |
{ |
38 |
get |
39 |
{ |
40 |
return Path.Combine(Path.GetTempPath(), "MARKUS"); |
41 |
} |
42 |
} |
43 |
|
44 |
public static string TempFilePath |
45 |
{ |
46 |
get |
47 |
{ |
48 |
return Path.Combine(Path.GetTempPath(), "MARKUS",App.ViewInfo.DocumentItemID + ".tmp"); |
49 |
} |
50 |
} |
51 |
|
52 |
internal static void WriteTemp(List<TempDt> tempDtList) |
53 |
{ |
54 |
if (tempDtList.Count > 0) |
55 |
{ |
56 |
XmlDocument xmlDoc; |
57 |
XmlElement xmlEle1, xmlEle2, xmlEle3, xmlEle4, xmlEle5, xmlEle6; |
58 |
XmlNode newNode; |
59 |
xmlDoc = new XmlDocument(); |
60 |
|
61 |
if ((System.IO.File.Exists(TempFilePath)) == false) |
62 |
{ |
63 |
if (!File.Exists(TempFolder)) |
64 |
{ |
65 |
Directory.CreateDirectory(TempFolder); |
66 |
} |
67 |
|
68 |
XmlWriterSettings settings = new XmlWriterSettings(); |
69 |
settings.Indent = true; |
70 |
settings.NewLineOnAttributes = true; |
71 |
|
72 |
XmlWriter xmlWriter = XmlWriter.Create(TempFilePath); |
73 |
xmlWriter.WriteStartDocument(); |
74 |
xmlWriter.WriteStartElement("Root"); |
75 |
|
76 |
xmlWriter.WriteEndDocument(); |
77 |
|
78 |
xmlWriter.Flush(); |
79 |
xmlWriter.Close(); |
80 |
} |
81 |
|
82 |
xmlDoc.Load(TempFilePath); // XML문서 로딩 |
83 |
var nodes = xmlDoc.SelectNodes("/Root/CommentID"); |
84 |
for (int i = 0; i < tempDtList.Count; i++) |
85 |
{ |
86 |
bool check = true; |
87 |
|
88 |
foreach (XmlNode e in xmlDoc.GetElementsByTagName("CommentID")) |
89 |
{ |
90 |
if (e.Attributes["Value"].Value.Equals(tempDtList[i].CommentID)) //CommentID가 같은경우 |
91 |
{ |
92 |
//데이터 수정 |
93 |
e.SelectSingleNode("ConvertData").InnerText = tempDtList[i].ConvertData; |
94 |
e.SelectSingleNode("DATA_TYPE").InnerText = tempDtList[i].DATA_TYPE.ToString(); |
95 |
e.SelectSingleNode("MarkupInfoID").InnerText = tempDtList[i].MarkupInfoID; |
96 |
e.SelectSingleNode("PageNumber").InnerText = tempDtList[i].PageNumber.ToString(); |
97 |
e.SelectSingleNode("IsUpdate").InnerText = tempDtList[i].IsUpdate.ToString(); |
98 |
|
99 |
xmlDoc.Save(TempFilePath); // XML문서 저장 |
100 |
|
101 |
check = false; |
102 |
break; |
103 |
} |
104 |
} |
105 |
|
106 |
if (check == true) |
107 |
{ |
108 |
newNode = xmlDoc.SelectSingleNode("Root"); // 추가할 부모 Node 찾기 |
109 |
xmlEle1 = xmlDoc.CreateElement("CommentID"); |
110 |
xmlEle1.SetAttribute("Value", tempDtList[i].CommentID); |
111 |
newNode.AppendChild(xmlEle1); |
112 |
|
113 |
xmlEle2 = xmlDoc.CreateElement("ConvertData"); // 추가할 Node 생성 |
114 |
xmlEle2.InnerText = tempDtList[i].ConvertData; |
115 |
xmlEle1.AppendChild(xmlEle2); |
116 |
|
117 |
xmlEle3 = xmlDoc.CreateElement("DATA_TYPE"); // 추가할 Node 생성 |
118 |
xmlEle3.InnerText = tempDtList[i].DATA_TYPE.ToString(); |
119 |
xmlEle1.AppendChild(xmlEle3); |
120 |
|
121 |
xmlEle4 = xmlDoc.CreateElement("MarkupInfoID"); // 추가할 Node 생성 |
122 |
xmlEle4.InnerText = tempDtList[i].MarkupInfoID; |
123 |
xmlEle1.AppendChild(xmlEle4); |
124 |
|
125 |
xmlEle5 = xmlDoc.CreateElement("PageNumber"); // 추가할 Node 생성 |
126 |
xmlEle5.InnerText = tempDtList[i].PageNumber.ToString(); |
127 |
xmlEle1.AppendChild(xmlEle5); |
128 |
|
129 |
xmlEle6 = xmlDoc.CreateElement("IsUpdate"); |
130 |
xmlEle6.InnerText = tempDtList[i].IsUpdate.ToString(); |
131 |
xmlEle1.AppendChild(xmlEle6); |
132 |
|
133 |
xmlDoc.Save(TempFilePath); // XML문서 저장.. |
134 |
} |
135 |
} |
136 |
xmlDoc = null; |
137 |
} |
138 |
} |
139 |
|
140 |
public void AddTemp(MarkupToPDF.Common.Undo_data undoDataList, int PageNumber, double x, double y) |
141 |
{ |
142 |
XmlDocument xmlDoc; |
143 |
XmlElement xmlEle1, xmlEle2, xmlEle3, xmlEle4, xmlEle5, xmlEle6; |
144 |
XmlNode newNode; |
145 |
xmlDoc = new XmlDocument(); |
146 |
|
147 |
if ((System.IO.File.Exists(TempFilePath)) == false) |
148 |
{ |
149 |
if (!File.Exists(TempFolder)) |
150 |
{ |
151 |
Directory.CreateDirectory(TempFolder); |
152 |
} |
153 |
|
154 |
XmlWriterSettings settings = new XmlWriterSettings(); |
155 |
settings.Indent = true; |
156 |
settings.NewLineOnAttributes = true; |
157 |
|
158 |
XmlWriter xmlWriter = XmlWriter.Create(TempFilePath); |
159 |
xmlWriter.WriteStartDocument(); |
160 |
xmlWriter.WriteStartElement("Root"); |
161 |
|
162 |
xmlWriter.WriteEndDocument(); |
163 |
|
164 |
xmlWriter.Flush(); |
165 |
xmlWriter.Close(); |
166 |
} |
167 |
|
168 |
xmlDoc.Load(TempFilePath); // XML문서 로딩 |
169 |
var nodes = xmlDoc.SelectNodes("/Root/CommentID"); |
170 |
for (int i = 0; i < undoDataList.Markup_List.Count; i++) |
171 |
{ |
172 |
var root = MarkupParser.MarkupToString(undoDataList.Markup_List[i].Markup, App.ViewInfo.UserID); |
173 |
bool check = true; |
174 |
|
175 |
foreach (XmlNode e in xmlDoc.GetElementsByTagName("CommentID")) |
176 |
{ |
177 |
if (e.Attributes["Value"].Value.Equals(root.CommentID)) //CommentID가 같은경우 |
178 |
{ |
179 |
//데이터 수정 |
180 |
e.SelectSingleNode("ConvertData").InnerText = root.ConvertData; |
181 |
e.SelectSingleNode("DATA_TYPE").InnerText = root.DATA_TYPE.ToString(); |
182 |
e.SelectSingleNode("MarkupInfoID").InnerText = undoDataList.Markup_List[i].Markup.MarkupInfoID; |
183 |
e.SelectSingleNode("PageNumber").InnerText = PageNumber.ToString(); |
184 |
e.SelectSingleNode("IsUpdate").InnerText = 1.ToString(); |
185 |
|
186 |
xmlDoc.Save(TempFilePath); // XML문서 저장 |
187 |
|
188 |
check = false; |
189 |
break; |
190 |
} |
191 |
} |
192 |
|
193 |
if (check == true) |
194 |
{ |
195 |
newNode = xmlDoc.SelectSingleNode("Root"); |
196 |
xmlEle1 = xmlDoc.CreateElement("CommentID"); |
197 |
xmlEle1.SetAttribute("Value", root.CommentID); |
198 |
newNode.AppendChild(xmlEle1); |
199 |
|
200 |
xmlEle2 = xmlDoc.CreateElement("ConvertData"); |
201 |
xmlEle2.InnerText = root.ConvertData; |
202 |
xmlEle1.AppendChild(xmlEle2); |
203 |
|
204 |
xmlEle3 = xmlDoc.CreateElement("DATA_TYPE"); |
205 |
xmlEle3.InnerText = root.DATA_TYPE.ToString(); |
206 |
xmlEle1.AppendChild(xmlEle3); |
207 |
|
208 |
xmlEle4 = xmlDoc.CreateElement("MarkupInfoID"); |
209 |
xmlEle4.InnerText = undoDataList.Markup_List[i].Markup.MarkupInfoID; |
210 |
xmlEle1.AppendChild(xmlEle4); |
211 |
|
212 |
xmlEle5 = xmlDoc.CreateElement("PageNumber"); |
213 |
xmlEle5.InnerText = PageNumber.ToString(); |
214 |
xmlEle1.AppendChild(xmlEle5); |
215 |
|
216 |
xmlEle6 = xmlDoc.CreateElement("IsUpdate"); |
217 |
xmlEle6.InnerText = 1.ToString(); |
218 |
xmlEle1.AppendChild(xmlEle6); |
219 |
|
220 |
xmlDoc.Save(TempFilePath); |
221 |
} |
222 |
} |
223 |
xmlDoc = null; |
224 |
} |
225 |
|
226 |
public static void Remove() |
227 |
{ |
228 |
FileInfo fileDel = new FileInfo(TempFilePath); |
229 |
if (fileDel.Exists) |
230 |
{ |
231 |
fileDel.Delete(); |
232 |
} |
233 |
} |
234 |
|
235 |
internal static void DelTemp(string CommentID, string PageNumber) //Control 삭제시 |
236 |
{ |
237 |
if ((System.IO.File.Exists(TempFilePath)) == false) |
238 |
{ |
239 |
if (!File.Exists(TempFolder)) |
240 |
{ |
241 |
Directory.CreateDirectory(TempFolder); |
242 |
} |
243 |
|
244 |
XmlWriterSettings settings = new XmlWriterSettings(); |
245 |
settings.Indent = true; |
246 |
settings.NewLineOnAttributes = true; |
247 |
|
248 |
XmlWriter xmlWriter = XmlWriter.Create(TempFilePath); |
249 |
xmlWriter.WriteStartDocument(); |
250 |
xmlWriter.WriteStartElement("Root"); |
251 |
|
252 |
xmlWriter.WriteEndDocument(); |
253 |
|
254 |
xmlWriter.Flush(); |
255 |
xmlWriter.Close(); |
256 |
} |
257 |
|
258 |
XmlDocument xmlDoc; |
259 |
xmlDoc = new XmlDocument(); |
260 |
xmlDoc.Load(TempFilePath); |
261 |
|
262 |
var nodes = xmlDoc.SelectNodes("/Root/CommentID"); |
263 |
XmlElement root = xmlDoc.DocumentElement; |
264 |
|
265 |
bool check = true; |
266 |
|
267 |
/* |
268 |
foreach (XmlNode node in nodes) |
269 |
{ |
270 |
string sCommentID = node.Attributes["Value"].Value; |
271 |
|
272 |
if (sCommentID == CommentID) |
273 |
{ |
274 |
root.RemoveChild(xmlDoc.SelectNodes("//CommentID[@Value='" + CommentID + "']")[0]); |
275 |
check = false; |
276 |
} |
277 |
}*/ |
278 |
|
279 |
if (check == true) |
280 |
{ |
281 |
XmlElement xmlEle1, xmlEle2, xmlEle3, xmlEle4, xmlEle5, xmlEle6; |
282 |
XmlNode newNode; |
283 |
newNode = xmlDoc.SelectSingleNode("Root"); |
284 |
xmlEle1 = xmlDoc.CreateElement("CommentID"); |
285 |
xmlEle1.SetAttribute("Value", CommentID); |
286 |
newNode.AppendChild(xmlEle1); |
287 |
|
288 |
xmlEle2 = xmlDoc.CreateElement("ConvertData"); |
289 |
xmlEle2.InnerText = ""; |
290 |
xmlEle1.AppendChild(xmlEle2); |
291 |
|
292 |
xmlEle3 = xmlDoc.CreateElement("DATA_TYPE"); |
293 |
xmlEle3.InnerText = ""; |
294 |
xmlEle1.AppendChild(xmlEle3); |
295 |
|
296 |
xmlEle4 = xmlDoc.CreateElement("MarkupInfoID"); |
297 |
xmlEle4.InnerText = ""; |
298 |
xmlEle1.AppendChild(xmlEle4); |
299 |
|
300 |
xmlEle5 = xmlDoc.CreateElement("PageNumber"); |
301 |
xmlEle5.InnerText = PageNumber; |
302 |
xmlEle1.AppendChild(xmlEle5); |
303 |
|
304 |
xmlEle6 = xmlDoc.CreateElement("IsUpdate"); |
305 |
xmlEle6.InnerText = 2.ToString(); |
306 |
xmlEle1.AppendChild(xmlEle6); |
307 |
} |
308 |
|
309 |
xmlDoc.Save(TempFilePath); |
310 |
xmlDoc = null; |
311 |
} |
312 |
|
313 |
public class TempLoadData |
314 |
{ |
315 |
public int PageNumber { get; set; } |
316 |
public string CommentID { get; set; } |
317 |
public string ConvertData { get; set; } |
318 |
public string DATA_TYPE { get; set; } |
319 |
public string MarkupInfoID { get; set; } |
320 |
public int IsUpdate { get; set; } |
321 |
} |
322 |
|
323 |
static List<TempLoadData> tempLoadData = new List<TempLoadData>(); |
324 |
|
325 |
|
326 |
public static Undo_data UndoData { get; set; } |
327 |
|
328 |
public class TempDt |
329 |
{ |
330 |
public int PageNumber { get; set; } |
331 |
public string CommentID { get; set; } |
332 |
public string ConvertData { get; set; } |
333 |
public int DATA_TYPE { get; set; } |
334 |
public string MarkupInfoID { get; set; } |
335 |
public int IsUpdate { get; set; } |
336 |
} |
337 |
|
338 |
public static List<TempDt> tempDtList = new List<TempDt>(); |
339 |
|
340 |
public static void TempLoad() |
341 |
{ |
342 |
if ((System.IO.File.Exists(TempFilePath)) == true) |
343 |
{ |
344 |
XmlDocument xdoc = new XmlDocument(); |
345 |
xdoc.Load(TempFilePath); |
346 |
XmlNodeList nodes = xdoc.SelectNodes("/Root/CommentID"); |
347 |
int PageNumber = 0; |
348 |
if (nodes.Count > 0) |
349 |
{ |
350 |
if (MessageBox.Show("저장하지 못한 데이터가 있습니다. 불러오시겠습니까?", "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK) |
351 |
{ |
352 |
foreach (XmlNode node in nodes) |
353 |
{ |
354 |
string CommentID = node.Attributes["Value"].Value; |
355 |
string ConvertData = node.SelectSingleNode("ConvertData").InnerText; |
356 |
string DATA_TYPE = node.SelectSingleNode("DATA_TYPE").InnerText; |
357 |
string MarkupInfoID = node.SelectSingleNode("MarkupInfoID").InnerText; |
358 |
int IsUpdate = Convert.ToInt32(node.SelectSingleNode("IsUpdate").InnerText); |
359 |
PageNumber = Convert.ToInt32(node.SelectSingleNode("PageNumber").InnerText); |
360 |
|
361 |
tempLoadData.Add(new TempLoadData() |
362 |
{ |
363 |
PageNumber = PageNumber, |
364 |
CommentID = CommentID, |
365 |
ConvertData = ConvertData, |
366 |
DATA_TYPE = DATA_TYPE, |
367 |
MarkupInfoID = MarkupInfoID, |
368 |
IsUpdate = IsUpdate |
369 |
}); |
370 |
} |
371 |
|
372 |
if (PageNumber > 0) |
373 |
{ |
374 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(PageNumber); |
375 |
} |
376 |
|
377 |
// Temp Object add |
378 |
if (Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber == PageNumber) |
379 |
{ |
380 |
TempControlLoadAsync(); |
381 |
} |
382 |
tempLoadData.Clear(); |
383 |
} |
384 |
} |
385 |
else //파일 삭제 |
386 |
{ |
387 |
TempFile.Remove(); |
388 |
} |
389 |
} |
390 |
} |
391 |
|
392 |
|
393 |
//Temp Control Load |
394 |
public static async void TempControlLoadAsync() |
395 |
{ |
396 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
397 |
|
398 |
for (int k = 0; k < tempLoadData.Count; k++) |
399 |
{ |
400 |
System.Windows.Controls.Control item = null; |
401 |
Multi_Undo_data multi_Undo_Data; |
402 |
|
403 |
|
404 |
switch (tempLoadData[k].IsUpdate) |
405 |
{ |
406 |
case 0://추가 |
407 |
var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.CommentID == tempLoadData[k].CommentID).FirstOrDefault(); |
408 |
if (control != null) |
409 |
{ |
410 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(control); |
411 |
var Item_ = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault(); |
412 |
ViewerDataModel.Instance.MyMarkupList.Remove(Item_); |
413 |
} |
414 |
|
415 |
//Control |
416 |
item = await MarkupParser.ParseExAsync(ViewerDataModel.Instance.CancellationToken(), App.ViewInfo.ProjectNO, tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID); |
417 |
|
418 |
UndoData = new Undo_data() |
419 |
{ |
420 |
IsUndo = false, |
421 |
Event = Event_Type.Create, |
422 |
EventTime = DateTime.Now, |
423 |
Opacity = ViewerDataModel.Instance.ControlOpacity, |
424 |
Markup_List = new List<Multi_Undo_data>() |
425 |
}; |
426 |
|
427 |
multi_Undo_Data = new Multi_Undo_data(); |
428 |
multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
429 |
UndoData.Markup_List.Add(multi_Undo_Data); |
430 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
431 |
break; |
432 |
case 1://수정 |
433 |
control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.CommentID == tempLoadData[k].CommentID).FirstOrDefault(); |
434 |
if (control != null) |
435 |
{ |
436 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(control); |
437 |
var Item_ = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault(); |
438 |
ViewerDataModel.Instance.MyMarkupList.Remove(Item_); |
439 |
} |
440 |
|
441 |
//Control |
442 |
item = await MarkupParser.ParseExAsync(null, App.ViewInfo.ProjectNO, tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID); |
443 |
|
444 |
UndoData = new Undo_data() |
445 |
{ |
446 |
IsUndo = false, |
447 |
Event = Event_Type.Thumb, |
448 |
EventTime = DateTime.Now, |
449 |
Opacity = ViewerDataModel.Instance.ControlOpacity, |
450 |
Markup_List = new List<Multi_Undo_data>() |
451 |
}; |
452 |
|
453 |
multi_Undo_Data = new Multi_Undo_data(); |
454 |
multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
455 |
UndoData.Markup_List.Add(multi_Undo_Data); |
456 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
457 |
break; |
458 |
case 2://삭제 |
459 |
|
460 |
control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.CommentID == tempLoadData[k].CommentID).FirstOrDefault(); |
461 |
if (control != null) |
462 |
{ |
463 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(control); |
464 |
var Item_ = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault(); |
465 |
ViewerDataModel.Instance.MyMarkupList.Remove(Item_); |
466 |
} |
467 |
break; |
468 |
} |
469 |
} |
470 |
} |
471 |
// public static Dispatcher Dispatcher { get; } |
472 |
public static void TempFileAdd() |
473 |
{ |
474 |
System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate |
475 |
{ |
476 |
if (ViewerDataModel.Instance.UndoDataList.Count > 0) |
477 |
{ |
478 |
DateTime undoTime = ViewerDataModel.Instance.UndoDataList.OrderByDescending(order => order.EventTime).FirstOrDefault().EventTime; |
479 |
DateTime updatetime = DateTime.Now.AddDays(-1); |
480 |
if (ViewerDataModel.Instance._markupInfoList.Count > 0) |
481 |
{ |
482 |
updatetime = ViewerDataModel.Instance._markupInfoList.OrderByDescending(order => order.UpdateTime).FirstOrDefault().UpdateTime; |
483 |
} |
484 |
|
485 |
if (undoTime > updatetime) |
486 |
{ |
487 |
if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0) |
488 |
{ |
489 |
foreach (var control in ViewerDataModel.Instance.MarkupControls_USER) |
490 |
{ |
491 |
var root = MarkupParser.MarkupToString(control, App.ViewInfo.UserID); |
492 |
|
493 |
var existItem = ViewerDataModel.Instance.MyMarkupList.Where(data => data.ID == root.CommentID).FirstOrDefault(); |
494 |
if (existItem != null) |
495 |
{ |
496 |
if (existItem.Data != root.ConvertData) |
497 |
{ |
498 |
tempDtList.Add(new TempDt() |
499 |
{ |
500 |
CommentID = control.CommentID, |
501 |
ConvertData = root.ConvertData, |
502 |
DATA_TYPE = root.DATA_TYPE, |
503 |
MarkupInfoID = App.Custom_ViewInfoId, |
504 |
PageNumber = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber, |
505 |
IsUpdate = 1 |
506 |
}); |
507 |
} |
508 |
} |
509 |
else //신규 추가 된 코멘트 |
510 |
{ |
511 |
if (root.CommentID != null) |
512 |
{ |
513 |
var currentCommentCheck = ViewerDataModel.Instance.MyMarkupList.Where(dt => dt.ID == control.CommentID).FirstOrDefault(); |
514 |
if (currentCommentCheck != null) |
515 |
{ |
516 |
tempDtList.Add(new TempDt() |
517 |
{ |
518 |
CommentID = control.CommentID, |
519 |
ConvertData = root.ConvertData, |
520 |
DATA_TYPE = root.DATA_TYPE, |
521 |
MarkupInfoID = App.Custom_ViewInfoId, |
522 |
PageNumber = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber, |
523 |
IsUpdate = 1 |
524 |
}); |
525 |
} |
526 |
else |
527 |
{ |
528 |
tempDtList.Add(new TempDt() |
529 |
{ |
530 |
CommentID = control.CommentID, |
531 |
ConvertData = root.ConvertData, |
532 |
DATA_TYPE = root.DATA_TYPE, |
533 |
MarkupInfoID = App.Custom_ViewInfoId, |
534 |
PageNumber = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber, |
535 |
IsUpdate = 0 |
536 |
}); |
537 |
} |
538 |
} |
539 |
} |
540 |
} |
541 |
} |
542 |
|
543 |
WriteTemp(tempDtList); |
544 |
tempDtList.Clear(); |
545 |
} |
546 |
} |
547 |
})); |
548 |
|
549 |
} |
550 |
|
551 |
//public static string TempFolder = System.IO.Path.GetTempPath() + "\\MARKUS\\" + App.ViewInfo.DocumentItemID + ".tmp"; |
552 |
|
553 |
} |
554 |
} |
555 |
|