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