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