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