개정판 c00d0547
revised issue #999: fixed save logic
Change-Id: Ib7d414754fe0e14559b2fb1e6a612c537af5bde9
KCOM/Events/SaveCommand.cs | ||
---|---|---|
6 | 6 |
using MarkupToPDF.Controls.Parsing; |
7 | 7 |
using System; |
8 | 8 |
using System.Collections.Generic; |
9 |
using System.Collections.ObjectModel; |
|
9 | 10 |
using System.Linq; |
10 | 11 |
using System.Text; |
11 | 12 |
using System.Windows.Controls; |
... | ... | |
80 | 81 |
List<MARKUP_DATA> markupdata = new List<MARKUP_DATA>(); |
81 | 82 |
ViewerDataModel.Instance.MyMarkupList.Where(d => d.MarkupInfoID == UserState.MarkupInfoID).ToList().GroupBy(p => p.ID).Select(g => g.First()).ToList().ForEach(value => |
82 | 83 |
{ |
83 |
var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, value.Data, null, "#FFFF0000", "", |
|
84 |
value.MarkupInfoID, value.ID); |
|
85 |
markupdata.Add((control as CommentUserInfo).GetMarkupData(App.ViewInfo.UserID, value.PageNumber, UserState.MarkupVersionID)); |
|
84 |
markupdata.Add(new MARKUP_DATA() |
|
85 |
{ |
|
86 |
ID = value.ID, |
|
87 |
PAGENUMBER = value.PageNumber, |
|
88 |
DATA = value.Data, |
|
89 |
MARKUPINFO_VERSION_ID = UserState.MarkupVersionID, |
|
90 |
DATA_TYPE = value.Data_Type |
|
91 |
}); |
|
86 | 92 |
}); |
87 | 93 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveMarkupData(UserState, Project_No, document_id, user_id, markupdata); |
88 | 94 |
} |
MarkupToPDF/Controls/Parsing/MarkupParse.cs | ||
---|---|---|
289 | 289 |
{ |
290 | 290 |
if (!string.IsNullOrEmpty(commentId)) control.CommentID = commentId; |
291 | 291 |
if (!string.IsNullOrEmpty(markupInfoID)) control.MarkupInfoID = markupInfoID; |
292 |
if(baseLayer != null) baseLayer.Add(control); |
|
293 |
control.ApplyTemplate(); |
|
294 |
///control.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage); |
|
295 |
|
|
296 |
if (control is ArrowTextControl) |
|
292 |
if (baseLayer != null) |
|
297 | 293 |
{ |
298 |
ArrowTextControl _instance = control as ArrowTextControl; |
|
299 |
if (_instance.UnderLine == TextDecorations.Underline) |
|
294 |
baseLayer.Add(control); |
|
295 |
control.ApplyTemplate(); |
|
296 |
|
|
297 |
if (control is ArrowTextControl) |
|
300 | 298 |
{ |
301 |
_instance.Base_TextBox.TextDecorations = _instance.UnderLine; |
|
299 |
ArrowTextControl _instance = control as ArrowTextControl; |
|
300 |
if (_instance.UnderLine == TextDecorations.Underline) |
|
301 |
{ |
|
302 |
_instance.Base_TextBox.TextDecorations = _instance.UnderLine; |
|
303 |
} |
|
304 |
_instance.Base_TextBox.IsHitTestVisible = false; |
|
302 | 305 |
} |
303 |
_instance.Base_TextBox.IsHitTestVisible = false; |
|
304 |
} |
|
305 |
else if (control is TextControl) |
|
306 |
{ |
|
307 |
TextControl text = control as TextControl; |
|
308 |
text.Base_TextBlock.TextDecorations = text.UnderLine; |
|
309 |
text.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0); |
|
310 |
text.Base_TextBox.Visibility = Visibility.Collapsed; |
|
311 |
text.Base_TextBlock.Visibility = Visibility.Visible; |
|
312 |
} |
|
313 |
else if (control is SymControlN) |
|
314 |
{ |
|
315 |
SymControlN _instance = control as SymControlN; |
|
306 |
else if (control is TextControl) |
|
307 |
{ |
|
308 |
TextControl text = control as TextControl; |
|
309 |
text.Base_TextBlock.TextDecorations = text.UnderLine; |
|
310 |
text.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0); |
|
311 |
text.Base_TextBox.Visibility = Visibility.Collapsed; |
|
312 |
text.Base_TextBlock.Visibility = Visibility.Visible; |
|
313 |
} |
|
314 |
else if (control is SymControlN) |
|
315 |
{ |
|
316 |
SymControlN _instance = control as SymControlN; |
|
316 | 317 |
|
317 |
var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(_instance.PathXathData); |
|
318 |
xamlData = xamlData.Replace("daelim", "DAELIM"); |
|
319 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
|
320 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
|
321 |
writer.Write(xamlData); |
|
322 |
writer.Flush(); |
|
323 |
stream.Position = 0; |
|
318 |
var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(_instance.PathXathData);
|
|
319 |
xamlData = xamlData.Replace("daelim", "DAELIM");
|
|
320 |
System.IO.MemoryStream stream = new System.IO.MemoryStream();
|
|
321 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
|
|
322 |
writer.Write(xamlData);
|
|
323 |
writer.Flush();
|
|
324 |
stream.Position = 0;
|
|
324 | 325 |
|
325 |
object obj = XamlReader.Load(stream); |
|
326 |
_instance.Base_ViewBox.Child = obj as UIElement; |
|
327 |
_instance.SetViewBox(); |
|
326 |
object obj = XamlReader.Load(stream); |
|
327 |
_instance.Base_ViewBox.Child = obj as UIElement; |
|
328 |
_instance.SetViewBox(); |
|
329 |
} |
|
328 | 330 |
} |
329 | 331 |
} |
330 | 332 |
} |
내보내기 Unified diff