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