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