markus / KCOM / Events / Implementation / TopMenuEvent.cs @ 24678e06
이력 | 보기 | 이력해설 | 다운로드 (146 KB)
1 |
using KCOM.Common; |
---|---|
2 |
using KCOM.Common.Converter; |
3 |
using KCOM.Controls; |
4 |
using KCOM.Events; |
5 |
using KCOMDataModel.DataModel; |
6 |
using MarkupToPDF.Common; |
7 |
using Svg2Xaml; |
8 |
using System; |
9 |
using System.Collections.Generic; |
10 |
using System.Linq; |
11 |
using System.Text; |
12 |
using System.Windows; |
13 |
using System.Windows.Controls; |
14 |
using System.Windows.Input; |
15 |
using System.Windows.Media; |
16 |
using System.Windows.Media.Imaging; |
17 |
using Telerik.Windows.Controls; |
18 |
using IKCOM; |
19 |
using Microsoft.Win32; |
20 |
using System.IO; |
21 |
using System.Reflection; |
22 |
using System.Windows.Controls.Primitives; |
23 |
using MarkupToPDF.Controls.Parsing; |
24 |
|
25 |
namespace KCOM.Views |
26 |
{ |
27 |
public partial class TopMenu : UserControl |
28 |
{ |
29 |
public int rotateOffSet = 0; |
30 |
private double[] rotateValue = { 0, 90, 180, 270 }; |
31 |
public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; } |
32 |
public bool isClosed = true; |
33 |
public RadWindow CheckPop; |
34 |
public RadWindow OptionPop; |
35 |
public MarkupToPDF.Common.Undo_data UndoData; |
36 |
MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn(); |
37 |
|
38 |
/// <summary> |
39 |
/// TaskBar에 메시지를 입력합니다 |
40 |
/// </summary> |
41 |
/// <param name="message"></param> |
42 |
/// <param name="type"></param> |
43 |
public void TaskMessage(string message, TaskMessageType type) |
44 |
{ |
45 |
//if (taskBar != null) |
46 |
//{ |
47 |
// string color = ""; |
48 |
// taskBar.Content = message; |
49 |
// DicTaskMessage.TryGetValue(type, out color); |
50 |
// taskBar.Foreground = new SolidColorBrush(StringToColorConverter.Parse(color)); |
51 |
//} |
52 |
} |
53 |
|
54 |
/// <summary> |
55 |
/// Task Type명을 Key값으로 지정합니다 |
56 |
/// </summary> |
57 |
public enum TaskMessageType |
58 |
{ |
59 |
Normal, |
60 |
Caption, |
61 |
Error, |
62 |
} |
63 |
|
64 |
private void CheckShapeState() |
65 |
{ |
66 |
|
67 |
|
68 |
if (cbHatchShape.IsChecked == true) |
69 |
{ |
70 |
cbFillShape.IsChecked = false; |
71 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch; |
72 |
} |
73 |
else if(cbFillShape.IsChecked == true) |
74 |
{ |
75 |
cbHatchShape.IsChecked = false; |
76 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill; |
77 |
} |
78 |
else |
79 |
{ |
80 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
81 |
} |
82 |
} |
83 |
|
84 |
//강인구 추가(Undo End) |
85 |
private void SetPaintEvent() |
86 |
{ |
87 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
88 |
|
89 |
if (AdonerList.Count > 0) |
90 |
{ |
91 |
Undo_data UndoData = new Undo_data() |
92 |
{ |
93 |
IsUndo = false, |
94 |
Event = Event_Type.Option, |
95 |
EventTime = DateTime.Now, |
96 |
paint = ViewerDataModel.Instance.paintSet, |
97 |
Markup_List = new List<Multi_Undo_data>() |
98 |
}; |
99 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
100 |
|
101 |
foreach (AdornerMember InnerItem in AdonerList) |
102 |
{ |
103 |
multi_Undo_Data.PointSet = new List<Point>(); |
104 |
|
105 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null) |
106 |
{ |
107 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet; |
108 |
} |
109 |
|
110 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
111 |
UndoData.Markup_List.Add(multi_Undo_Data); |
112 |
multi_Undo_Data = new Multi_Undo_data(); |
113 |
} |
114 |
|
115 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
116 |
{ |
117 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
118 |
}); |
119 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
120 |
|
121 |
|
122 |
} |
123 |
|
124 |
} |
125 |
|
126 |
private void SetHighlightEvent() |
127 |
{ |
128 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
129 |
|
130 |
if (AdonerList.Count > 0) |
131 |
{ |
132 |
foreach (AdornerMember InnerItem in AdonerList) |
133 |
{ |
134 |
switch (InnerItem.DrawingData.GetType().Name) |
135 |
{ |
136 |
case ("TextControl"): |
137 |
{ |
138 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
139 |
} |
140 |
break; |
141 |
case ("ArrowTextControl"): |
142 |
{ |
143 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
144 |
} |
145 |
break; |
146 |
} |
147 |
} |
148 |
} |
149 |
|
150 |
} |
151 |
|
152 |
private void FillShapeEvent(object sender, RoutedEventArgs e) |
153 |
{ |
154 |
#region 주석 |
155 |
//if ((sender as CheckBox).IsChecked.Value) |
156 |
//{ |
157 |
// cbHatchShape.IsChecked = false; |
158 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Fill.png", UriKind.Relative)); |
159 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Fill.png", UriKind.Relative)); |
160 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle_Fill.png", UriKind.Relative)); |
161 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon.png", UriKind.Relative)); |
162 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon.png", UriKind.Relative)); |
163 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_Fill.png", UriKind.Relative)); |
164 |
// TaskMessage("채우기 옵션이 적용되었습니다", TaskMessageType.Normal); |
165 |
//} |
166 |
//else |
167 |
//{ |
168 |
|
169 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative)); |
170 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative)); |
171 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative)); |
172 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative)); |
173 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative)); |
174 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative)); |
175 |
// TaskMessage("채우기 옵션이 해제되었습니다", TaskMessageType.Caption); |
176 |
//} |
177 |
#endregion |
178 |
ViewerDataModel.Instance.checkFillShape = (sender as CheckBox).IsChecked.Value; |
179 |
|
180 |
if (ViewerDataModel.Instance.checkFillShape) |
181 |
{ |
182 |
cbHatchShape.IsChecked = false; |
183 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill; |
184 |
} |
185 |
else |
186 |
{ |
187 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
188 |
} |
189 |
SetPaintEvent(); |
190 |
} |
191 |
|
192 |
/// <summary> |
193 |
/// 도형 빗금 처리 |
194 |
/// </summary> |
195 |
/// <param name="sender"></param> |
196 |
/// <param name="e"></param> |
197 |
private void HatchShapeEvent(object sender, RoutedEventArgs e) |
198 |
{ |
199 |
#region 주석 |
200 |
//if ((sender as CheckBox).IsChecked.Value) |
201 |
//{ |
202 |
// cbFillShape.IsChecked = false; |
203 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud_Hatch.png", UriKind.Relative)); |
204 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud_Hatch.png", UriKind.Relative)); |
205 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/rectangle-icon_Hatch.png", UriKind.Relative)); |
206 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_Hatch.png", UriKind.Relative)); |
207 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_Hatch.png", UriKind.Relative)); |
208 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon_hatch.png", UriKind.Relative)); |
209 |
// TaskMessage("무늬 옵션이 적용되었습니다", TaskMessageType.Normal); |
210 |
//} |
211 |
//else |
212 |
//{ |
213 |
// imgShape_RectCloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/RectCloud.png", UriKind.Relative)); |
214 |
// imgShape_Cloud.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Cloud.png", UriKind.Relative)); |
215 |
// imgShape_Rect.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/Rectangle.png", UriKind.Relative)); |
216 |
// imgShape_Tri.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/triangle-icon_None.png", UriKind.Relative)); |
217 |
// imgShape_Cicle.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/circle-icon_None.png", UriKind.Relative)); |
218 |
// imgShape_Poly.Source = new BitmapImage(new Uri("/DeepView;component/Images/MenuImage/polygon.png", UriKind.Relative)); |
219 |
// TaskMessage("무늬 옵션이 해제되었습니다", TaskMessageType.Caption); |
220 |
//} |
221 |
#endregion |
222 |
|
223 |
//강인구 추가 |
224 |
ViewerDataModel.Instance.checkHatchShape = (sender as CheckBox).IsChecked.Value; |
225 |
if (ViewerDataModel.Instance.checkHatchShape) |
226 |
{ |
227 |
cbFillShape.IsChecked = false; |
228 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch; |
229 |
} |
230 |
else |
231 |
{ |
232 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
233 |
} |
234 |
SetPaintEvent(); |
235 |
} |
236 |
|
237 |
//강인구 추가 |
238 |
private string SetColor(string ID) |
239 |
{ |
240 |
try |
241 |
{ |
242 |
return ViewerDataModel.Instance._markupInfoList.Where(info => info.MarkupInfoID == ID).First().DisplayColor; |
243 |
} |
244 |
catch (Exception) |
245 |
{ |
246 |
return "#FFFFFF"; |
247 |
} |
248 |
} |
249 |
|
250 |
void SaveTimer_Tick(object sender, EventArgs e) |
251 |
{ |
252 |
//if (this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode != IKCOM.MouseHandlingMode.Drawing) |
253 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl == null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count == 0) |
254 |
{ |
255 |
SaveEvent(null, null); |
256 |
} |
257 |
|
258 |
} |
259 |
|
260 |
private void SaveTime(bool IsRun) |
261 |
{ |
262 |
if(SaveTimer == null) |
263 |
{ |
264 |
SaveTimer = new System.Windows.Threading.DispatcherTimer(); |
265 |
SaveTimer.Interval = new TimeSpan(0, 0, 5); |
266 |
SaveTimer.Tick += new EventHandler(SaveTimer_Tick); |
267 |
} |
268 |
|
269 |
if (IsRun) |
270 |
{ |
271 |
SaveTimer.Start(); |
272 |
} |
273 |
else |
274 |
{ |
275 |
SaveTimer.Stop(); |
276 |
} |
277 |
} |
278 |
private void SaveTime(bool IsRun,int timeinterval) |
279 |
{ |
280 |
if (SaveTimer == null) |
281 |
{ |
282 |
SaveTimer = new System.Windows.Threading.DispatcherTimer(); |
283 |
SaveTimer.Interval = new TimeSpan(0, timeinterval, 0); |
284 |
SaveTimer.Tick += new EventHandler(SaveTimer_Tick); |
285 |
} |
286 |
else |
287 |
{ |
288 |
SaveTimer.Stop(); |
289 |
SaveTimer.Interval = new TimeSpan(0, timeinterval, 0); |
290 |
} |
291 |
|
292 |
if (IsRun) |
293 |
{ |
294 |
SaveTimer.Start(); |
295 |
} |
296 |
else |
297 |
{ |
298 |
SaveTimer.Stop(); |
299 |
} |
300 |
} |
301 |
/// <summary> |
302 |
/// enable busy indicator and then call _SaveEvent method. |
303 |
/// </summary> |
304 |
/// <param name="sender"></param> |
305 |
/// <param name="e"></param> |
306 |
public void SaveEvent(object sender, RoutedEventArgs e) |
307 |
{ |
308 |
this.ParentOfType<MainWindow>().dzMainMenu.EmptyControlCheck(); |
309 |
|
310 |
if (this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy == true) return; |
311 |
|
312 |
this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true; |
313 |
System.Threading.Tasks.Task SaveTask = System.Threading.Tasks.Task.Factory.StartNew(() => |
314 |
{ |
315 |
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action<object, RoutedEventArgs>(_SaveEvent), sender, e); |
316 |
}).ContinueWith(task => |
317 |
{ |
318 |
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate () { this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = false; })); |
319 |
}); |
320 |
} |
321 |
|
322 |
/// <summary> |
323 |
/// save document |
324 |
/// </summary> |
325 |
/// <param name="sender"></param> |
326 |
/// <param name="e"></param> |
327 |
public void _SaveEvent(object sender, RoutedEventArgs e) |
328 |
{ |
329 |
try |
330 |
{ |
331 |
this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner(); |
332 |
|
333 |
this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert(); |
334 |
|
335 |
var menu = this.ParentOfType<MainWindow>().dzMainMenu; |
336 |
|
337 |
//콘솔리 데잇일 경우 |
338 |
//if (ViewerDataModel.Instance.IsConsolidate && menu.gridViewMarkup.SelectedItems.Count > 1) |
339 |
//if (ViewerDataModel.Instance.IsConsolidate) |
340 |
//{ |
341 |
// ViewerDataModel.Instance.IsConsolidate = false; |
342 |
// return; |
343 |
//} |
344 |
|
345 |
//코멘트가 없을 경우 |
346 |
//if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0) |
347 |
//{ |
348 |
// foreach (var item in menu.gridViewMarkup.SelectedItems) |
349 |
// { |
350 |
// if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
351 |
// { |
352 |
// this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
353 |
// return; |
354 |
// } |
355 |
// } |
356 |
//} |
357 |
|
358 |
//코멘트가 없을 경우 |
359 |
if (ViewerDataModel.Instance.MarkupList_USER.Count == 0) |
360 |
{ |
361 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
362 |
{ |
363 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
364 |
{ |
365 |
this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
366 |
return; |
367 |
} |
368 |
} |
369 |
} |
370 |
|
371 |
if (ViewerDataModel.Instance.MarkupList_USER.Count > 0) |
372 |
{ |
373 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
374 |
{ |
375 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
376 |
{ |
377 |
/* |
378 |
if (menu.UndoData.Markup_List[0].Markup..GetType().Name == "TextControl" && ((MarkupToPDF.Controls.Text.TextControl)(item as IKCOM.MarkupInfoItem).MarkupList[0].).OverViewText == null) |
379 |
{ |
380 |
} |
381 |
|
382 |
this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
383 |
return;*/ |
384 |
} |
385 |
} |
386 |
} |
387 |
|
388 |
|
389 |
//코멘트가 없을 경우 |
390 |
//if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0) |
391 |
//if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0 && menu.gridViewMarkup.SelectedItems.Count == 0) |
392 |
//{ |
393 |
// foreach (var item in menu.gridViewMarkup.SelectedItems) |
394 |
// { |
395 |
// if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
396 |
// { |
397 |
// this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
398 |
// return; |
399 |
// } |
400 |
// } |
401 |
//} |
402 |
|
403 |
menu.ChangeCommentReact(); |
404 |
|
405 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
406 |
{ |
407 |
RefactoryCommentReact(menu); |
408 |
} |
409 |
else if (menu.gridViewMarkup.SelectedItems.Count == 0 && menu.gridViewMarkup.Items.Count > 0) |
410 |
{ |
411 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
412 |
return; |
413 |
} |
414 |
//else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
415 |
//{ |
416 |
// this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
417 |
// return; |
418 |
//} |
419 |
// 변경 |
420 |
else |
421 |
{ |
422 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
423 |
{ |
424 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
425 |
{ |
426 |
RefactoryCommentReact(menu); |
427 |
ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now; |
428 |
|
429 |
if (ViewerDataModel.Instance.IsConsolidate) |
430 |
{ |
431 |
return; |
432 |
} |
433 |
menu.gridViewMarkup.ItemsSource = null; |
434 |
menu.gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
435 |
menu.gridViewMarkup.SelectedItem = item; |
436 |
|
437 |
if (sender != null) |
438 |
{ |
439 |
if (ViewerDataModel.Instance.IsPressCtrl) |
440 |
{ |
441 |
ViewerDataModel.Instance.IsPressCtrl = false; |
442 |
} |
443 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Save 가 완료되었습니다.", "Alert"); |
444 |
} |
445 |
return; |
446 |
} |
447 |
} |
448 |
////강인구 변경 |
449 |
//this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
450 |
} |
451 |
if (sender != null) |
452 |
{ |
453 |
if (ViewerDataModel.Instance.IsPressCtrl) |
454 |
{ |
455 |
ViewerDataModel.Instance.IsPressCtrl = false; |
456 |
} |
457 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Save 가 완료되었습니다.", "Alert"); |
458 |
} |
459 |
} |
460 |
catch(Exception ex) |
461 |
{ |
462 |
; |
463 |
} |
464 |
finally |
465 |
{ |
466 |
} |
467 |
} |
468 |
|
469 |
public void RefactoryCommentReact(MainMenu menu) |
470 |
{ |
471 |
this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert(); |
472 |
|
473 |
SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO; |
474 |
SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID; |
475 |
SaveCommand.Instance.user_id = App.ViewInfo.UserID; |
476 |
SaveCommand.Instance.page_no = Convert.ToInt32(tlcurrentPage.Text); |
477 |
|
478 |
try |
479 |
{ |
480 |
List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>(); |
481 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
482 |
{ |
483 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
484 |
{ |
485 |
MySelectItem.Add(item as IKCOM.MarkupInfoItem); |
486 |
} |
487 |
} |
488 |
|
489 |
menu.ChangeCommentReact(); |
490 |
SaveCommand.Instance.Execute(MySelectItem, SaveCommand.Instance.page_no); |
491 |
SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs); |
492 |
} |
493 |
catch (Exception ex) |
494 |
{ |
495 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(string.Format("세이브 실패:{0}", ex.Message), "Alert"); |
496 |
throw new Exception(); |
497 |
} |
498 |
} |
499 |
|
500 |
//강인구 추가 |
501 |
public void Print_Start(string Type) |
502 |
{ |
503 |
if (ViewerDataModel.Instance.IsPressCtrl) |
504 |
{ |
505 |
ViewerDataModel.Instance.IsPressCtrl = false; |
506 |
} |
507 |
if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
508 |
{ |
509 |
var menu = this.ParentOfType<MainWindow>().dzMainMenu; |
510 |
menu.ReleaseAdorner(); |
511 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
512 |
{ |
513 |
RefactoryCommentReact(menu); |
514 |
} |
515 |
else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
516 |
{ |
517 |
|
518 |
} |
519 |
else |
520 |
{ |
521 |
RefactoryCommentReact(menu); |
522 |
} |
523 |
} |
524 |
|
525 |
bool isprint = false; |
526 |
if (Type == "Print") |
527 |
{ |
528 |
isprint = true; |
529 |
} |
530 |
|
531 |
RadWindow PrintWindow = new RadWindow(); |
532 |
//IKCOM.MarkupInfoItem _result = null; |
533 |
PrintWindow.Width = 850; |
534 |
PrintWindow.Height = 600; |
535 |
//PrintWindow.Width = 650; |
536 |
//PrintWindow.Height = 550; |
537 |
PrintWindow.Header = Type; |
538 |
|
539 |
List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>(); |
540 |
|
541 |
Logger.sendReqLog("GetPrintDocItemList: ", App.ViewInfo.ProjectNO + "," + App.ViewInfo.DocumentItemID + "," + ViewerDataModel.Instance._markupInfoList.ToList(), 1); |
542 |
markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList()); |
543 |
|
544 |
if (markupinfo.Count() > 0) |
545 |
{ |
546 |
Logger.sendResLog("GetPrintDocItemList", "TRUE", 1); |
547 |
} |
548 |
else |
549 |
{ |
550 |
Logger.sendResLog("GetPrintDocItemList", "FALSE", 1); |
551 |
} |
552 |
|
553 |
var Tile_Url = string.Format(@"{0}/TileSource/{1}_Tile/{2}/{3}/", |
554 |
App.SystemInfo.HostName, |
555 |
App.ViewInfo.ProjectNO, |
556 |
(Convert.ToInt64(App.ViewInfo.DocumentItemID) / 100).ToString(), |
557 |
App.ViewInfo.DocumentItemID |
558 |
); |
559 |
|
560 |
PrintWindow.Content = new KCOM.Control.PrintControl( |
561 |
Tile_Url, |
562 |
App.ViewInfo.ProjectNO, |
563 |
this.ParentOfType<MainWindow>().dzMainMenu._DocInfo, markupinfo, |
564 |
this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber, |
565 |
App.ViewInfo.DocumentItemID, |
566 |
this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, |
567 |
this.ParentOfType<MainWindow>().dzMainMenu._DocItem.ORIGINAL_FILE, isprint); |
568 |
|
569 |
//프린트 팝업 옵션 |
570 |
//PrintWindow.BorderThickness = new Thickness(3); |
571 |
//PrintWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 37, 160, 218)); |
572 |
PrintWindow.ResizeMode = System.Windows.ResizeMode.NoResize; |
573 |
PrintWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; |
574 |
PrintWindow.Background = new SolidColorBrush(Colors.Black); |
575 |
PrintWindow.Background.Opacity = 0.6; |
576 |
PrintWindow.Owner = Application.Current.MainWindow; |
577 |
Telerik.Windows.Controls.StyleManager.SetTheme(PrintWindow, new Telerik.Windows.Controls.VisualStudio2013Theme()); |
578 |
PrintWindow.ShowDialog(); |
579 |
} |
580 |
|
581 |
//강인구 추가 |
582 |
private void PrintEvent(object sender, RoutedEventArgs e) |
583 |
{ |
584 |
RadRibbonButton button = sender as RadRibbonButton; |
585 |
Print_Start(button.Content.ToString()); |
586 |
} |
587 |
|
588 |
private List<AdornerMember> GetAdornerItem() |
589 |
{ |
590 |
List<AdornerMember> AdonerList = new List<AdornerMember>(); |
591 |
|
592 |
if (this.ParentOfType<MainWindow>() != null) |
593 |
{ |
594 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
595 |
{ |
596 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
597 |
{ |
598 |
if (item.GetType().Name == "AdornerFinal") |
599 |
{ |
600 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
601 |
{ |
602 |
AdonerList.Add(InnerItem); |
603 |
} |
604 |
} |
605 |
} |
606 |
} |
607 |
} |
608 |
return AdonerList; |
609 |
} |
610 |
/// <summary> |
611 |
/// 투명도 |
612 |
/// </summary> |
613 |
/// <param name="sender"></param> |
614 |
/// <param name="e"></param> |
615 |
//강인구 추가(Undo End) |
616 |
private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e) |
617 |
{ |
618 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
619 |
if(AdonerList.Count > 0) |
620 |
{ |
621 |
Undo_data UndoData = new Undo_data() |
622 |
{ |
623 |
IsUndo = false, |
624 |
Event = Event_Type.Option, |
625 |
EventTime = DateTime.Now, |
626 |
Opacity = ViewerDataModel.Instance.ControlOpacity, |
627 |
Markup_List = new List<Multi_Undo_data>() |
628 |
}; |
629 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
630 |
|
631 |
foreach (AdornerMember InnerItem in AdonerList) |
632 |
{ |
633 |
InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity; |
634 |
|
635 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
636 |
UndoData.Markup_List.Add(multi_Undo_Data); |
637 |
multi_Undo_Data = new Multi_Undo_data(); |
638 |
} |
639 |
|
640 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
641 |
{ |
642 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
643 |
}); |
644 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
645 |
} |
646 |
} |
647 |
|
648 |
//강인구 추가(Undo End) |
649 |
private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
650 |
{ |
651 |
if (string.IsNullOrEmpty(cbLineSize.Value.ToString())) |
652 |
{ |
653 |
cbLineSize.Value = cbLineSize.Minimum; |
654 |
} |
655 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
656 |
if (AdonerList.Count > 0) |
657 |
{ |
658 |
Undo_data UndoData = new Undo_data() |
659 |
{ |
660 |
IsUndo = false, |
661 |
Event = Event_Type.Option, |
662 |
EventTime = DateTime.Now, |
663 |
LineSize = ViewerDataModel.Instance.LineSize, |
664 |
Markup_List = new List<Multi_Undo_data>() |
665 |
}; |
666 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
667 |
|
668 |
foreach (AdornerMember InnerItem in AdonerList) |
669 |
{ |
670 |
switch (InnerItem.DrawingData.GetType().Name) |
671 |
{ |
672 |
case ("LineControl"): |
673 |
{ |
674 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize; |
675 |
} |
676 |
break; |
677 |
case ("ArcControl"): |
678 |
{ |
679 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
680 |
} |
681 |
break; |
682 |
case ("ArrowArcControl"): |
683 |
{ |
684 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
685 |
} |
686 |
break; |
687 |
case ("ArrowControl_Multi"): |
688 |
{ |
689 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize; |
690 |
} |
691 |
break; |
692 |
case ("CloudControl"): |
693 |
{ |
694 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
695 |
} |
696 |
break; |
697 |
case ("PolygonControl"): |
698 |
{ |
699 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize; |
700 |
} |
701 |
break; |
702 |
case ("RectangleControl"): |
703 |
{ |
704 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize; |
705 |
} |
706 |
break; |
707 |
case ("RectCloudControl"): |
708 |
{ |
709 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
710 |
} |
711 |
break; |
712 |
case ("TriControl"): |
713 |
{ |
714 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize; |
715 |
} |
716 |
break; |
717 |
case ("CircleControl"): |
718 |
{ |
719 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize; |
720 |
} |
721 |
break; |
722 |
case ("ArrowTextControl"): |
723 |
{ |
724 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).LineSize = ViewerDataModel.Instance.LineSize; |
725 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).BorderSize = new Thickness(ViewerDataModel.Instance.LineSize); |
726 |
} |
727 |
break; |
728 |
case ("TextControl"): |
729 |
{ |
730 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).LineSize = new Thickness(ViewerDataModel.Instance.LineSize); |
731 |
} |
732 |
break; |
733 |
case ("InsideWhiteControl"): |
734 |
{ |
735 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
736 |
} |
737 |
break; |
738 |
case ("OverlapWhiteControl"): |
739 |
{ |
740 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
741 |
} |
742 |
break; |
743 |
case ("ClipWhiteControl"): |
744 |
{ |
745 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
746 |
} |
747 |
break; |
748 |
case ("CoordinateControl"): |
749 |
{ |
750 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).LineSize = 10; //ViewerDataModel.Instance.LineSize |
751 |
} |
752 |
break; |
753 |
} |
754 |
|
755 |
|
756 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
757 |
UndoData.Markup_List.Add(multi_Undo_Data); |
758 |
multi_Undo_Data = new Multi_Undo_data(); |
759 |
} |
760 |
|
761 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
762 |
{ |
763 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
764 |
}); |
765 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
766 |
|
767 |
|
768 |
} |
769 |
KCOM.Properties.Settings.Default.LineSize = (double)cbLineSize.Value; |
770 |
Properties.Settings.Default.Save(); |
771 |
} |
772 |
|
773 |
|
774 |
private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
775 |
{ |
776 |
if (string.IsNullOrEmpty(cbIntervalSize.Value.ToString())) |
777 |
{ |
778 |
cbIntervalSize.Value = cbIntervalSize.Minimum; |
779 |
} |
780 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
781 |
if (AdonerList.Count > 0) |
782 |
{ |
783 |
|
784 |
Undo_data UndoData = new Undo_data() |
785 |
{ |
786 |
IsUndo = false, |
787 |
Event = Event_Type.Option, |
788 |
EventTime = DateTime.Now, |
789 |
Interval = ViewerDataModel.Instance.Interval, |
790 |
Markup_List = new List<Multi_Undo_data>() |
791 |
}; |
792 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
793 |
|
794 |
foreach (AdornerMember InnerItem in AdonerList) |
795 |
{ |
796 |
switch (InnerItem.DrawingData.GetType().Name) |
797 |
{ |
798 |
case ("LineControl"): |
799 |
{ |
800 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval; |
801 |
|
802 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
803 |
UndoData.Markup_List.Add(multi_Undo_Data); |
804 |
multi_Undo_Data = new Multi_Undo_data(); |
805 |
} |
806 |
break; |
807 |
} |
808 |
} |
809 |
|
810 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
811 |
{ |
812 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
813 |
}); |
814 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
815 |
} |
816 |
KCOM.Properties.Settings.Default.Interval = (double)cbIntervalSize.Value; |
817 |
Properties.Settings.Default.Save(); |
818 |
} |
819 |
|
820 |
private void cbArcLength_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
821 |
{ |
822 |
if (string.IsNullOrEmpty(cbArcLength.Value.ToString())) |
823 |
{ |
824 |
cbArcLength.Value = cbArcLength.Minimum; |
825 |
} |
826 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
827 |
if (AdonerList.Count > 0) |
828 |
{ |
829 |
|
830 |
//Undo_data UndoData = new Undo_data() |
831 |
//{ |
832 |
// IsUndo = false, |
833 |
// Event = Event_Type.Option, |
834 |
// EventTime = DateTime.Now, |
835 |
// Interval = ViewerDataModel.Instance.Interval, |
836 |
// Markup_List = new List<Multi_Undo_data>() |
837 |
//}; |
838 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
839 |
|
840 |
foreach (AdornerMember InnerItem in AdonerList) |
841 |
{ |
842 |
switch (InnerItem.DrawingData.GetType().Name) |
843 |
{ |
844 |
case ("RectCloudControl"): |
845 |
{ |
846 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).ArcLength = ViewerDataModel.Instance.ArcLength; |
847 |
|
848 |
//multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
849 |
//UndoData.Markup_List.Add(multi_Undo_Data); |
850 |
//multi_Undo_Data = new Multi_Undo_data(); |
851 |
} |
852 |
break; |
853 |
case ("CloudControl"): |
854 |
{ |
855 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).ArcLength = ViewerDataModel.Instance.ArcLength; |
856 |
|
857 |
//multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
858 |
//UndoData.Markup_List.Add(multi_Undo_Data); |
859 |
//multi_Undo_Data = new Multi_Undo_data(); |
860 |
} |
861 |
break; |
862 |
} |
863 |
} |
864 |
|
865 |
//ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
866 |
//{ |
867 |
// ViewerDataModel.Instance.UndoDataList.Remove(i); |
868 |
//}); |
869 |
//ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
870 |
} |
871 |
|
872 |
KCOM.Properties.Settings.Default.ArcLength = (double)cbArcLength.Value; |
873 |
Properties.Settings.Default.Save(); |
874 |
} |
875 |
|
876 |
//강인구 추가(Undo End) |
877 |
private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e) |
878 |
{ |
879 |
//강인구 추가 |
880 |
if (this.ParentOfType<MainWindow>() != null) |
881 |
{ |
882 |
ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
883 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
884 |
{ |
885 |
Undo_data UndoData = new Undo_data() |
886 |
{ |
887 |
IsUndo = false, |
888 |
Event = Event_Type.Option, |
889 |
EventTime = DateTime.Now, |
890 |
DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData, |
891 |
Markup_List = new List<Multi_Undo_data>() |
892 |
}; |
893 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
894 |
|
895 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
896 |
{ |
897 |
if (item.GetType().Name == "AdornerFinal") |
898 |
{ |
899 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
900 |
{ |
901 |
switch (InnerItem.DrawingData.GetType().Name) |
902 |
{ |
903 |
case ("LineControl"): |
904 |
{ |
905 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
906 |
} |
907 |
break; |
908 |
case ("ArcControl"): |
909 |
{ |
910 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
911 |
} |
912 |
break; |
913 |
case ("ArrowArcControl"): |
914 |
{ |
915 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
916 |
} |
917 |
break; |
918 |
case ("ArrowControl_Multi"): |
919 |
{ |
920 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
921 |
} |
922 |
break; |
923 |
case ("CloudControl"): |
924 |
{ |
925 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
926 |
} |
927 |
break; |
928 |
case ("PolygonControl"): |
929 |
{ |
930 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
931 |
} |
932 |
break; |
933 |
case ("RectangleControl"): |
934 |
{ |
935 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
936 |
} |
937 |
break; |
938 |
case ("RectCloudControl"): |
939 |
{ |
940 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
941 |
} |
942 |
break; |
943 |
case ("TriControl"): |
944 |
{ |
945 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
946 |
} |
947 |
break; |
948 |
case ("CircleControl"): |
949 |
{ |
950 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
951 |
} |
952 |
break; |
953 |
case ("InsideWhiteControl"): |
954 |
{ |
955 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
956 |
} |
957 |
break; |
958 |
case ("OverlapWhiteControl"): |
959 |
{ |
960 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
961 |
} |
962 |
break; |
963 |
case ("ClipWhiteControl"): |
964 |
{ |
965 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
966 |
} |
967 |
break; |
968 |
case ("CoordinateControl"): |
969 |
{ |
970 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
971 |
} |
972 |
break; |
973 |
} |
974 |
|
975 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
976 |
UndoData.Markup_List.Add(multi_Undo_Data); |
977 |
multi_Undo_Data = new Multi_Undo_data(); |
978 |
} |
979 |
|
980 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
981 |
{ |
982 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
983 |
}); |
984 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
985 |
} |
986 |
} |
987 |
} |
988 |
} |
989 |
} |
990 |
|
991 |
//강인구 추가 |
992 |
private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e) |
993 |
{ |
994 |
//if (this.ParentOfType<MainWindow>() != null) |
995 |
//{ |
996 |
// if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
997 |
// { |
998 |
// foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
999 |
// { |
1000 |
// if (item.GetType().Name == "AdornerFinal") |
1001 |
// { |
1002 |
// foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1003 |
// { |
1004 |
// switch (InnerItem.DrawingData.GetType().Name) |
1005 |
// { |
1006 |
// case ("TextControl"): |
1007 |
// { |
1008 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text); |
1009 |
// } |
1010 |
// break; |
1011 |
// case ("ArrowTextControl"): |
1012 |
// { |
1013 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text); |
1014 |
// } |
1015 |
// break; |
1016 |
// } |
1017 |
// } |
1018 |
// } |
1019 |
// } |
1020 |
// } |
1021 |
//} |
1022 |
} |
1023 |
|
1024 |
//강인구 추가 |
1025 |
private void btnBold_Checked(object sender, RoutedEventArgs e) |
1026 |
{ |
1027 |
if (this.ParentOfType<MainWindow>() != null) |
1028 |
{ |
1029 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1030 |
{ |
1031 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1032 |
{ |
1033 |
if (item.GetType().Name == "AdornerFinal") |
1034 |
{ |
1035 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1036 |
{ |
1037 |
switch (InnerItem.DrawingData.GetType().Name) |
1038 |
{ |
1039 |
case ("TextControl"): |
1040 |
{ |
1041 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold) |
1042 |
{ |
1043 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal; |
1044 |
} |
1045 |
else |
1046 |
{ |
1047 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold; |
1048 |
} |
1049 |
|
1050 |
} |
1051 |
break; |
1052 |
case ("ArrowTextControl"): |
1053 |
{ |
1054 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold) |
1055 |
{ |
1056 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal; |
1057 |
} |
1058 |
else |
1059 |
{ |
1060 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold; |
1061 |
} |
1062 |
} |
1063 |
break; |
1064 |
} |
1065 |
} |
1066 |
} |
1067 |
} |
1068 |
} |
1069 |
} |
1070 |
} |
1071 |
|
1072 |
//강인구 추가 |
1073 |
private void btnItalic_Checked(object sender, RoutedEventArgs e) |
1074 |
{ |
1075 |
if (this.ParentOfType<MainWindow>() != null) |
1076 |
{ |
1077 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1078 |
{ |
1079 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1080 |
{ |
1081 |
if (item.GetType().Name == "AdornerFinal") |
1082 |
{ |
1083 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1084 |
{ |
1085 |
switch (InnerItem.DrawingData.GetType().Name) |
1086 |
{ |
1087 |
case ("TextControl"): |
1088 |
{ |
1089 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic) |
1090 |
{ |
1091 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal; |
1092 |
} |
1093 |
else |
1094 |
{ |
1095 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic; |
1096 |
} |
1097 |
|
1098 |
} |
1099 |
break; |
1100 |
case ("ArrowTextControl"): |
1101 |
{ |
1102 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic) |
1103 |
{ |
1104 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal; |
1105 |
} |
1106 |
else |
1107 |
{ |
1108 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic; |
1109 |
} |
1110 |
} |
1111 |
break; |
1112 |
} |
1113 |
} |
1114 |
} |
1115 |
} |
1116 |
} |
1117 |
} |
1118 |
} |
1119 |
|
1120 |
//강인구 추가 |
1121 |
private void btnUnderLine_Checked(object sender, RoutedEventArgs e) |
1122 |
{ |
1123 |
if (this.ParentOfType<MainWindow>() != null) |
1124 |
{ |
1125 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1126 |
{ |
1127 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1128 |
{ |
1129 |
if (item.GetType().Name == "AdornerFinal") |
1130 |
{ |
1131 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1132 |
{ |
1133 |
switch (InnerItem.DrawingData.GetType().Name) |
1134 |
{ |
1135 |
case ("TextControl"): |
1136 |
{ |
1137 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline) |
1138 |
{ |
1139 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null; |
1140 |
} |
1141 |
else |
1142 |
{ |
1143 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline; |
1144 |
} |
1145 |
} |
1146 |
break; |
1147 |
case ("ArrowTextControl"): |
1148 |
{ |
1149 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline) |
1150 |
{ |
1151 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null; |
1152 |
} |
1153 |
else |
1154 |
{ |
1155 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline; |
1156 |
} |
1157 |
} |
1158 |
break; |
1159 |
} |
1160 |
} |
1161 |
} |
1162 |
} |
1163 |
} |
1164 |
} |
1165 |
} |
1166 |
|
1167 |
private void AxisLockEvent(object sender, RoutedEventArgs e) |
1168 |
{ |
1169 |
ViewerDataModel.Instance.checkAxis = cbAxisLock.IsChecked.Value; |
1170 |
} |
1171 |
|
1172 |
private void comboFontSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
1173 |
{ |
1174 |
if (string.IsNullOrEmpty(comboFontSize.Value.ToString())) |
1175 |
{ |
1176 |
comboFontSize.Value = comboFontSize.Minimum; |
1177 |
} |
1178 |
if (this.ParentOfType<MainWindow>() != null) |
1179 |
{ |
1180 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1181 |
{ |
1182 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1183 |
{ |
1184 |
if (item.GetType().Name == "AdornerFinal") |
1185 |
{ |
1186 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1187 |
{ |
1188 |
switch (InnerItem.DrawingData.GetType().Name) |
1189 |
{ |
1190 |
case ("TextControl"): |
1191 |
{ |
1192 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
1193 |
} |
1194 |
break; |
1195 |
case ("ArrowTextControl"): |
1196 |
{ |
1197 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
1198 |
} |
1199 |
break; |
1200 |
} |
1201 |
} |
1202 |
} |
1203 |
} |
1204 |
} |
1205 |
} |
1206 |
KCOM.Properties.Settings.Default.TextSize = (double)comboFontSize.Value; |
1207 |
Properties.Settings.Default.Save(); |
1208 |
} |
1209 |
|
1210 |
//강인구 추가 |
1211 |
private void RadRibbonComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) |
1212 |
{ |
1213 |
if (this.ParentOfType<MainWindow>() != null) |
1214 |
{ |
1215 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
1216 |
{ |
1217 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
1218 |
{ |
1219 |
if (item.GetType().Name == "AdornerFinal") |
1220 |
{ |
1221 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
1222 |
{ |
1223 |
switch (InnerItem.DrawingData.GetType().Name) |
1224 |
{ |
1225 |
case ("TextControl"): |
1226 |
{ |
1227 |
//if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily == TextDecorations.Underline) |
1228 |
//{ |
1229 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).FontFamily = new FontFamily(comboFontFamily.Text); |
1230 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBlock.FontFamily = new FontFamily(comboFontFamily.Text); |
1231 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).Base_TextBox.FontFamily = new FontFamily(comboFontFamily.Text); |
1232 |
//} |
1233 |
//else |
1234 |
//{ |
1235 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline; |
1236 |
//} |
1237 |
} |
1238 |
break; |
1239 |
case ("ArrowTextControl"): |
1240 |
{ |
1241 |
//if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline) |
1242 |
//{ |
1243 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null; |
1244 |
//} |
1245 |
//else |
1246 |
//{ |
1247 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline; |
1248 |
//} |
1249 |
} |
1250 |
break; |
1251 |
} |
1252 |
} |
1253 |
} |
1254 |
} |
1255 |
} |
1256 |
} |
1257 |
} |
1258 |
|
1259 |
/// <summary> |
1260 |
/// 텍스트 컨트롤 하일라이트 처리 |
1261 |
/// </summary> |
1262 |
/// <param name="sender"></param> |
1263 |
/// <param name="e"></param> |
1264 |
private void HighlightEvent(object sender, RoutedEventArgs e) |
1265 |
{ |
1266 |
|
1267 |
ViewerDataModel.Instance.checkHighShape = (sender as CheckBox).IsChecked.Value; |
1268 |
SetHighlightEvent(); |
1269 |
//if ((sender as CheckBox).IsChecked.Value) |
1270 |
//{ |
1271 |
// TaskMessage("HighLight가 설정되었습니다", TaskMessageType.Normal); |
1272 |
//} |
1273 |
//else |
1274 |
//{ |
1275 |
// TaskMessage("HighLight가 해제되었습니다", TaskMessageType.Caption); |
1276 |
//} |
1277 |
//if (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl != null) |
1278 |
//{ |
1279 |
// MarkupToPDF.Controls.Text.TextControl instance = (ViewerDataModel.Instance.SelectedEditor as MarkupToPDF.Controls.Text.TextControl); |
1280 |
// instance.IsHighLight = ViewerDataModel.Instance.checkHighShape; |
1281 |
// instance.SetText(); |
1282 |
//} |
1283 |
} |
1284 |
|
1285 |
//추가페이지 이동 엔터 |
1286 |
private void tlcurrentPage_KeyDown(object sender, KeyEventArgs e) |
1287 |
{ |
1288 |
//강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
1289 |
if (e.Key == Key.Enter) |
1290 |
{ |
1291 |
try |
1292 |
{ |
1293 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1294 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text)); |
1295 |
} |
1296 |
catch (Exception) |
1297 |
{ |
1298 |
RadWindow.Alert(new DialogParameters |
1299 |
{ |
1300 |
Owner = Application.Current.MainWindow, |
1301 |
Theme = new VisualStudio2013Theme(), |
1302 |
Header = "안내", |
1303 |
Content = "페이지 번호를 정확하게 입력해 주세요", |
1304 |
}); |
1305 |
} |
1306 |
|
1307 |
} |
1308 |
} |
1309 |
|
1310 |
private void tlcurrentPage_readonly_KeyDown(object sender, KeyEventArgs e) |
1311 |
{ |
1312 |
//강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
1313 |
if (e.Key == Key.Enter) |
1314 |
{ |
1315 |
try |
1316 |
{ |
1317 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1318 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage_readonly.Text)); |
1319 |
} |
1320 |
catch (Exception) |
1321 |
{ |
1322 |
RadWindow.Alert(new DialogParameters |
1323 |
{ |
1324 |
Owner = Application.Current.MainWindow, |
1325 |
Theme = new VisualStudio2013Theme(), |
1326 |
Header = "안내", |
1327 |
Content = "페이지 번호를 정확하게 입력해 주세요", |
1328 |
}); |
1329 |
} |
1330 |
|
1331 |
} |
1332 |
} |
1333 |
|
1334 |
|
1335 |
//public event EventHandler<WindowClosedEventArgs> Closed; |
1336 |
|
1337 |
//private void CheckEvent(object sender, RoutedEventArgs e) |
1338 |
//{ |
1339 |
// RadWindow CheckPop = new RadWindow(); |
1340 |
// test check = new test(); |
1341 |
|
1342 |
// CheckPop = new RadWindow |
1343 |
// { |
1344 |
// Width = 1700, |
1345 |
// Height = 510, |
1346 |
// Header = "My Check List", |
1347 |
// Content = check, |
1348 |
// Owner = this, |
1349 |
// ResizeMode = System.Windows.ResizeMode.NoResize, |
1350 |
// WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
1351 |
// }; |
1352 |
// StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme()); |
1353 |
|
1354 |
// CheckPop.Closed += CheckPop_Closed; |
1355 |
// CheckPop.ShowDialog(); |
1356 |
//} |
1357 |
|
1358 |
private void PanoramaEvent(object sender, RoutedEventArgs e) |
1359 |
{ |
1360 |
PanoramaShow(); |
1361 |
} |
1362 |
|
1363 |
public void PanoramaShow() |
1364 |
{ |
1365 |
Panorama check = new Panorama(); |
1366 |
double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; |
1367 |
double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; |
1368 |
//double windowWidth = this.Width; |
1369 |
//double windowHeight = this.Height; |
1370 |
|
1371 |
var PanoramaPop = new RadWindow |
1372 |
{ |
1373 |
//MinWidth = 600, |
1374 |
//MinHeight = 400, |
1375 |
//Header = "My Check List", |
1376 |
Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION, |
1377 |
Content = check, |
1378 |
Owner = this, |
1379 |
ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
1380 |
//ResizeMode = System.Windows.ResizeMode.NoResize, |
1381 |
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
1382 |
IsTopmost = false, |
1383 |
//Left = (screenWidth / 2) - (windowWidth / 2), |
1384 |
//Top = (screenHeight / 2) - (windowHeight / 2), |
1385 |
//Left = (screenWidth / 2), |
1386 |
//Top = (screenHeight / 2), |
1387 |
Width = screenWidth * 0.4, |
1388 |
Height = screenHeight * 0.4, |
1389 |
}; |
1390 |
StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme()); |
1391 |
//CheckPop.ShowDialog(); |
1392 |
PanoramaPop.Owner = Application.Current.MainWindow; |
1393 |
PanoramaPop.Show(); |
1394 |
} |
1395 |
|
1396 |
private void CheckEvent(object sender, RoutedEventArgs e) |
1397 |
{ |
1398 |
//창이 떠있을 경우 재 실행 방지 |
1399 |
if (isClosed) |
1400 |
{ |
1401 |
//토글 및 마우스 상태 초기화 |
1402 |
var toggleList = this.Parent.ChildrenOfType<RadToggleButton>(); |
1403 |
foreach(var togle in toggleList) |
1404 |
{ |
1405 |
togle.IsChecked = false; |
1406 |
} |
1407 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1408 |
|
1409 |
isClosed = false; |
1410 |
|
1411 |
|
1412 |
CheckList check = new CheckList(); |
1413 |
|
1414 |
CheckPop = new RadWindow |
1415 |
{ |
1416 |
MinWidth = 1200, |
1417 |
MinHeight = 500, |
1418 |
//Header = "My Check List", |
1419 |
Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION, |
1420 |
Content = check, |
1421 |
//Owner = this, |
1422 |
//ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
1423 |
ResizeMode = System.Windows.ResizeMode.NoResize, |
1424 |
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
1425 |
IsTopmost = true, |
1426 |
}; |
1427 |
StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
1428 |
CheckPop.Closed += CheckPop_Closed; |
1429 |
|
1430 |
//CheckPop.ShowDialog(); |
1431 |
CheckPop.Show(); |
1432 |
} |
1433 |
} |
1434 |
|
1435 |
private void OptionPop_Closed(object sender, WindowClosedEventArgs e) |
1436 |
{ |
1437 |
isClosed = true; |
1438 |
//this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
1439 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1440 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
1441 |
} |
1442 |
|
1443 |
private void CheckPop_Closed(object sender, WindowClosedEventArgs e) |
1444 |
{ |
1445 |
isClosed = true; |
1446 |
//this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
1447 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1448 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
1449 |
} |
1450 |
|
1451 |
/// <summary> |
1452 |
/// 사용자가 선택한 페이지로 이동(썸네일 동기화 시킴) |
1453 |
/// </summary> |
1454 |
/// <param name="sender"></param> |
1455 |
/// <param name="e"></param> |
1456 |
private void PageGoEvent(object sender, RoutedEventArgs e) |
1457 |
{ |
1458 |
RadButton button = sender as RadButton; |
1459 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1460 |
|
1461 |
//강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
1462 |
try |
1463 |
{ |
1464 |
switch (button.CommandParameter.ToString()) |
1465 |
{ |
1466 |
case "Down": |
1467 |
{ |
1468 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1); |
1469 |
} |
1470 |
break; |
1471 |
case "Up": |
1472 |
{ |
1473 |
instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1); |
1474 |
} |
1475 |
break; |
1476 |
} |
1477 |
} |
1478 |
catch (Exception) |
1479 |
{ |
1480 |
RadWindow.Alert(new DialogParameters |
1481 |
{ |
1482 |
Owner = Application.Current.MainWindow, |
1483 |
Theme = new VisualStudio2013Theme(), |
1484 |
Header = "안내", |
1485 |
Content = "페이지 번호를 정확하게 입력해 주세요", |
1486 |
}); |
1487 |
} |
1488 |
} |
1489 |
|
1490 |
private void viewEvent(object sender, RoutedEventArgs e) |
1491 |
{ |
1492 |
RadRibbonToggleButton viewButton = sender as RadRibbonToggleButton; |
1493 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1494 |
|
1495 |
Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2); |
1496 |
|
1497 |
//if ((sender as RadRibbonToggleButton) != null) |
1498 |
//{ |
1499 |
// Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString(); |
1500 |
// instanceToggle = (sender as RadRibbonToggleButton); |
1501 |
//} |
1502 |
|
1503 |
//instanceToggle.IsChecked = false; |
1504 |
|
1505 |
switch (viewButton.CommandParameter.ToString()) |
1506 |
{ |
1507 |
case "zoomout": |
1508 |
{ |
1509 |
//장원 |
1510 |
//instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight)); |
1511 |
instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point); |
1512 |
viewButton.IsChecked = false; |
1513 |
//Common.ViewerDataModel.Instance.zom |
1514 |
} |
1515 |
break; |
1516 |
case "zoomin": |
1517 |
{ |
1518 |
instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point); |
1519 |
viewButton.IsChecked = false; |
1520 |
} |
1521 |
break; |
1522 |
case "fullscreen": |
1523 |
{ |
1524 |
instanceMain.WindowState = WindowState.Maximized; |
1525 |
//Sizemode 대기(강인구) |
1526 |
//instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit; |
1527 |
instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
1528 |
viewButton.IsChecked = false; |
1529 |
} |
1530 |
break; |
1531 |
case "fitWidth": |
1532 |
{ |
1533 |
instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
1534 |
viewButton.IsChecked = false; |
1535 |
} |
1536 |
break; |
1537 |
case "fitHeight": |
1538 |
{ |
1539 |
instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
1540 |
viewButton.IsChecked = false; |
1541 |
} |
1542 |
break; |
1543 |
case "boundzoom": |
1544 |
{ |
1545 |
|
1546 |
} |
1547 |
break; |
1548 |
case "Rotate_M": |
1549 |
{ |
1550 |
drawingPannelRotate(false); |
1551 |
viewButton.IsChecked = false; |
1552 |
} |
1553 |
break; |
1554 |
case "Rotate_P": |
1555 |
{ |
1556 |
drawingPannelRotate(true); |
1557 |
viewButton.IsChecked = false; |
1558 |
} |
1559 |
break; |
1560 |
case "Rotate_half": |
1561 |
{ |
1562 |
drawingPannelRotate(true); |
1563 |
drawingPannelRotate(true); |
1564 |
viewButton.IsChecked = false; |
1565 |
} |
1566 |
break; |
1567 |
} |
1568 |
} |
1569 |
|
1570 |
private void Control_Event(object sender, RoutedEventArgs e) |
1571 |
{ |
1572 |
|
1573 |
} |
1574 |
|
1575 |
#region 대기 |
1576 |
|
1577 |
public void drawingPannelRotate(bool Flag) |
1578 |
{ |
1579 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1580 |
|
1581 |
//if (rotateOffSet > 3) |
1582 |
// rotateOffSet = 0; |
1583 |
|
1584 |
//if (rotateOffSet < 0) |
1585 |
// rotateOffSet = 3; |
1586 |
|
1587 |
if(Flag) |
1588 |
{ |
1589 |
if (instanceMain.dzMainMenu.rotate.Angle == 270) |
1590 |
{ |
1591 |
instanceMain.dzMainMenu.rotate.Angle = 0; |
1592 |
} |
1593 |
else |
1594 |
{ |
1595 |
instanceMain.dzMainMenu.rotate.Angle += 90; |
1596 |
} |
1597 |
} |
1598 |
else |
1599 |
{ |
1600 |
if(instanceMain.dzMainMenu.rotate.Angle == 0) |
1601 |
{ |
1602 |
instanceMain.dzMainMenu.rotate.Angle = 270; |
1603 |
} |
1604 |
else |
1605 |
{ |
1606 |
instanceMain.dzMainMenu.rotate.Angle -= 90; |
1607 |
} |
1608 |
} |
1609 |
//double angle = (double)rotateValue.GetValue(rotateOffSet); |
1610 |
//instanceMain.dzMainMenu.rotate.Angle = angle; |
1611 |
var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90)); |
1612 |
|
1613 |
if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth) |
1614 |
{ |
1615 |
double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1616 |
instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1617 |
instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize; |
1618 |
} |
1619 |
if (instanceMain.dzMainMenu.rotate.Angle == 0) |
1620 |
{ |
1621 |
instanceMain.dzMainMenu.translate.X = 0; |
1622 |
instanceMain.dzMainMenu.translate.Y = 0; |
1623 |
} |
1624 |
else if (instanceMain.dzMainMenu.rotate.Angle == 90) |
1625 |
{ |
1626 |
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1627 |
instanceMain.dzMainMenu.translate.Y = 0; |
1628 |
} |
1629 |
else if (instanceMain.dzMainMenu.rotate.Angle == 180) |
1630 |
{ |
1631 |
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1632 |
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1633 |
} |
1634 |
else |
1635 |
{ |
1636 |
instanceMain.dzMainMenu.translate.X = 0; |
1637 |
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1638 |
} |
1639 |
|
1640 |
//instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5); |
1641 |
instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle; |
1642 |
//대기(강인구) |
1643 |
//instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle; |
1644 |
|
1645 |
|
1646 |
//instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5); |
1647 |
//RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle); |
1648 |
//instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform; |
1649 |
|
1650 |
|
1651 |
ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
1652 |
ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
1653 |
ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X; |
1654 |
ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y; |
1655 |
ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle; |
1656 |
//ViewerDataModel.Instance.Document_Info.Clear(); |
1657 |
//ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value => |
1658 |
//{ |
1659 |
// value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
1660 |
//}); |
1661 |
|
1662 |
|
1663 |
//이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가) |
1664 |
instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data => |
1665 |
{ |
1666 |
data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
1667 |
|
1668 |
instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems; |
1669 |
var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault(); |
1670 |
instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
1671 |
|
1672 |
instanceMain.dzMainMenu.pageNavigator.setPageChange(data); |
1673 |
|
1674 |
//rotation page add or update |
1675 |
var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault(); |
1676 |
if (rotationdoc != null) |
1677 |
{ |
1678 |
rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE; |
1679 |
} |
1680 |
else |
1681 |
{ |
1682 |
ViewerDataModel.Instance.RotationDocs.Add(instance); |
1683 |
} |
1684 |
}); |
1685 |
} |
1686 |
#endregion |
1687 |
|
1688 |
private void ImageConverter(RadToggleButton instanceToggle) |
1689 |
{ |
1690 |
try |
1691 |
{ |
1692 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1693 |
//http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx |
1694 |
|
1695 |
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); |
1696 |
dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png"; |
1697 |
Nullable<bool> result = dlg.ShowDialog(); |
1698 |
if (result == true) |
1699 |
{ |
1700 |
instanceMain.dzMainMenu.filename = dlg.FileName; |
1701 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
1702 |
|
1703 |
System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename); |
1704 |
String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename); |
1705 |
long numByte = fileInfo.Length; |
1706 |
double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
1707 |
kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
1708 |
|
1709 |
if (dLen < 4) |
1710 |
{ |
1711 |
System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read); |
1712 |
System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
1713 |
byte[] data = br.ReadBytes((int)numByte); |
1714 |
br.Close(); |
1715 |
|
1716 |
string filepath = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data); |
1717 |
|
1718 |
Check_Uri.UriCheck(filepath); |
1719 |
|
1720 |
instanceMain.dzMainMenu.filename = filepath; |
1721 |
|
1722 |
fStream.Close(); |
1723 |
fStream.Dispose(); |
1724 |
} |
1725 |
else |
1726 |
{ |
1727 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
1728 |
} |
1729 |
} |
1730 |
} |
1731 |
catch(Exception ex) |
1732 |
{ |
1733 |
instanceToggle.IsChecked = false; |
1734 |
Common.ViewerDataModel.Instance.SelectedControl = ""; |
1735 |
Common.ViewerDataModel.Instance.ControlTag = null; |
1736 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
1737 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
1738 |
this.ParentOfType<MainWindow>().DialogMessage_Alert(""+ ex , "Alert"); |
1739 |
} |
1740 |
} |
1741 |
|
1742 |
private void Control_Init(RadToggleButton instanceToggle, object sender) |
1743 |
{ |
1744 |
|
1745 |
} |
1746 |
|
1747 |
private void ControlEvent(object sender, RoutedEventArgs e) |
1748 |
{ |
1749 |
RadToggleButton instanceToggle = sender as RadToggleButton; |
1750 |
var instanceMain = this.ParentOfType<MainWindow>(); |
1751 |
|
1752 |
#region Ctrl + A 눌렀을 때 대처 방법 |
1753 |
//원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에 |
1754 |
// 시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다 |
1755 |
// 이를 대처하는 방법으로 아래 코드를 사용한다. |
1756 |
if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1) |
1757 |
{ |
1758 |
//var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList(); |
1759 |
//foreach (var item in lstItem) |
1760 |
//{ |
1761 |
// foreach (var member in item.MemberSet) |
1762 |
// { |
1763 |
// if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData)) |
1764 |
// { |
1765 |
// instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData); |
1766 |
// } |
1767 |
// } |
1768 |
//} |
1769 |
} |
1770 |
#endregion |
1771 |
|
1772 |
//if (!instanceMain.IsFreeSelectionMode) |
1773 |
//{ |
1774 |
// instanceMain.IsSwingMode = true; |
1775 |
//} |
1776 |
|
1777 |
#region 다른 컨트롤 버튼 선택 해제 |
1778 |
System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState => |
1779 |
{ |
1780 |
if (ControlState == null) |
1781 |
{ |
1782 |
instanceToggle.IsChecked = false; |
1783 |
HiddenControlHide(); |
1784 |
} |
1785 |
}); |
1786 |
#endregion |
1787 |
|
1788 |
Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리 |
1789 |
|
1790 |
if (instanceToggle != null) |
1791 |
{ |
1792 |
Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString(); |
1793 |
} |
1794 |
else if ((sender as RadRibbonToggleButton) != null) |
1795 |
{ |
1796 |
Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString(); |
1797 |
instanceToggle = (sender as RadRibbonToggleButton); |
1798 |
} |
1799 |
else if ((sender as RadRibbonButton) != null) |
1800 |
{ |
1801 |
RadRibbonButton instanceButton = sender as RadRibbonButton; |
1802 |
Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString(); |
1803 |
} |
1804 |
else |
1805 |
{ |
1806 |
RadButton instanceButton = sender as RadButton; |
1807 |
Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString(); |
1808 |
} |
1809 |
|
1810 |
|
1811 |
|
1812 |
System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee => |
1813 |
{ |
1814 |
instanceMain.dzMainMenu.MainAngle.Visibility = isSee; |
1815 |
System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p => |
1816 |
{ |
1817 |
instanceMain.dzMainMenu.MainAngle.AngleValue = p; |
1818 |
}); |
1819 |
}); |
1820 |
instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
1821 |
|
1822 |
instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
1823 |
|
1824 |
if (instanceToggle.IsChecked != false) |
1825 |
{ |
1826 |
#region 컨트롤이 체크되었다면 |
1827 |
switch (instanceToggle.CommandParameter.ToString()) |
1828 |
{ |
1829 |
#region Line |
1830 |
case "Line": |
1831 |
Common.ViewerDataModel.Instance.SelectedControl = "Line"; |
1832 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1833 |
if (instanceToggle.Tag.ToString() == "LineDelete") |
1834 |
{ |
1835 |
//HiddenInterval.Visibility = Visibility.Visible; |
1836 |
} |
1837 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine; |
1838 |
break; |
1839 |
#endregion |
1840 |
#region ChainLine |
1841 |
case "ChainLine": |
1842 |
Common.ViewerDataModel.Instance.SelectedControl = "ChainLine"; |
1843 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1844 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine; |
1845 |
break; |
1846 |
#endregion |
1847 |
#region DimLine |
1848 |
case "DimLine": |
1849 |
Common.ViewerDataModel.Instance.SelectedControl = "DimLine"; |
1850 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1851 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine; |
1852 |
break; |
1853 |
#endregion |
1854 |
#region TwinLine |
1855 |
case "TwinLine": |
1856 |
Common.ViewerDataModel.Instance.SelectedControl = "TwinLine"; |
1857 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1858 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine; |
1859 |
break; |
1860 |
#endregion |
1861 |
#region CancelLine |
1862 |
case "CancelLine": |
1863 |
Common.ViewerDataModel.Instance.SelectedControl = "CancelLine"; |
1864 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1865 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine; |
1866 |
break; |
1867 |
#endregion |
1868 |
#region PolygonCloud |
1869 |
case "PolygonCloud": |
1870 |
Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud"; |
1871 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1872 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud; |
1873 |
break; |
1874 |
#endregion |
1875 |
#region RectCloud |
1876 |
case "RectCloud": |
1877 |
Common.ViewerDataModel.Instance.SelectedControl = "RectCloud"; |
1878 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1879 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud; |
1880 |
break; |
1881 |
#endregion |
1882 |
#region Rectangle |
1883 |
case "Rectangle": |
1884 |
Common.ViewerDataModel.Instance.SelectedControl = "Rectangle"; |
1885 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1886 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle; |
1887 |
break; |
1888 |
#endregion |
1889 |
#region Triangle |
1890 |
case "Triangle": |
1891 |
Common.ViewerDataModel.Instance.SelectedControl = "Triangle"; |
1892 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1893 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle; |
1894 |
break; |
1895 |
#endregion |
1896 |
#region RectCloud |
1897 |
case "Circle": |
1898 |
Common.ViewerDataModel.Instance.SelectedControl = "Circle"; |
1899 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1900 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle; |
1901 |
break; |
1902 |
#endregion |
1903 |
#region Symbol |
1904 |
case "Symbol": |
1905 |
Common.ViewerDataModel.Instance.SelectedControl = "Symbol"; |
1906 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
1907 |
break; |
1908 |
#endregion |
1909 |
#region SymbolN |
1910 |
case "SymbolN": |
1911 |
Common.ViewerDataModel.Instance.SelectedControl = "SymbolN"; |
1912 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp; |
1913 |
break; |
1914 |
#endregion |
1915 |
#region Text |
1916 |
case "Text": |
1917 |
Common.ViewerDataModel.Instance.SelectedControl = "Text"; |
1918 |
TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
1919 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl; |
1920 |
break; |
1921 |
#endregion |
1922 |
#region TextBorder |
1923 |
case "TextBorder": |
1924 |
Common.ViewerDataModel.Instance.SelectedControl = "TextBorder"; |
1925 |
TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
1926 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder; |
1927 |
break; |
1928 |
#endregion |
1929 |
#region TextCloud |
1930 |
case "TextCloud": |
1931 |
Common.ViewerDataModel.Instance.SelectedControl = "TextCloud"; |
1932 |
TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
1933 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud; |
1934 |
break; |
1935 |
#endregion |
1936 |
#region Date |
1937 |
case "Date": |
1938 |
Common.ViewerDataModel.Instance.SelectedControl = "Date"; |
1939 |
TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal); |
1940 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date; |
1941 |
break; |
1942 |
#endregion |
1943 |
#region ArrowText |
1944 |
case "ArrowText": |
1945 |
TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal); |
1946 |
if (instanceToggle.Tag.ToString() == "ArrowText_Cloud") |
1947 |
{ |
1948 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud"; |
1949 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl; |
1950 |
} |
1951 |
else if (instanceToggle.Tag.ToString() == "ArrowText_Border") |
1952 |
{ |
1953 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl"; |
1954 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl; |
1955 |
} |
1956 |
else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal") |
1957 |
{ |
1958 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl"; |
1959 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl; |
1960 |
} |
1961 |
else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border") |
1962 |
{ |
1963 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl"; |
1964 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl; |
1965 |
} |
1966 |
else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud") |
1967 |
{ |
1968 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl"; |
1969 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl; |
1970 |
} |
1971 |
else |
1972 |
{ |
1973 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowText"; |
1974 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl; |
1975 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1976 |
} |
1977 |
break; |
1978 |
#endregion |
1979 |
#region Arrow |
1980 |
case "Arrow": |
1981 |
Common.ViewerDataModel.Instance.SelectedControl = "Arrow"; |
1982 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1983 |
//HiddenDimSize.Visibility = Visibility.Visible; |
1984 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine; |
1985 |
break; |
1986 |
#endregion |
1987 |
#region Shape |
1988 |
case "Shape": |
1989 |
Common.ViewerDataModel.Instance.SelectedControl = "Shape"; |
1990 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark; |
1991 |
break; |
1992 |
#endregion |
1993 |
#region Polygon |
1994 |
case "Polygon": |
1995 |
Common.ViewerDataModel.Instance.SelectedControl = "Polygon"; |
1996 |
TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal); |
1997 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
1998 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl; |
1999 |
break; |
2000 |
#endregion |
2001 |
#region Arc |
2002 |
case "Arc": |
2003 |
Common.ViewerDataModel.Instance.SelectedControl = "Arc"; |
2004 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine; |
2005 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2006 |
TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
2007 |
break; |
2008 |
#endregion |
2009 |
#region ArrowArc |
2010 |
case "ArrowArc": |
2011 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowArc"; |
2012 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcArrow; |
2013 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2014 |
TaskMessage("ArcArrow 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
2015 |
break; |
2016 |
#endregion |
2017 |
#region ArrowMulti |
2018 |
case "ArrowMulti": |
2019 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti"; |
2020 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine; |
2021 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
2022 |
break; |
2023 |
#endregion |
2024 |
#region Etc |
2025 |
case "Etc": |
2026 |
Common.ViewerDataModel.Instance.SelectedControl = "Etc"; |
2027 |
break; |
2028 |
#endregion |
2029 |
#region Ink |
2030 |
case "Ink": |
2031 |
if (instanceToggle.Tag.ToString() == "EraserClear") |
2032 |
{ |
2033 |
TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal); |
2034 |
//instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; |
2035 |
instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint"; |
2036 |
} |
2037 |
else if (instanceToggle.Tag.ToString() == "Eraser") |
2038 |
{ |
2039 |
TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal); |
2040 |
instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke"; |
2041 |
//instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke; |
2042 |
} |
2043 |
else |
2044 |
{ |
2045 |
instanceMain.dzMainMenu.inkBoard.Tag = "Ink"; |
2046 |
//instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink; |
2047 |
} |
2048 |
|
2049 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true; |
2050 |
|
2051 |
Common.ViewerDataModel.Instance.SelectedControl = "Ink"; |
2052 |
Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value; |
2053 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl; |
2054 |
break; |
2055 |
#endregion |
2056 |
#region Select |
2057 |
case "Select": |
2058 |
if(this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2059 |
{ |
2060 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2061 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2062 |
} |
2063 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting; |
2064 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2065 |
instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2066 |
break; |
2067 |
#endregion |
2068 |
#region Image |
2069 |
case "Image": |
2070 |
Common.ViewerDataModel.Instance.SelectedControl = "ImgControl"; |
2071 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
2072 |
ImageConverter(instanceToggle); |
2073 |
break; |
2074 |
#endregion |
2075 |
#region Sign |
2076 |
case "Sign": |
2077 |
Common.ViewerDataModel.Instance.SelectedControl = "Sign"; |
2078 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2079 |
//강인구 추가 |
2080 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign; |
2081 |
//instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) => |
2082 |
//{ |
2083 |
// if (ea.Result == null) |
2084 |
// { |
2085 |
|
2086 |
// this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert"); |
2087 |
// } |
2088 |
// else |
2089 |
// { |
2090 |
// byte[] imageBytes = System.Convert.FromBase64String(ea.Result); |
2091 |
// using (MemoryStream ms = new MemoryStream(imageBytes)) |
2092 |
// { |
2093 |
// BitmapImage im = new BitmapImage(); |
2094 |
// im.SetSource(ms); |
2095 |
// instanceMain.DeepLayer.SignImage = im; |
2096 |
// ms.Close(); |
2097 |
// } |
2098 |
// } |
2099 |
//}; |
2100 |
//instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID); |
2101 |
break; |
2102 |
#endregion |
2103 |
#region Check |
2104 |
case "Check": |
2105 |
Common.ViewerDataModel.Instance.SelectedControl = "Check"; |
2106 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2107 |
//강인구 추가 |
2108 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol; |
2109 |
break; |
2110 |
#endregion |
2111 |
#region Batch |
2112 |
case "Batch": |
2113 |
Common.ViewerDataModel.Instance.SelectedControl = "Batch"; |
2114 |
Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
2115 |
//강인구 추가 |
2116 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark; |
2117 |
instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible; |
2118 |
instanceMain.dzMainMenu.txtBatch.Text = "Place Mark"; |
2119 |
break; |
2120 |
#endregion |
2121 |
#region Copy |
2122 |
case "Copy": |
2123 |
Copy_Start(); |
2124 |
instanceToggle.IsChecked = false; |
2125 |
ViewerDataModel.Instance.SelectedControl = ""; |
2126 |
ViewerDataModel.Instance.ControlTag = null; |
2127 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2128 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2129 |
break; |
2130 |
#endregion |
2131 |
#region Cut |
2132 |
case "Cut": |
2133 |
Cut_Start(); |
2134 |
instanceToggle.IsChecked = false; |
2135 |
ViewerDataModel.Instance.SelectedControl = ""; |
2136 |
ViewerDataModel.Instance.ControlTag = null; |
2137 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2138 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2139 |
break; |
2140 |
#endregion |
2141 |
#region Paste |
2142 |
case "Paste": |
2143 |
Paste_Start(); |
2144 |
instanceToggle.IsChecked = false; |
2145 |
ViewerDataModel.Instance.SelectedControl = ""; |
2146 |
ViewerDataModel.Instance.ControlTag = null; |
2147 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2148 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2149 |
break; |
2150 |
#endregion |
2151 |
#region Delete |
2152 |
case "Delete": |
2153 |
DeleteCommand.Instance.Execute(this.ParentOfType<MainWindow>().SelectedItems); |
2154 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
2155 |
|
2156 |
instanceToggle.IsChecked = false; |
2157 |
ViewerDataModel.Instance.SelectedControl = ""; |
2158 |
ViewerDataModel.Instance.ControlTag = null; |
2159 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2160 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2161 |
break; |
2162 |
#endregion |
2163 |
#region Undo |
2164 |
case "Undo": |
2165 |
this.ParentOfType<MainWindow>().dzMainMenu.Undo(); |
2166 |
instanceToggle.IsChecked = false; |
2167 |
ViewerDataModel.Instance.SelectedControl = ""; |
2168 |
ViewerDataModel.Instance.ControlTag = null; |
2169 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2170 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2171 |
break; |
2172 |
#endregion |
2173 |
#region Redo |
2174 |
case "Redo": |
2175 |
this.ParentOfType<MainWindow>().dzMainMenu.Redo(); |
2176 |
instanceToggle.IsChecked = false; |
2177 |
ViewerDataModel.Instance.SelectedControl = ""; |
2178 |
ViewerDataModel.Instance.ControlTag = null; |
2179 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2180 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2181 |
break; |
2182 |
#endregion |
2183 |
#region DragZoom |
2184 |
case "DragZoom": |
2185 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.DragZoom; |
2186 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2187 |
instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2188 |
break; |
2189 |
#endregion |
2190 |
#region Grouping |
2191 |
case "Group": |
2192 |
var GrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2193 |
foreach (var togle in GrouptoggleList) |
2194 |
{ |
2195 |
togle.IsChecked = false; |
2196 |
} |
2197 |
|
2198 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2199 |
{ |
2200 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2201 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2202 |
} |
2203 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2204 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2205 |
instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2206 |
if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면 |
2207 |
{ |
2208 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert"); |
2209 |
} |
2210 |
else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
2211 |
{ |
2212 |
// string MarkupData = ""; |
2213 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
2214 |
{ |
2215 |
if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 2) // 얘가 2개 이상이여야 그룹가능 버튼도 막을거긴하지만 일단.. |
2216 |
{ |
2217 |
//MARKUP_DATA_GROUP INSERT |
2218 |
MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
2219 |
{ |
2220 |
SYMBOL_ID = null,//InnerItem.Symbol_ID |
2221 |
STATE = 0, |
2222 |
}; |
2223 |
long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO); |
2224 |
Logger.sendReqLog("AddMarkupDataGroup: ", "", 1); |
2225 |
if (group_id > 0) |
2226 |
{ |
2227 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
2228 |
{ |
2229 |
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
2230 |
{ |
2231 |
//MARKUP_DATA UPDATE |
2232 |
//Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, group_id, App.ViewInfo.ProjectNO); |
2233 |
//Logger.sendReqLog("UpdateMarkupData: ", "", 1); |
2234 |
ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id; |
2235 |
ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true; |
2236 |
} |
2237 |
} |
2238 |
} |
2239 |
} |
2240 |
} |
2241 |
} |
2242 |
break; |
2243 |
case "UnGroup": |
2244 |
var UnGrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2245 |
foreach (var togle in UnGrouptoggleList) |
2246 |
{ |
2247 |
togle.IsChecked = false; |
2248 |
} |
2249 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2250 |
{ |
2251 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2252 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2253 |
} |
2254 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2255 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2256 |
instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2257 |
|
2258 |
if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면 |
2259 |
{ |
2260 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert"); |
2261 |
} |
2262 |
else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
2263 |
{ |
2264 |
// string MarkupData = ""; |
2265 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
2266 |
{ |
2267 |
if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 1) // 1개 이상 |
2268 |
{ |
2269 |
//MARKUP_DATA UPDATE |
2270 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
2271 |
{ |
2272 |
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
2273 |
{ |
2274 |
long group_id = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID; |
2275 |
//MARKUP_DATA UPDATE |
2276 |
//Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, 0, App.ViewInfo.ProjectNO); |
2277 |
//Logger.sendReqLog("UpdateMarkupData: ", "", 1); |
2278 |
ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0; |
2279 |
ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true; |
2280 |
|
2281 |
|
2282 |
//MARKUP_DATA_GROUP UPDATE |
2283 |
bool value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupDataGroup(group_id, App.ViewInfo.ProjectNO); |
2284 |
Logger.sendReqLog("AddMarkupDataGroup: ", value.ToString(), 1); |
2285 |
} |
2286 |
} |
2287 |
} |
2288 |
} |
2289 |
} |
2290 |
break; |
2291 |
#endregion |
2292 |
#region Capture |
2293 |
case "Capture": |
2294 |
SyncInit(); |
2295 |
// instanceToggle.IsChecked = false; |
2296 |
var CaptureList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2297 |
foreach (var togle in CaptureList) |
2298 |
{ |
2299 |
togle.IsChecked = false; |
2300 |
} |
2301 |
|
2302 |
if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2303 |
{ |
2304 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
2305 |
this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
2306 |
} |
2307 |
|
2308 |
ViewerDataModel.Instance.SelectedControl = "ImgControl"; |
2309 |
// ViewerDataModel.Instance.ControlTag = null; |
2310 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
2311 |
|
2312 |
/* |
2313 |
//캡쳐 하기 전에 코멘트 저장 |
2314 |
if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0) |
2315 |
{ |
2316 |
var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu; |
2317 |
menu.ReleaseAdorner(); |
2318 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
2319 |
{ |
2320 |
(Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
2321 |
} |
2322 |
else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
2323 |
{ |
2324 |
|
2325 |
} |
2326 |
else |
2327 |
{ |
2328 |
(Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
2329 |
} |
2330 |
}*/ |
2331 |
|
2332 |
//Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID; |
2333 |
//Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID; |
2334 |
//Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER; |
2335 |
Application.Current.MainWindow.Focus(); |
2336 |
Common.ViewerDataModel.Instance.Capture_Opacity = 0.49; |
2337 |
(Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
2338 |
break; |
2339 |
#endregion |
2340 |
#region Cad |
2341 |
case "Inside": |
2342 |
//instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2343 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2344 |
Common.ViewerDataModel.Instance.SelectedControl = "InsideWhite"; |
2345 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.InsideWhite; |
2346 |
break; |
2347 |
case "Overlap": |
2348 |
//instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2349 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2350 |
Common.ViewerDataModel.Instance.SelectedControl = "OverlapWhite"; |
2351 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.OverlapWhite; |
2352 |
break; |
2353 |
case "Clip": |
2354 |
//instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
2355 |
//instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
2356 |
Common.ViewerDataModel.Instance.SelectedControl = "ClipWhite"; |
2357 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ClipWhite; |
2358 |
break; |
2359 |
case "CadExport": |
2360 |
if (isClosed) |
2361 |
{ |
2362 |
//토글 및 마우스 상태 초기화 |
2363 |
var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2364 |
foreach (var togle in toggleList) |
2365 |
{ |
2366 |
togle.IsChecked = false; |
2367 |
} |
2368 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2369 |
|
2370 |
isClosed = false; |
2371 |
//Control 파일 먼저 생성 |
2372 |
CollapsedButton_Click(); |
2373 |
CadViewer check = new CadViewer(); |
2374 |
check.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
2375 |
check.Title = "Export Viewer"; |
2376 |
//check.Topmost = true; |
2377 |
check.Show(); |
2378 |
check.Closed += Check_Closed; |
2379 |
instanceToggle.IsChecked = false; |
2380 |
} |
2381 |
break; |
2382 |
case "CadViewer": |
2383 |
if (isClosed) |
2384 |
{ |
2385 |
//토글 및 마우스 상태 초기화 |
2386 |
var toggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>(); |
2387 |
foreach (var togle in toggleList) |
2388 |
{ |
2389 |
togle.IsChecked = false; |
2390 |
} |
2391 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2392 |
|
2393 |
isClosed = false; |
2394 |
CadResultViewer check = new CadResultViewer(); |
2395 |
check.WindowStartupLocation = WindowStartupLocation.CenterScreen; |
2396 |
check.Title = "Viewer"; |
2397 |
check.Show(); |
2398 |
|
2399 |
check.Closed += Check_Closed; |
2400 |
|
2401 |
} |
2402 |
break; |
2403 |
#endregion |
2404 |
default: |
2405 |
break; |
2406 |
} |
2407 |
#endregion |
2408 |
} |
2409 |
else |
2410 |
{ |
2411 |
|
2412 |
if (!instanceMain.dzMainMenu.IsFreeSelectionMode) |
2413 |
{ |
2414 |
instanceMain.dzMainMenu.IsSwingMode = false; |
2415 |
Common.ViewerDataModel.Instance.SelectedControl = ""; |
2416 |
Common.ViewerDataModel.Instance.ControlTag = null; |
2417 |
this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
2418 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2419 |
} |
2420 |
} |
2421 |
} |
2422 |
|
2423 |
private void SyncInit() |
2424 |
{ |
2425 |
try |
2426 |
{ |
2427 |
if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden) |
2428 |
{ |
2429 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true; |
2430 |
ViewerDataModel.Instance.PageBalanceMode = false; |
2431 |
ViewerDataModel.Instance.PageBalanceNumber = 0; |
2432 |
ViewerDataModel.Instance.PageNumber = 0; |
2433 |
ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
2434 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
2435 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false; |
2436 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false; |
2437 |
} |
2438 |
} |
2439 |
catch (Exception ex) |
2440 |
{ |
2441 |
Logger.sendResLog("SyncInit", ex.Message, 0); |
2442 |
} |
2443 |
|
2444 |
} |
2445 |
|
2446 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
2447 |
CommentUserInfo currentControl { get; set; } |
2448 |
private Point GetSquareEndPoint(Point StartP, Point EndP) |
2449 |
{ |
2450 |
Point Return_Point = new Point(); |
2451 |
double dx = EndP.X - StartP.X; |
2452 |
double dy = EndP.Y - StartP.Y; |
2453 |
double length; |
2454 |
length = Math.Max(Math.Abs(dx), Math.Abs(dy)); |
2455 |
Return_Point.X = (dx > 0) ? StartP.X + length : StartP.X - length; |
2456 |
Return_Point.Y = (dy > 0) ? StartP.Y + length : StartP.Y - length; |
2457 |
return Return_Point; |
2458 |
} |
2459 |
private void Check_Closed(object sender, EventArgs e) |
2460 |
{ |
2461 |
isClosed = true; |
2462 |
//this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
2463 |
//토글 및 마우스 상태 초기화 |
2464 |
var toggleList = this.Parent.ChildrenOfType<RadToggleButton>(); |
2465 |
foreach (var togle in toggleList) |
2466 |
{ |
2467 |
togle.IsChecked = false; |
2468 |
} |
2469 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2470 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
2471 |
|
2472 |
} |
2473 |
|
2474 |
/* public class test |
2475 |
{ |
2476 |
public double width { get; set; } |
2477 |
public double height { get; set; } |
2478 |
} |
2479 |
*/ |
2480 |
private void CollapsedButton_Click() |
2481 |
{ |
2482 |
this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장 |
2483 |
|
2484 |
string[] data = new string[0]; |
2485 |
|
2486 |
int cnt = 0; |
2487 |
var menu = this.ParentOfType<MainWindow>().dzMainMenu; |
2488 |
|
2489 |
List<MarkupInfoItem> gridSelectionItem = menu.gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
2490 |
|
2491 |
foreach (var item in gridSelectionItem) |
2492 |
{ |
2493 |
if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null)) |
2494 |
{ |
2495 |
var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber && |
2496 |
d.MarkupInfoID == item.MarkupInfoID).ToList(); |
2497 |
data = new string[instance.Count]; |
2498 |
foreach (var markup in instance) |
2499 |
{ |
2500 |
data[cnt++] = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(markup.Data); |
2501 |
} |
2502 |
} |
2503 |
} |
2504 |
|
2505 |
if (data != null) |
2506 |
{ |
2507 |
string FilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cad"); |
2508 |
string FileName = FilePath + "\\commentstring.json"; // Default file name |
2509 |
if (!File.Exists(FilePath)) |
2510 |
{ |
2511 |
Directory.CreateDirectory(FilePath); |
2512 |
} |
2513 |
|
2514 |
if (!string.IsNullOrEmpty(FileName)) |
2515 |
{ |
2516 |
// File.WriteAllText(SaveDig.FileName, data); |
2517 |
File.WriteAllLines(FileName, data); |
2518 |
} |
2519 |
} |
2520 |
} |
2521 |
|
2522 |
private double minHeight; |
2523 |
private double minWidth; |
2524 |
|
2525 |
private double maxHeight; |
2526 |
private double maxWidth; |
2527 |
|
2528 |
public bool CanVResize { get; private set; } |
2529 |
public bool CanHResize { get; private set; } |
2530 |
|
2531 |
public void DesignerComponent(FrameworkElement content) |
2532 |
{ |
2533 |
this.InitializeComponent(); |
2534 |
|
2535 |
if (!double.IsNaN(content.Width)) |
2536 |
{ |
2537 |
CanHResize = false; |
2538 |
this.Width = content.Width; |
2539 |
} |
2540 |
else |
2541 |
{ |
2542 |
CanHResize = true; |
2543 |
this.Width = 23.0; |
2544 |
} |
2545 |
if (!double.IsNaN(content.Height)) |
2546 |
{ |
2547 |
CanVResize = false; |
2548 |
this.Height = content.Height; ; |
2549 |
} |
2550 |
else |
2551 |
{ |
2552 |
CanVResize = true; |
2553 |
this.Height = 23.0; |
2554 |
} |
2555 |
|
2556 |
minWidth = content.MinWidth < 10.0 ? 10.0 : content.MinWidth; |
2557 |
minHeight = content.MinHeight < 10.0 ? 10.0 : content.MinHeight; |
2558 |
maxWidth = content.MaxWidth; |
2559 |
maxHeight = content.MaxHeight; |
2560 |
|
2561 |
double top = (double)content.GetValue(Canvas.TopProperty); |
2562 |
if (double.IsNaN(top)) |
2563 |
top = 0.0; |
2564 |
double left = (double)content.GetValue(Canvas.LeftProperty); |
2565 |
if (double.IsNaN(left)) |
2566 |
left = 0.0; |
2567 |
SetValue(Canvas.TopProperty, top); |
2568 |
SetValue(Canvas.LeftProperty, left); |
2569 |
|
2570 |
//Set the actual content. Note that "Content" property is a new property. See below |
2571 |
this.Content = content; |
2572 |
} |
2573 |
private void Thumb_DragDelta(object sender, DragDeltaEventArgs e) |
2574 |
{ |
2575 |
string name = ((Thumb)sender).Name; |
2576 |
if (name.Contains("Top")) |
2577 |
{ |
2578 |
double newHeight = this.Height - e.VerticalChange; |
2579 |
if (newHeight >= minHeight && newHeight <= maxHeight) |
2580 |
{ |
2581 |
this.Height = newHeight; |
2582 |
SetValue(Canvas.TopProperty, |
2583 |
(double)GetValue(Canvas.TopProperty) + e.VerticalChange); |
2584 |
} |
2585 |
} |
2586 |
if (name.Contains("Right")) |
2587 |
{ |
2588 |
double newWidth = this.Width + e.HorizontalChange; |
2589 |
if (newWidth >= minWidth && newWidth <= maxWidth) |
2590 |
this.Width = newWidth; |
2591 |
} |
2592 |
if (name.Contains("Bottom")) |
2593 |
{ |
2594 |
double newHeight = this.Height + e.VerticalChange; |
2595 |
if (newHeight >= minHeight && newHeight <= maxHeight) |
2596 |
this.Height = newHeight; |
2597 |
} |
2598 |
if (name.Contains("Left")) |
2599 |
{ |
2600 |
double newWidth = this.Width - e.HorizontalChange; |
2601 |
if (newWidth >= minWidth && newWidth <= maxWidth) |
2602 |
{ |
2603 |
this.Width = newWidth; |
2604 |
SetValue(Canvas.LeftProperty, |
2605 |
(double)GetValue(Canvas.LeftProperty) + e.HorizontalChange); |
2606 |
} |
2607 |
} |
2608 |
} |
2609 |
|
2610 |
private void drawControlBorder(object sender) |
2611 |
{ |
2612 |
System.Windows.Controls.Control control = (System.Windows.Controls.Control)sender; |
2613 |
} |
2614 |
|
2615 |
private void ResizeThumb_DragDelta(object sender, MouseButtonEventArgs e) |
2616 |
{ |
2617 |
System.Windows.Controls.Control designerItem = (System.Windows.Controls.Control)sender; |
2618 |
if (designerItem != null) |
2619 |
{ |
2620 |
double deltaVertical, deltaHorizontal; |
2621 |
|
2622 |
switch (VerticalAlignment) |
2623 |
{ |
2624 |
case VerticalAlignment.Bottom: |
2625 |
deltaVertical = designerItem.ActualHeight - designerItem.MinHeight; |
2626 |
designerItem.Height -= deltaVertical; |
2627 |
break; |
2628 |
case VerticalAlignment.Top: |
2629 |
deltaVertical = designerItem.ActualHeight - designerItem.MinHeight; |
2630 |
Canvas.SetTop(designerItem, Canvas.GetTop(designerItem) + deltaVertical); |
2631 |
designerItem.Height -= deltaVertical; |
2632 |
break; |
2633 |
default: |
2634 |
break; |
2635 |
} |
2636 |
|
2637 |
switch (HorizontalAlignment) |
2638 |
{ |
2639 |
case HorizontalAlignment.Left: |
2640 |
deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth; |
2641 |
Canvas.SetLeft(designerItem, Canvas.GetLeft(designerItem) + deltaHorizontal); |
2642 |
designerItem.Width -= deltaHorizontal; |
2643 |
break; |
2644 |
case HorizontalAlignment.Right: |
2645 |
deltaHorizontal = designerItem.ActualWidth - designerItem.MinWidth; |
2646 |
designerItem.Width -= deltaHorizontal; |
2647 |
break; |
2648 |
default: |
2649 |
break; |
2650 |
} |
2651 |
} |
2652 |
e.Handled = true; |
2653 |
} |
2654 |
|
2655 |
SaveFileDialog SaveDig = new SaveFileDialog(); //파일 세이브 다이얼로그 |
2656 |
|
2657 |
void ExportMethod() |
2658 |
{ |
2659 |
//FileDialogFilter filterImage = new FileDialogFilter("Image Files", "*.jpg", "*.png"); |
2660 |
SaveDig.Filter = "PDF file format|*.pdf"; |
2661 |
SaveDig.Title = "Save an DWG File"; |
2662 |
SaveDig.ShowDialog(); |
2663 |
} |
2664 |
|
2665 |
private void cbAutoSave_Checked(object sender, RoutedEventArgs e) |
2666 |
{ |
2667 |
if (cbAutoSave.IsChecked == true) |
2668 |
{ |
2669 |
SaveTime(true, (int)cbSaveInterval.Value); |
2670 |
} |
2671 |
else |
2672 |
{ |
2673 |
SaveTime(false, (int)cbSaveInterval.Value); |
2674 |
} |
2675 |
} |
2676 |
private void cbSaveInterval_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
2677 |
{ |
2678 |
if(string.IsNullOrEmpty(cbSaveInterval.Value.ToString())) |
2679 |
{ |
2680 |
cbSaveInterval.Value = cbSaveInterval.Minimum; |
2681 |
} |
2682 |
if (cbAutoSave.IsChecked == true) |
2683 |
{ |
2684 |
SaveTime(true, (int)cbSaveInterval.Value); |
2685 |
} |
2686 |
|
2687 |
KCOM.Properties.Settings.Default.SaveInterval = (double)cbSaveInterval.Value; |
2688 |
Properties.Settings.Default.Save(); |
2689 |
} |
2690 |
//강인구 자동 저장 추가 |
2691 |
private void AutoSave(object sender, RoutedEventArgs e) |
2692 |
{ |
2693 |
RadToggleButton instanceToggle = sender as RadToggleButton; |
2694 |
|
2695 |
if(instanceToggle.IsChecked == true) |
2696 |
{ |
2697 |
SaveTime(true); |
2698 |
} |
2699 |
else |
2700 |
{ |
2701 |
SaveTime(false); |
2702 |
} |
2703 |
} |
2704 |
|
2705 |
public void Copy_Start() |
2706 |
{ |
2707 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
2708 |
{ |
2709 |
string MarkupData = ""; |
2710 |
|
2711 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
2712 |
{ |
2713 |
if (item.GetType().Name == "AdornerFinal") |
2714 |
{ |
2715 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
2716 |
|
2717 |
{ |
2718 |
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
2719 |
{ |
2720 |
markupReturn = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
2721 |
MarkupData += "|OR|" + markupReturn.ConvertData; |
2722 |
} |
2723 |
} |
2724 |
Clipboard.SetText(MarkupData); |
2725 |
} |
2726 |
} |
2727 |
} |
2728 |
} |
2729 |
|
2730 |
public void Cut_Start() |
2731 |
{ |
2732 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
2733 |
{ |
2734 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
2735 |
{ |
2736 |
string MarkupData = ""; |
2737 |
|
2738 |
if (item.GetType().Name == "AdornerFinal") |
2739 |
{ |
2740 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
2741 |
{ |
2742 |
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
2743 |
{ |
2744 |
markupReturn = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
2745 |
MarkupData += "|OR|" + markupReturn.ConvertData; |
2746 |
} |
2747 |
} |
2748 |
//클립보드에 넣음 |
2749 |
Clipboard.SetText(MarkupData); |
2750 |
} |
2751 |
} |
2752 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
2753 |
} |
2754 |
} |
2755 |
|
2756 |
public void Paste_Start() |
2757 |
{ |
2758 |
//마크업 붙여넣기 |
2759 |
//if (Clipboard.GetText().Contains("|DZ|")) |
2760 |
if (Clipboard.GetText().Contains("|OR||DZ|")) |
2761 |
{ |
2762 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
2763 |
|
2764 |
string[] delimiterChars = { "|OR|" }; |
2765 |
string[] data = Clipboard.GetText().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
2766 |
|
2767 |
this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner(); |
2768 |
|
2769 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
2770 |
|
2771 |
//강인구 Undo/Redo 보류 |
2772 |
UndoData = new Undo_data() |
2773 |
{ |
2774 |
IsUndo = false, |
2775 |
Event = Event_Type.Create, |
2776 |
EventTime = DateTime.Now, |
2777 |
Markup_List = new List<Multi_Undo_data>() |
2778 |
}; |
2779 |
|
2780 |
ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
2781 |
{ |
2782 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
2783 |
}); |
2784 |
|
2785 |
foreach (string parse in data) |
2786 |
{ |
2787 |
if (parse != "") |
2788 |
{ |
2789 |
System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty); |
2790 |
(item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid(); |
2791 |
|
2792 |
ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
2793 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
2794 |
|
2795 |
adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo); |
2796 |
|
2797 |
//Controls.AdornerFinal final = new Controls.AdornerFinal(item as MarkupToPDF.Common.CommentUserInfo); |
2798 |
//this.dzMainMenu.SelectLayer.Children.Add(final); |
2799 |
|
2800 |
multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
2801 |
|
2802 |
UndoData.Markup_List.Add(multi_Undo_Data); |
2803 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
2804 |
} |
2805 |
} |
2806 |
Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
2807 |
|
2808 |
if(this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X < 0) |
2809 |
{ |
2810 |
Canvas.SetLeft(final, 0); |
2811 |
Canvas.SetTop(final, 0); |
2812 |
} |
2813 |
else |
2814 |
{ |
2815 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
2816 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
2817 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
2818 |
|
2819 |
if (final.MemberSet.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
2820 |
{ |
2821 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy |
2822 |
} |
2823 |
|
2824 |
} |
2825 |
|
2826 |
|
2827 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
2828 |
|
2829 |
//붙여 넣을때 원본 컨트롤과 겹치지 않도록 설정 |
2830 |
//Canvas.SetLeft(final, 50); |
2831 |
//Canvas.SetTop(final, 50); |
2832 |
} |
2833 |
//외부 이미지 붙여넣기 |
2834 |
else if (Clipboard.GetImage() != null) |
2835 |
{ |
2836 |
try |
2837 |
{ |
2838 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
2839 |
|
2840 |
//강인구 Undo/Redo 보류 |
2841 |
UndoData = new Undo_data() |
2842 |
{ |
2843 |
IsUndo = false, |
2844 |
Event = Event_Type.Create, |
2845 |
EventTime = DateTime.Now, |
2846 |
Markup_List = new List<Multi_Undo_data>() |
2847 |
}; |
2848 |
|
2849 |
|
2850 |
string temppath = System.IO.Path.GetTempPath(); |
2851 |
//string filename = KCOM.Events.Save.shortCommentKey(); |
2852 |
string filename = Commons.shortFileKey(); |
2853 |
|
2854 |
System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
2855 |
clipboardImage.Save(temppath + "\\" + filename); |
2856 |
|
2857 |
System.IO.FileInfo fileInfo = new System.IO.FileInfo(temppath + "\\" + filename); |
2858 |
String strFile = System.IO.Path.GetFileName(fileInfo.FullName); |
2859 |
long numByte = fileInfo.Length; |
2860 |
double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
2861 |
kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
2862 |
|
2863 |
if (dLen < 4) |
2864 |
{ |
2865 |
System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName, |
2866 |
System.IO.FileMode.Open, System.IO.FileAccess.Read); |
2867 |
System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
2868 |
byte[] data = br.ReadBytes((int)numByte); |
2869 |
|
2870 |
filename = fileUploader.Run(App.ViewInfo.ProjectNO, this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data); |
2871 |
Check_Uri.UriCheck(filename); |
2872 |
br.Close(); |
2873 |
fStream.Close(); |
2874 |
fStream.Dispose(); |
2875 |
} |
2876 |
else |
2877 |
{ |
2878 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
2879 |
return; |
2880 |
} |
2881 |
|
2882 |
fileInfo.Delete(); |
2883 |
|
2884 |
//System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
2885 |
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage); |
2886 |
IntPtr hBitmap = bmp.GetHbitmap(); |
2887 |
System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); |
2888 |
Image img = new Image(); |
2889 |
//img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(filename)); |
2890 |
if (filename.Contains(".svg")) |
2891 |
{ |
2892 |
byte[] imageData = null; |
2893 |
DrawingImage image = null; |
2894 |
using (System.Net.WebClient web = new System.Net.WebClient()) |
2895 |
{ |
2896 |
imageData = web.DownloadData(new Uri(filename)); |
2897 |
System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
2898 |
image = SvgReader.Load(stream); |
2899 |
} |
2900 |
img.Source = image; |
2901 |
} |
2902 |
else |
2903 |
{ |
2904 |
img.Source = new BitmapImage(new Uri(filename)); |
2905 |
} |
2906 |
|
2907 |
var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
2908 |
{ |
2909 |
PointSet = new List<Point>(), |
2910 |
//FilePath = img.Source.ToString(), |
2911 |
FilePath = filename, |
2912 |
ImageData = img.Source, |
2913 |
StartPoint = new Point(100, 100), |
2914 |
EndPoint = new Point(200, 200), |
2915 |
TopRightPoint = new Point(100, 200), |
2916 |
LeftBottomPoint = new Point(200, 100) |
2917 |
}; |
2918 |
|
2919 |
currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y); |
2920 |
currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height); |
2921 |
currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height); |
2922 |
|
2923 |
currentControl.PointSet = new List<Point> |
2924 |
{ |
2925 |
currentControl.StartPoint, |
2926 |
currentControl.LeftBottomPoint, |
2927 |
currentControl.EndPoint, |
2928 |
currentControl.TopRightPoint, |
2929 |
}; |
2930 |
|
2931 |
multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
2932 |
UndoData.Markup_List.Add(multi_Undo_Data); |
2933 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
2934 |
|
2935 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
2936 |
currentControl.CommentID = Commons.shortGuid(); |
2937 |
|
2938 |
currentControl.ApplyTemplate(); |
2939 |
currentControl.SetImage(); |
2940 |
|
2941 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
2942 |
Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
2943 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
2944 |
|
2945 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
2946 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
2947 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
2948 |
} |
2949 |
catch(Exception ex) |
2950 |
{ |
2951 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("" + ex, "Alert"); |
2952 |
} |
2953 |
} |
2954 |
} |
2955 |
} |
2956 |
} |