markus / KCOM / Events / Implementation / TopMenuEvent.cs @ b7637656
이력 | 보기 | 이력해설 | 다운로드 (121 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 | b9b01f8e | ljiyeon | PrintWindow.Owner = Application.Current.MainWindow; |
604 | 787a4489 | KangIngu | 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 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
1288 | 787a4489 | KangIngu | Theme = new VisualStudio2013Theme(), |
1289 | Header = "안내", |
||
1290 | Content = "페이지 번호를 정확하게 입력해 주세요", |
||
1291 | }); |
||
1292 | } |
||
1293 | |||
1294 | } |
||
1295 | } |
||
1296 | |||
1297 | 3026d214 | ljiyeon | private void tlcurrentPage_readonly_KeyDown(object sender, KeyEventArgs e) |
1298 | { |
||
1299 | //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
||
1300 | if (e.Key == Key.Enter) |
||
1301 | { |
||
1302 | try |
||
1303 | { |
||
1304 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
1305 | instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage_readonly.Text)); |
||
1306 | } |
||
1307 | catch (Exception) |
||
1308 | { |
||
1309 | RadWindow.Alert(new DialogParameters |
||
1310 | { |
||
1311 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
1312 | 3026d214 | ljiyeon | Theme = new VisualStudio2013Theme(), |
1313 | Header = "안내", |
||
1314 | Content = "페이지 번호를 정확하게 입력해 주세요", |
||
1315 | }); |
||
1316 | } |
||
1317 | |||
1318 | } |
||
1319 | } |
||
1320 | |||
1321 | |||
1322 | 787a4489 | KangIngu | public event EventHandler<WindowClosedEventArgs> Closed; |
1323 | |||
1324 | //private void CheckEvent(object sender, RoutedEventArgs e) |
||
1325 | //{ |
||
1326 | // RadWindow CheckPop = new RadWindow(); |
||
1327 | // test check = new test(); |
||
1328 | |||
1329 | // CheckPop = new RadWindow |
||
1330 | // { |
||
1331 | // Width = 1700, |
||
1332 | // Height = 510, |
||
1333 | // Header = "My Check List", |
||
1334 | // Content = check, |
||
1335 | // Owner = this, |
||
1336 | // ResizeMode = System.Windows.ResizeMode.NoResize, |
||
1337 | // WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
1338 | // }; |
||
1339 | // StyleManager.SetTheme(CheckPop, new VisualStudio2013Theme()); |
||
1340 | |||
1341 | // CheckPop.Closed += CheckPop_Closed; |
||
1342 | // CheckPop.ShowDialog(); |
||
1343 | //} |
||
1344 | |||
1345 | private void PanoramaEvent(object sender, RoutedEventArgs e) |
||
1346 | { |
||
1347 | PanoramaShow(); |
||
1348 | } |
||
1349 | |||
1350 | public void PanoramaShow() |
||
1351 | { |
||
1352 | Panorama check = new Panorama(); |
||
1353 | double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth; |
||
1354 | double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight; |
||
1355 | //double windowWidth = this.Width; |
||
1356 | //double windowHeight = this.Height; |
||
1357 | |||
1358 | var PanoramaPop = new RadWindow |
||
1359 | { |
||
1360 | //MinWidth = 600, |
||
1361 | //MinHeight = 400, |
||
1362 | //Header = "My Check List", |
||
1363 | Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION, |
||
1364 | Content = check, |
||
1365 | Owner = this, |
||
1366 | ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
||
1367 | //ResizeMode = System.Windows.ResizeMode.NoResize, |
||
1368 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
1369 | IsTopmost = false, |
||
1370 | //Left = (screenWidth / 2) - (windowWidth / 2), |
||
1371 | //Top = (screenHeight / 2) - (windowHeight / 2), |
||
1372 | //Left = (screenWidth / 2), |
||
1373 | //Top = (screenHeight / 2), |
||
1374 | Width = screenWidth * 0.4, |
||
1375 | Height = screenHeight * 0.4, |
||
1376 | }; |
||
1377 | StyleManager.SetTheme(PanoramaPop, new VisualStudio2013Theme()); |
||
1378 | //CheckPop.ShowDialog(); |
||
1379 | b9b01f8e | ljiyeon | PanoramaPop.Owner = Application.Current.MainWindow; |
1380 | 787a4489 | KangIngu | PanoramaPop.Show(); |
1381 | } |
||
1382 | d4b0c723 | KangIngu | |
1383 | 787a4489 | KangIngu | private void CheckEvent(object sender, RoutedEventArgs e) |
1384 | { |
||
1385 | //창이 떠있을 경우 재 실행 방지 |
||
1386 | if (isClosed) |
||
1387 | { |
||
1388 | //토글 및 마우스 상태 초기화 |
||
1389 | var toggleList = this.Parent.ChildrenOfType<RadToggleButton>(); |
||
1390 | foreach(var togle in toggleList) |
||
1391 | { |
||
1392 | togle.IsChecked = false; |
||
1393 | } |
||
1394 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
1395 | |||
1396 | isClosed = false; |
||
1397 | |||
1398 | |||
1399 | CheckList check = new CheckList(); |
||
1400 | |||
1401 | CheckPop = new RadWindow |
||
1402 | { |
||
1403 | MinWidth = 1200, |
||
1404 | MinHeight = 500, |
||
1405 | //Header = "My Check List", |
||
1406 | Header = "Document No : " + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO + " / Revision :" + this.ParentOfType<MainWindow>().dzMainMenu._DocItem.REVISION, |
||
1407 | Content = check, |
||
1408 | //Owner = this, |
||
1409 | //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, |
||
1410 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
1411 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
1412 | IsTopmost = true, |
||
1413 | }; |
||
1414 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
1415 | CheckPop.Closed += CheckPop_Closed; |
||
1416 | b9b01f8e | ljiyeon | //CheckPop.Owner = Application.Current.MainWindow; |
1417 | 787a4489 | KangIngu | //CheckPop.ShowDialog(); |
1418 | CheckPop.Show(); |
||
1419 | } |
||
1420 | } |
||
1421 | |||
1422 | private void CheckPop_Closed(object sender, WindowClosedEventArgs e) |
||
1423 | { |
||
1424 | isClosed = true; |
||
1425 | //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true; |
||
1426 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
1427 | ViewerDataModel.Instance.Capture_Opacity = 0; |
||
1428 | } |
||
1429 | |||
1430 | 64f6713a | humkyung | /// <summary> |
1431 | /// 사용자가 선택한 페이지로 이동(썸네일 동기화 시킴) |
||
1432 | /// </summary> |
||
1433 | /// <param name="sender"></param> |
||
1434 | /// <param name="e"></param> |
||
1435 | 787a4489 | KangIngu | private void PageGoEvent(object sender, RoutedEventArgs e) |
1436 | { |
||
1437 | RadButton button = sender as RadButton; |
||
1438 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
1439 | |||
1440 | //강인구 추가 tlcurrentPage을 이상하게 입력할수 있기때문에 Try Catch |
||
1441 | try |
||
1442 | { |
||
1443 | switch (button.CommandParameter.ToString()) |
||
1444 | { |
||
1445 | case "Down": |
||
1446 | { |
||
1447 | instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) + 1); |
||
1448 | } |
||
1449 | break; |
||
1450 | case "Up": |
||
1451 | { |
||
1452 | instanceMain.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(tlcurrentPage.Text) - 1); |
||
1453 | } |
||
1454 | break; |
||
1455 | } |
||
1456 | } |
||
1457 | catch (Exception) |
||
1458 | { |
||
1459 | RadWindow.Alert(new DialogParameters |
||
1460 | { |
||
1461 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
1462 | 787a4489 | KangIngu | Theme = new VisualStudio2013Theme(), |
1463 | Header = "안내", |
||
1464 | Content = "페이지 번호를 정확하게 입력해 주세요", |
||
1465 | }); |
||
1466 | } |
||
1467 | } |
||
1468 | |||
1469 | private void viewEvent(object sender, RoutedEventArgs e) |
||
1470 | { |
||
1471 | 9f473fb7 | KangIngu | RadRibbonToggleButton viewButton = sender as RadRibbonToggleButton; |
1472 | 787a4489 | KangIngu | var instanceMain = this.ParentOfType<MainWindow>(); |
1473 | |||
1474 | Point point = new Point(instanceMain.dzMainMenu.zoomAndPanCanvas.Width / 2, instanceMain.dzMainMenu.zoomAndPanCanvas.Height / 2); |
||
1475 | |||
1476 | 9f473fb7 | KangIngu | //if ((sender as RadRibbonToggleButton) != null) |
1477 | //{ |
||
1478 | // Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString(); |
||
1479 | // instanceToggle = (sender as RadRibbonToggleButton); |
||
1480 | //} |
||
1481 | |||
1482 | //instanceToggle.IsChecked = false; |
||
1483 | |||
1484 | 787a4489 | KangIngu | switch (viewButton.CommandParameter.ToString()) |
1485 | { |
||
1486 | case "zoomout": |
||
1487 | { |
||
1488 | //장원 |
||
1489 | //instanceMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect(0, 0, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualWidth, instanceMain.dzMainMenu.zoomAndPanCanvas.ActualHeight)); |
||
1490 | instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale -= 0.1, point); |
||
1491 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1492 | 787a4489 | KangIngu | //Common.ViewerDataModel.Instance.zom |
1493 | } |
||
1494 | break; |
||
1495 | case "zoomin": |
||
1496 | { |
||
1497 | instanceMain.dzMainMenu.zoomAndPanControl.ZoomPointToViewportCenter(ViewerDataModel.Instance.ContentScale += 0.1, point); |
||
1498 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1499 | 787a4489 | KangIngu | } |
1500 | break; |
||
1501 | case "fullscreen": |
||
1502 | { |
||
1503 | instanceMain.WindowState = WindowState.Maximized; |
||
1504 | //Sizemode 대기(강인구) |
||
1505 | //instanceMain.dzMainMenu.imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit; |
||
1506 | instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
||
1507 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1508 | 787a4489 | KangIngu | } |
1509 | break; |
||
1510 | case "fitWidth": |
||
1511 | { |
||
1512 | instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
||
1513 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1514 | 787a4489 | KangIngu | } |
1515 | break; |
||
1516 | case "fitHeight": |
||
1517 | { |
||
1518 | instanceMain.dzMainMenu.zoomAndPanControl.ScaleToFit(); |
||
1519 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1520 | 787a4489 | KangIngu | } |
1521 | break; |
||
1522 | case "boundzoom": |
||
1523 | { |
||
1524 | 9f473fb7 | KangIngu | |
1525 | 787a4489 | KangIngu | } |
1526 | break; |
||
1527 | case "Rotate_M": |
||
1528 | { |
||
1529 | drawingPannelRotate(false); |
||
1530 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1531 | 787a4489 | KangIngu | } |
1532 | break; |
||
1533 | case "Rotate_P": |
||
1534 | { |
||
1535 | drawingPannelRotate(true); |
||
1536 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1537 | 787a4489 | KangIngu | } |
1538 | break; |
||
1539 | case "Rotate_half": |
||
1540 | { |
||
1541 | drawingPannelRotate(true); |
||
1542 | drawingPannelRotate(true); |
||
1543 | 9f473fb7 | KangIngu | viewButton.IsChecked = false; |
1544 | 787a4489 | KangIngu | } |
1545 | break; |
||
1546 | } |
||
1547 | } |
||
1548 | |||
1549 | d4b0c723 | KangIngu | private void Control_Event(object sender, RoutedEventArgs e) |
1550 | { |
||
1551 | |||
1552 | } |
||
1553 | |||
1554 | 787a4489 | KangIngu | #region 대기 |
1555 | |||
1556 | public void drawingPannelRotate(bool Flag) |
||
1557 | { |
||
1558 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
1559 | |||
1560 | //if (rotateOffSet > 3) |
||
1561 | // rotateOffSet = 0; |
||
1562 | |||
1563 | //if (rotateOffSet < 0) |
||
1564 | // rotateOffSet = 3; |
||
1565 | |||
1566 | if(Flag) |
||
1567 | { |
||
1568 | if (instanceMain.dzMainMenu.rotate.Angle == 270) |
||
1569 | { |
||
1570 | instanceMain.dzMainMenu.rotate.Angle = 0; |
||
1571 | } |
||
1572 | else |
||
1573 | { |
||
1574 | instanceMain.dzMainMenu.rotate.Angle += 90; |
||
1575 | } |
||
1576 | } |
||
1577 | else |
||
1578 | { |
||
1579 | if(instanceMain.dzMainMenu.rotate.Angle == 0) |
||
1580 | { |
||
1581 | instanceMain.dzMainMenu.rotate.Angle = 270; |
||
1582 | } |
||
1583 | else |
||
1584 | { |
||
1585 | instanceMain.dzMainMenu.rotate.Angle -= 90; |
||
1586 | } |
||
1587 | } |
||
1588 | //double angle = (double)rotateValue.GetValue(rotateOffSet); |
||
1589 | //instanceMain.dzMainMenu.rotate.Angle = angle; |
||
1590 | var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90)); |
||
1591 | |||
1592 | if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth) |
||
1593 | { |
||
1594 | double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
1595 | instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
1596 | instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize; |
||
1597 | } |
||
1598 | if (instanceMain.dzMainMenu.rotate.Angle == 0) |
||
1599 | { |
||
1600 | instanceMain.dzMainMenu.translate.X = 0; |
||
1601 | instanceMain.dzMainMenu.translate.Y = 0; |
||
1602 | } |
||
1603 | else if (instanceMain.dzMainMenu.rotate.Angle == 90) |
||
1604 | { |
||
1605 | instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
1606 | instanceMain.dzMainMenu.translate.Y = 0; |
||
1607 | } |
||
1608 | else if (instanceMain.dzMainMenu.rotate.Angle == 180) |
||
1609 | { |
||
1610 | instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
1611 | instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
1612 | } |
||
1613 | else |
||
1614 | { |
||
1615 | instanceMain.dzMainMenu.translate.X = 0; |
||
1616 | instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
1617 | } |
||
1618 | |||
1619 | //instanceMain.dzMainMenu.zoomAndPanControl.RenderTransformOrigin = new Point(0.5, 0.5); |
||
1620 | instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle; |
||
1621 | //대기(강인구) |
||
1622 | //instanceMain.dzMainMenu.imageViewer.RotateAngle = instanceMain.dzMainMenu.rotate.Angle; |
||
1623 | |||
1624 | |||
1625 | //instanceMain.dzMainMenu.imageViewer.RenderTransformOrigin = new Point(0.5, 0.5); |
||
1626 | //RotateTransform rotateTransform = new RotateTransform(instanceMain.dzMainMenu.rotate.Angle); |
||
1627 | //instanceMain.dzMainMenu.imageViewer.RenderTransform = rotateTransform; |
||
1628 | |||
1629 | |||
1630 | ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
1631 | ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
1632 | ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X; |
||
1633 | ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y; |
||
1634 | ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle; |
||
1635 | //ViewerDataModel.Instance.Document_Info.Clear(); |
||
1636 | //ViewerDataModel.Instance.Document_Info.Where(i => i.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(value => |
||
1637 | //{ |
||
1638 | // value.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
||
1639 | //}); |
||
1640 | |||
1641 | |||
1642 | //이미지 각도 변경 시 실시간 Thumbnail 각도 변경(강인구 추가) |
||
1643 | instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data => |
||
1644 | { |
||
1645 | data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
||
1646 | |||
1647 | instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems; |
||
1648 | var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault(); |
||
1649 | instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
||
1650 | |||
1651 | instanceMain.dzMainMenu.pageNavigator.setPageChange(data); |
||
1652 | 2b19f5f2 | djkim | |
1653 | //rotation page add or update |
||
1654 | var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault(); |
||
1655 | if (rotationdoc != null) |
||
1656 | { |
||
1657 | rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE; |
||
1658 | } |
||
1659 | else |
||
1660 | { |
||
1661 | ViewerDataModel.Instance.RotationDocs.Add(instance); |
||
1662 | } |
||
1663 | 787a4489 | KangIngu | }); |
1664 | } |
||
1665 | #endregion |
||
1666 | |||
1667 | private void ImageConverter() |
||
1668 | { |
||
1669 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
1670 | //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx |
||
1671 | |||
1672 | |||
1673 | Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); |
||
1674 | dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png"; |
||
1675 | Nullable<bool> result = dlg.ShowDialog(); |
||
1676 | if (result == true) |
||
1677 | { |
||
1678 | instanceMain.dzMainMenu.filename = dlg.FileName; |
||
1679 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
||
1680 | |||
1681 | System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename); |
||
1682 | String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename); |
||
1683 | long numByte = fileInfo.Length; |
||
1684 | double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
||
1685 | kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
||
1686 | |||
1687 | if (dLen < 4) |
||
1688 | { |
||
1689 | System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read); |
||
1690 | System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
||
1691 | byte[] data = br.ReadBytes((int)numByte); |
||
1692 | br.Close(); |
||
1693 | |||
1694 | instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data); |
||
1695 | fStream.Close(); |
||
1696 | fStream.Dispose(); |
||
1697 | } |
||
1698 | else |
||
1699 | { |
||
1700 | this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
||
1701 | } |
||
1702 | } |
||
1703 | } |
||
1704 | |||
1705 | d4b0c723 | KangIngu | private void Control_Init(RadToggleButton instanceToggle, object sender) |
1706 | { |
||
1707 | |||
1708 | } |
||
1709 | |||
1710 | 787a4489 | KangIngu | private void ControlEvent(object sender, RoutedEventArgs e) |
1711 | { |
||
1712 | RadToggleButton instanceToggle = sender as RadToggleButton; |
||
1713 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
1714 | |||
1715 | #region Ctrl + A 눌렀을 때 대처 방법 |
||
1716 | //원인 : Ctrl + A를 누르면 UIElementSet에 등록을 시키지 않는다(이유는 한꺼번에 많은 양의 컨트롤의 동작이 유입되기 때문에 |
||
1717 | // 시스템의 성능저하를 불러올 수 있기 때문이다. 그래서 선택 후 다른 컨트롤을 누르면 등록되지 않은 컨트롤이기 때문에 삭제된다 |
||
1718 | // 이를 대처하는 방법으로 아래 코드를 사용한다. |
||
1719 | if (Common.ViewerDataModel.Instance.MarkupControls.Count == 0 && Common.ViewerDataModel.Instance.MarkupControls.Count >= 1) |
||
1720 | { |
||
1721 | //var lstItem = instanceMain.DeepLayer._SelectLayer.ChildrenOfType<AdornerFinal>().ToList(); |
||
1722 | //foreach (var item in lstItem) |
||
1723 | //{ |
||
1724 | // foreach (var member in item.MemberSet) |
||
1725 | // { |
||
1726 | // if (!instanceMain.DeepLayer.UIElementSet.Contains(member.DrawingData)) |
||
1727 | // { |
||
1728 | // instanceMain.DeepLayer.UIElementSet.Add(member.DrawingData); |
||
1729 | // } |
||
1730 | // } |
||
1731 | //} |
||
1732 | } |
||
1733 | #endregion |
||
1734 | |||
1735 | //if (!instanceMain.IsFreeSelectionMode) |
||
1736 | //{ |
||
1737 | // instanceMain.IsSwingMode = true; |
||
1738 | //} |
||
1739 | |||
1740 | d4b0c723 | KangIngu | #region 다른 컨트롤 버튼 선택 해제 |
1741 | System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.SelectedControl).Subscribe(ControlState => |
||
1742 | { |
||
1743 | if (ControlState == null) |
||
1744 | { |
||
1745 | instanceToggle.IsChecked = false; |
||
1746 | HiddenControlHide(); |
||
1747 | } |
||
1748 | }); |
||
1749 | #endregion |
||
1750 | |||
1751 | 787a4489 | KangIngu | Release_ToggleButton(sender); //-> 해당 컨트롤을 제외한 모든 컨트롤에 대해 해제 처리 |
1752 | d4b0c723 | KangIngu | |
1753 | 787a4489 | KangIngu | if (instanceToggle != null) |
1754 | { |
||
1755 | Common.ViewerDataModel.Instance.ControlTag = instanceToggle.Tag.ToString(); |
||
1756 | } |
||
1757 | else if ((sender as RadRibbonToggleButton) != null) |
||
1758 | { |
||
1759 | Common.ViewerDataModel.Instance.ControlTag = (sender as RadRibbonToggleButton).Tag.ToString(); |
||
1760 | instanceToggle = (sender as RadRibbonToggleButton); |
||
1761 | } |
||
1762 | else if ((sender as RadRibbonButton) != null) |
||
1763 | { |
||
1764 | RadRibbonButton instanceButton = sender as RadRibbonButton; |
||
1765 | Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString(); |
||
1766 | } |
||
1767 | else |
||
1768 | { |
||
1769 | RadButton instanceButton = sender as RadButton; |
||
1770 | Common.ViewerDataModel.Instance.ControlTag = instanceButton.Tag.ToString(); |
||
1771 | } |
||
1772 | |||
1773 | |||
1774 | |||
1775 | System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleVisibility).Subscribe(isSee => |
||
1776 | { |
||
1777 | instanceMain.dzMainMenu.MainAngle.Visibility = isSee; |
||
1778 | System.Reactive.Linq.Observable2.FromPropertyChangedPattern(Common.ViewerDataModel.Instance, temp => temp.AngleValue).Subscribe(p => |
||
1779 | { |
||
1780 | instanceMain.dzMainMenu.MainAngle.AngleValue = p; |
||
1781 | }); |
||
1782 | }); |
||
1783 | instanceMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Drawing; |
||
1784 | |||
1785 | instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = false; |
||
1786 | |||
1787 | if (instanceToggle.IsChecked != false) |
||
1788 | { |
||
1789 | #region 컨트롤이 체크되었다면 |
||
1790 | switch (instanceToggle.CommandParameter.ToString()) |
||
1791 | { |
||
1792 | #region Line |
||
1793 | case "Line": |
||
1794 | Common.ViewerDataModel.Instance.SelectedControl = "Line"; |
||
1795 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1796 | if (instanceToggle.Tag.ToString() == "LineDelete") |
||
1797 | { |
||
1798 | //HiddenInterval.Visibility = Visibility.Visible; |
||
1799 | } |
||
1800 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.SingleLine; |
||
1801 | break; |
||
1802 | #endregion |
||
1803 | #region ChainLine |
||
1804 | case "ChainLine": |
||
1805 | Common.ViewerDataModel.Instance.SelectedControl = "ChainLine"; |
||
1806 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1807 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ChainLine; |
||
1808 | break; |
||
1809 | #endregion |
||
1810 | #region DimLine |
||
1811 | case "DimLine": |
||
1812 | Common.ViewerDataModel.Instance.SelectedControl = "DimLine"; |
||
1813 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1814 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.DimLine; |
||
1815 | break; |
||
1816 | #endregion |
||
1817 | #region TwinLine |
||
1818 | case "TwinLine": |
||
1819 | Common.ViewerDataModel.Instance.SelectedControl = "TwinLine"; |
||
1820 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1821 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TwinLine; |
||
1822 | break; |
||
1823 | #endregion |
||
1824 | #region CancelLine |
||
1825 | case "CancelLine": |
||
1826 | Common.ViewerDataModel.Instance.SelectedControl = "CancelLine"; |
||
1827 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1828 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.CancelLine; |
||
1829 | break; |
||
1830 | #endregion |
||
1831 | #region PolygonCloud |
||
1832 | case "PolygonCloud": |
||
1833 | Common.ViewerDataModel.Instance.SelectedControl = "PolygonCloud"; |
||
1834 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1835 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonCloud; |
||
1836 | break; |
||
1837 | #endregion |
||
1838 | #region RectCloud |
||
1839 | case "RectCloud": |
||
1840 | Common.ViewerDataModel.Instance.SelectedControl = "RectCloud"; |
||
1841 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1842 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.RectCloud; |
||
1843 | break; |
||
1844 | #endregion |
||
1845 | 4318fdeb | KangIngu | #region Rectangle |
1846 | 787a4489 | KangIngu | case "Rectangle": |
1847 | Common.ViewerDataModel.Instance.SelectedControl = "Rectangle"; |
||
1848 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1849 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Rectangle; |
||
1850 | break; |
||
1851 | #endregion |
||
1852 | 4318fdeb | KangIngu | #region Triangle |
1853 | 787a4489 | KangIngu | case "Triangle": |
1854 | Common.ViewerDataModel.Instance.SelectedControl = "Triangle"; |
||
1855 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1856 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Triangle; |
||
1857 | break; |
||
1858 | #endregion |
||
1859 | #region RectCloud |
||
1860 | case "Circle": |
||
1861 | Common.ViewerDataModel.Instance.SelectedControl = "Circle"; |
||
1862 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1863 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Circle; |
||
1864 | break; |
||
1865 | #endregion |
||
1866 | #region Symbol |
||
1867 | case "Symbol": |
||
1868 | Common.ViewerDataModel.Instance.SelectedControl = "Symbol"; |
||
1869 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
1870 | break; |
||
1871 | #endregion |
||
1872 | #region SymbolN |
||
1873 | case "SymbolN": |
||
1874 | Common.ViewerDataModel.Instance.SelectedControl = "SymbolN"; |
||
1875 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Stamp; |
||
1876 | break; |
||
1877 | #endregion |
||
1878 | #region Text |
||
1879 | case "Text": |
||
1880 | Common.ViewerDataModel.Instance.SelectedControl = "Text"; |
||
1881 | TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
||
1882 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextControl; |
||
1883 | break; |
||
1884 | #endregion |
||
1885 | #region TextBorder |
||
1886 | case "TextBorder": |
||
1887 | Common.ViewerDataModel.Instance.SelectedControl = "TextBorder"; |
||
1888 | TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
||
1889 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextBorder; |
||
1890 | break; |
||
1891 | #endregion |
||
1892 | #region TextCloud |
||
1893 | case "TextCloud": |
||
1894 | Common.ViewerDataModel.Instance.SelectedControl = "TextCloud"; |
||
1895 | TaskMessage("Text 도구는 텍스트 영역을 더블 클릭하여 텍스트를 재 편집 할 수 있습니다", TaskMessageType.Normal); |
||
1896 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.TextCloud; |
||
1897 | break; |
||
1898 | #endregion |
||
1899 | #region Date |
||
1900 | case "Date": |
||
1901 | Common.ViewerDataModel.Instance.SelectedControl = "Date"; |
||
1902 | TaskMessage("날짜 컨트롤을 더블 클릭하면 날짜를 변경할 수 있습니다", TaskMessageType.Normal); |
||
1903 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Date; |
||
1904 | break; |
||
1905 | #endregion |
||
1906 | #region ArrowText |
||
1907 | case "ArrowText": |
||
1908 | TaskMessage("ArrowText 컨트롤은 그린 후 컨트롤을 선택하였을 시 중간점을 조정할 수 있습니다", TaskMessageType.Normal); |
||
1909 | if (instanceToggle.Tag.ToString() == "ArrowText_Cloud") |
||
1910 | { |
||
1911 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowText_Cloud"; |
||
1912 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl; |
||
1913 | } |
||
1914 | else if (instanceToggle.Tag.ToString() == "ArrowText_Border") |
||
1915 | { |
||
1916 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowTextBorderControl"; |
||
1917 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl; |
||
1918 | } |
||
1919 | else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Normal") |
||
1920 | { |
||
1921 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextControl"; |
||
1922 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl; |
||
1923 | } |
||
1924 | else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Border") |
||
1925 | { |
||
1926 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextBorderControl"; |
||
1927 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl; |
||
1928 | } |
||
1929 | else if (instanceToggle.Tag.ToString() == "ArrowTextFix_Cloud") |
||
1930 | { |
||
1931 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowTransTextCloudControl"; |
||
1932 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl; |
||
1933 | } |
||
1934 | else |
||
1935 | { |
||
1936 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowText"; |
||
1937 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowTextControl; |
||
1938 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1939 | } |
||
1940 | break; |
||
1941 | #endregion |
||
1942 | #region Arrow |
||
1943 | case "Arrow": |
||
1944 | Common.ViewerDataModel.Instance.SelectedControl = "Arrow"; |
||
1945 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1946 | //HiddenDimSize.Visibility = Visibility.Visible; |
||
1947 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowLine; |
||
1948 | break; |
||
1949 | #endregion |
||
1950 | #region Shape |
||
1951 | case "Shape": |
||
1952 | Common.ViewerDataModel.Instance.SelectedControl = "Shape"; |
||
1953 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark; |
||
1954 | break; |
||
1955 | #endregion |
||
1956 | #region Polygon |
||
1957 | case "Polygon": |
||
1958 | Common.ViewerDataModel.Instance.SelectedControl = "Polygon"; |
||
1959 | TaskMessage("자유형 코멘트 도구는 오른쪽 마우스 클릭을 통해 그리기를 마칠 수 있습니다", TaskMessageType.Normal); |
||
1960 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1961 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PolygonControl; |
||
1962 | break; |
||
1963 | #endregion |
||
1964 | #region Arc |
||
1965 | case "Arc": |
||
1966 | Common.ViewerDataModel.Instance.SelectedControl = "Arc"; |
||
1967 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcLine; |
||
1968 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1969 | TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
||
1970 | break; |
||
1971 | #endregion |
||
1972 | 40b3ce25 | ljiyeon | #region ArrowArc |
1973 | case "ArrowArc": |
||
1974 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowArc"; |
||
1975 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcArrow; |
||
1976 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1977 | TaskMessage("ArcArrow 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
||
1978 | break; |
||
1979 | #endregion |
||
1980 | 787a4489 | KangIngu | #region ArrowMulti |
1981 | case "ArrowMulti": |
||
1982 | Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti"; |
||
1983 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine; |
||
1984 | //HiddenAxisLock.Visibility = Visibility.Visible; |
||
1985 | break; |
||
1986 | #endregion |
||
1987 | #region Etc |
||
1988 | case "Etc": |
||
1989 | Common.ViewerDataModel.Instance.SelectedControl = "Etc"; |
||
1990 | break; |
||
1991 | #endregion |
||
1992 | #region Ink |
||
1993 | case "Ink": |
||
1994 | if (instanceToggle.Tag.ToString() == "EraserClear") |
||
1995 | { |
||
1996 | TaskMessage("해당 컨트롤은 점 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal); |
||
1997 | //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint; |
||
1998 | instanceMain.dzMainMenu.inkBoard.Tag = "EraseByPoint"; |
||
1999 | } |
||
2000 | else if (instanceToggle.Tag.ToString() == "Eraser") |
||
2001 | { |
||
2002 | TaskMessage("해당 컨트롤은 선 단위로 그려진 펜을 지웁니다", TaskMessageType.Normal); |
||
2003 | instanceMain.dzMainMenu.inkBoard.Tag = "EraseByStroke"; |
||
2004 | //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke; |
||
2005 | } |
||
2006 | else |
||
2007 | { |
||
2008 | instanceMain.dzMainMenu.inkBoard.Tag = "Ink"; |
||
2009 | //instanceMain.dzMainMenu.inkDrawingCanvas.EditingMode = InkCanvasEditingMode.Ink; |
||
2010 | } |
||
2011 | |||
2012 | //instanceMain.dzMainMenu.inkDrawingCanvas.IsEnabled = true; |
||
2013 | |||
2014 | Common.ViewerDataModel.Instance.SelectedControl = "Ink"; |
||
2015 | Common.ViewerDataModel.Instance.LineSize = (double)cbLineSize.Value; |
||
2016 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.PenControl; |
||
2017 | break; |
||
2018 | #endregion |
||
2019 | #region Select |
||
2020 | case "Select": |
||
2021 | 65246dc9 | KangIngu | if(this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null) |
2022 | { |
||
2023 | ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl); |
||
2024 | this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null; |
||
2025 | } |
||
2026 | 787a4489 | KangIngu | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting; |
2027 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2028 | 9f473fb7 | KangIngu | instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
2029 | 787a4489 | KangIngu | break; |
2030 | #endregion |
||
2031 | #region Image |
||
2032 | case "Image": |
||
2033 | Common.ViewerDataModel.Instance.SelectedControl = "ImgControl"; |
||
2034 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
||
2035 | ImageConverter(); |
||
2036 | break; |
||
2037 | #endregion |
||
2038 | #region Sign |
||
2039 | case "Sign": |
||
2040 | Common.ViewerDataModel.Instance.SelectedControl = "Sign"; |
||
2041 | Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
||
2042 | //강인구 추가 |
||
2043 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Sign; |
||
2044 | //instanceMain.BaseClient.GetUserSignCompleted += (sen, ea) => |
||
2045 | //{ |
||
2046 | // if (ea.Result == null) |
||
2047 | // { |
||
2048 | |||
2049 | // this.ParentOfType<MainPage>().DialogMessage_Alert("You Don't Have Sign Data", "Alert"); |
||
2050 | // } |
||
2051 | // else |
||
2052 | // { |
||
2053 | // byte[] imageBytes = System.Convert.FromBase64String(ea.Result); |
||
2054 | // using (MemoryStream ms = new MemoryStream(imageBytes)) |
||
2055 | // { |
||
2056 | // BitmapImage im = new BitmapImage(); |
||
2057 | // im.SetSource(ms); |
||
2058 | // instanceMain.DeepLayer.SignImage = im; |
||
2059 | // ms.Close(); |
||
2060 | // } |
||
2061 | // } |
||
2062 | //}; |
||
2063 | //instanceMain.BaseClient.GetUserSignAsync(instanceMain._ViewInfo.UserID); |
||
2064 | break; |
||
2065 | #endregion |
||
2066 | #region Check |
||
2067 | case "Check": |
||
2068 | Common.ViewerDataModel.Instance.SelectedControl = "Check"; |
||
2069 | Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
||
2070 | //강인구 추가 |
||
2071 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Symbol; |
||
2072 | break; |
||
2073 | #endregion |
||
2074 | #region Batch |
||
2075 | case "Batch": |
||
2076 | Common.ViewerDataModel.Instance.SelectedControl = "Batch"; |
||
2077 | Common.ViewerDataModel.Instance.ControlTag = instanceMain.dzMainMenu._ViewInfo.UserID; //사번 |
||
2078 | //강인구 추가 |
||
2079 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.Mark; |
||
2080 | instanceMain.dzMainMenu.txtBatch.Visibility = Visibility.Visible; |
||
2081 | 999c9e40 | humkyung | instanceMain.dzMainMenu.txtBatch.Text = "Place Mark"; |
2082 | 787a4489 | KangIngu | break; |
2083 | d4b0c723 | KangIngu | #endregion |
2084 | #region Copy |
||
2085 | case "Copy": |
||
2086 | Copy_Start(); |
||
2087 | instanceToggle.IsChecked = false; |
||
2088 | ViewerDataModel.Instance.SelectedControl = ""; |
||
2089 | ViewerDataModel.Instance.ControlTag = null; |
||
2090 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2091 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
2092 | break; |
||
2093 | #endregion |
||
2094 | #region Cut |
||
2095 | case "Cut": |
||
2096 | Cut_Start(); |
||
2097 | instanceToggle.IsChecked = false; |
||
2098 | ViewerDataModel.Instance.SelectedControl = ""; |
||
2099 | ViewerDataModel.Instance.ControlTag = null; |
||
2100 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2101 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
2102 | break; |
||
2103 | #endregion |
||
2104 | #region Paste |
||
2105 | case "Paste": |
||
2106 | Paste_Start(); |
||
2107 | instanceToggle.IsChecked = false; |
||
2108 | ViewerDataModel.Instance.SelectedControl = ""; |
||
2109 | ViewerDataModel.Instance.ControlTag = null; |
||
2110 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2111 | ccf944bb | ljiyeon | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
2112 | d4b0c723 | KangIngu | break; |
2113 | #endregion |
||
2114 | #region Delete |
||
2115 | case "Delete": |
||
2116 | Delete_Start(); |
||
2117 | instanceToggle.IsChecked = false; |
||
2118 | ViewerDataModel.Instance.SelectedControl = ""; |
||
2119 | ViewerDataModel.Instance.ControlTag = null; |
||
2120 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2121 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
2122 | break; |
||
2123 | #endregion |
||
2124 | #region Undo |
||
2125 | case "Undo": |
||
2126 | this.ParentOfType<MainWindow>().dzMainMenu.Undo(); |
||
2127 | instanceToggle.IsChecked = false; |
||
2128 | ViewerDataModel.Instance.SelectedControl = ""; |
||
2129 | ViewerDataModel.Instance.ControlTag = null; |
||
2130 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2131 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
2132 | break; |
||
2133 | #endregion |
||
2134 | #region Redo |
||
2135 | case "Redo": |
||
2136 | this.ParentOfType<MainWindow>().dzMainMenu.Redo(); |
||
2137 | instanceToggle.IsChecked = false; |
||
2138 | ViewerDataModel.Instance.SelectedControl = ""; |
||
2139 | ViewerDataModel.Instance.ControlTag = null; |
||
2140 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2141 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
2142 | 9f473fb7 | KangIngu | break; |
2143 | #endregion |
||
2144 | #region DragZoom |
||
2145 | case "DragZoom": |
||
2146 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.DragZoom; |
||
2147 | instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2148 | instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
||
2149 | break; |
||
2150 | d4b0c723 | KangIngu | #endregion |
2151 | 9f473fb7 | KangIngu | |
2152 | 787a4489 | KangIngu | default: |
2153 | break; |
||
2154 | } |
||
2155 | #endregion |
||
2156 | } |
||
2157 | else |
||
2158 | { |
||
2159 | 992a98b4 | KangIngu | |
2160 | 787a4489 | KangIngu | if (!instanceMain.dzMainMenu.IsFreeSelectionMode) |
2161 | { |
||
2162 | instanceMain.dzMainMenu.IsSwingMode = false; |
||
2163 | Common.ViewerDataModel.Instance.SelectedControl = ""; |
||
2164 | Common.ViewerDataModel.Instance.ControlTag = null; |
||
2165 | this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
2166 | this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
2167 | } |
||
2168 | } |
||
2169 | } |
||
2170 | |||
2171 | 537f4cd8 | djkim | private void cbAutoSave_Checked(object sender, RoutedEventArgs e) |
2172 | be04d12c | djkim | { |
2173 | if (cbAutoSave.IsChecked == true) |
||
2174 | 537f4cd8 | djkim | { |
2175 | SaveTime(true, (int)cbSaveInterval.Value); |
||
2176 | } |
||
2177 | else |
||
2178 | { |
||
2179 | SaveTime(false, (int)cbSaveInterval.Value); |
||
2180 | } |
||
2181 | } |
||
2182 | private void cbSaveInterval_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
||
2183 | { |
||
2184 | be04d12c | djkim | if(string.IsNullOrEmpty(cbSaveInterval.Value.ToString())) |
2185 | { |
||
2186 | cbSaveInterval.Value = cbSaveInterval.Minimum; |
||
2187 | } |
||
2188 | 537f4cd8 | djkim | if (cbAutoSave.IsChecked == true) |
2189 | { |
||
2190 | SaveTime(true, (int)cbSaveInterval.Value); |
||
2191 | 5822e146 | ljiyeon | } |
2192 | |||
2193 | KCOM.Properties.Settings.Default.SaveInterval = (double)cbSaveInterval.Value; |
||
2194 | Properties.Settings.Default.Save(); |
||
2195 | 537f4cd8 | djkim | } |
2196 | 787a4489 | KangIngu | //강인구 자동 저장 추가 |
2197 | private void AutoSave(object sender, RoutedEventArgs e) |
||
2198 | { |
||
2199 | RadToggleButton instanceToggle = sender as RadToggleButton; |
||
2200 | |||
2201 | if(instanceToggle.IsChecked == true) |
||
2202 | { |
||
2203 | SaveTime(true); |
||
2204 | } |
||
2205 | else |
||
2206 | { |
||
2207 | SaveTime(false); |
||
2208 | } |
||
2209 | } |
||
2210 | |||
2211 | d4b0c723 | KangIngu | public void Copy_Start() |
2212 | { |
||
2213 | if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
||
2214 | { |
||
2215 | string MarkupData = ""; |
||
2216 | |||
2217 | foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
||
2218 | { |
||
2219 | if (item.GetType().Name == "AdornerFinal") |
||
2220 | { |
||
2221 | foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
||
2222 | |||
2223 | { |
||
2224 | if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
||
2225 | { |
||
2226 | markupReturn = layer.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
||
2227 | MarkupData += "|OR|" + markupReturn.ConvertData; |
||
2228 | } |
||
2229 | } |
||
2230 | Clipboard.SetText(MarkupData); |
||
2231 | } |
||
2232 | } |
||
2233 | } |
||
2234 | } |
||
2235 | |||
2236 | public void Cut_Start() |
||
2237 | { |
||
2238 | if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
||
2239 | { |
||
2240 | foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
||
2241 | { |
||
2242 | string MarkupData = ""; |
||
2243 | |||
2244 | if (item.GetType().Name == "AdornerFinal") |
||
2245 | { |
||
2246 | foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
||
2247 | { |
||
2248 | if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
||
2249 | { |
||
2250 | markupReturn = layer.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
||
2251 | MarkupData += "|OR|" + markupReturn.ConvertData; |
||
2252 | } |
||
2253 | } |
||
2254 | ccf944bb | ljiyeon | //클립보드에 넣음 |
2255 | d4b0c723 | KangIngu | Clipboard.SetText(MarkupData); |
2256 | } |
||
2257 | } |
||
2258 | this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
||
2259 | } |
||
2260 | } |
||
2261 | |||
2262 | public void Paste_Start() |
||
2263 | { |
||
2264 | //마크업 붙여넣기 |
||
2265 | //if (Clipboard.GetText().Contains("|DZ|")) |
||
2266 | if (Clipboard.GetText().Contains("|OR||DZ|")) |
||
2267 | { |
||
2268 | List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
||
2269 | |||
2270 | string[] delimiterChars = { "|OR|" }; |
||
2271 | string[] data = Clipboard.GetText().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
||
2272 | |||
2273 | this.ParentOfType<MainWindow>().dzMainMenu.ReleaseAdorner(); |
||
2274 | |||
2275 | Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
||
2276 | |||
2277 | //강인구 Undo/Redo 보류 |
||
2278 | UndoData = new Undo_data() |
||
2279 | { |
||
2280 | IsUndo = false, |
||
2281 | Event = Event_Type.Create, |
||
2282 | EventTime = DateTime.Now, |
||
2283 | Markup_List = new List<Multi_Undo_data>() |
||
2284 | }; |
||
2285 | |||
2286 | ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
||
2287 | { |
||
2288 | ViewerDataModel.Instance.UndoDataList.Remove(i); |
||
2289 | }); |
||
2290 | |||
2291 | foreach (string parse in data) |
||
2292 | { |
||
2293 | if (parse != "") |
||
2294 | { |
||
2295 | System.Windows.Controls.Control item = layer.markupParse_Paste(parse, ViewerDataModel.Instance.MarkupControls_USER); |
||
2296 | (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Events.Save.shortGuid(); |
||
2297 | |||
2298 | ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
||
2299 | ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
||
2300 | |||
2301 | adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo); |
||
2302 | |||
2303 | //Controls.AdornerFinal final = new Controls.AdornerFinal(item as MarkupToPDF.Common.CommentUserInfo); |
||
2304 | //this.dzMainMenu.SelectLayer.Children.Add(final); |
||
2305 | |||
2306 | multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
||
2307 | |||
2308 | UndoData.Markup_List.Add(multi_Undo_Data); |
||
2309 | 6707a5c7 | ljiyeon | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
2310 | d4b0c723 | KangIngu | } |
2311 | } |
||
2312 | Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
||
2313 | |||
2314 | if(this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X < 0) |
||
2315 | { |
||
2316 | Canvas.SetLeft(final, 0); |
||
2317 | Canvas.SetTop(final, 0); |
||
2318 | } |
||
2319 | else |
||
2320 | { |
||
2321 | double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
||
2322 | double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
||
2323 | final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
||
2324 | |||
2325 | if (final.MemberSet.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
||
2326 | { |
||
2327 | final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy |
||
2328 | } |
||
2329 | 6707a5c7 | ljiyeon | |
2330 | d4b0c723 | KangIngu | } |
2331 | |||
2332 | |||
2333 | this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
||
2334 | |||
2335 | //붙여 넣을때 원본 컨트롤과 겹치지 않도록 설정 |
||
2336 | //Canvas.SetLeft(final, 50); |
||
2337 | //Canvas.SetTop(final, 50); |
||
2338 | } |
||
2339 | //외부 이미지 붙여넣기 |
||
2340 | else if (Clipboard.GetImage() != null) |
||
2341 | { |
||
2342 | Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
||
2343 | |||
2344 | //강인구 Undo/Redo 보류 |
||
2345 | UndoData = new Undo_data() |
||
2346 | { |
||
2347 | IsUndo = false, |
||
2348 | Event = Event_Type.Create, |
||
2349 | EventTime = DateTime.Now, |
||
2350 | Markup_List = new List<Multi_Undo_data>() |
||
2351 | }; |
||
2352 | |||
2353 | |||
2354 | string temppath = System.IO.Path.GetTempPath(); |
||
2355 | //string filename = KCOM.Events.Save.shortCommentKey(); |
||
2356 | string filename = KCOM.Events.Save.shortFileKey(); |
||
2357 | |||
2358 | System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
||
2359 | clipboardImage.Save(temppath + "\\" + filename); |
||
2360 | |||
2361 | System.IO.FileInfo fileInfo = new System.IO.FileInfo(temppath + "\\" + filename); |
||
2362 | String strFile = System.IO.Path.GetFileName(fileInfo.FullName); |
||
2363 | long numByte = fileInfo.Length; |
||
2364 | double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
||
2365 | kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
||
2366 | |||
2367 | if (dLen < 4) |
||
2368 | { |
||
2369 | System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName, |
||
2370 | System.IO.FileMode.Open, System.IO.FileAccess.Read); |
||
2371 | System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
||
2372 | byte[] data = br.ReadBytes((int)numByte); |
||
2373 | |||
2374 | filename = fileUploader.Run(App.ViewInfo.ProjectNO, this.ParentOfType<MainWindow>().dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data); |
||
2375 | br.Close(); |
||
2376 | fStream.Close(); |
||
2377 | fStream.Dispose(); |
||
2378 | } |
||
2379 | else |
||
2380 | { |
||
2381 | this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
||
2382 | return; |
||
2383 | } |
||
2384 | |||
2385 | fileInfo.Delete(); |
||
2386 | |||
2387 | //System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
||
2388 | System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage); |
||
2389 | IntPtr hBitmap = bmp.GetHbitmap(); |
||
2390 | System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); |
||
2391 | Image img = new Image(); |
||
2392 | img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(filename)); |
||
2393 | |||
2394 | |||
2395 | |||
2396 | |||
2397 | |||
2398 | var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
||
2399 | { |
||
2400 | PointSet = new List<Point>(), |
||
2401 | FilePath = img.Source.ToString(), |
||
2402 | ImageData = img.Source, |
||
2403 | StartPoint = new Point(100, 100), |
||
2404 | EndPoint = new Point(200, 200), |
||
2405 | TopRightPoint = new Point(100, 200), |
||
2406 | LeftBottomPoint = new Point(200, 100) |
||
2407 | }; |
||
2408 | |||
2409 | currentControl.TopRightPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y); |
||
2410 | currentControl.LeftBottomPoint = new Point(currentControl.StartPoint.X, currentControl.StartPoint.Y + clipboardImage.Height); |
||
2411 | currentControl.EndPoint = new Point(currentControl.StartPoint.X + clipboardImage.Width, currentControl.StartPoint.Y + clipboardImage.Height); |
||
2412 | |||
2413 | currentControl.PointSet = new List<Point> |
||
2414 | { |
||
2415 | currentControl.StartPoint, |
||
2416 | currentControl.LeftBottomPoint, |
||
2417 | currentControl.EndPoint, |
||
2418 | currentControl.TopRightPoint, |
||
2419 | }; |
||
2420 | |||
2421 | multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2422 | UndoData.Markup_List.Add(multi_Undo_Data); |
||
2423 | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
||
2424 | |||
2425 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2426 | currentControl.CommentID = Events.Save.shortGuid(); |
||
2427 | |||
2428 | currentControl.ApplyTemplate(); |
||
2429 | currentControl.SetImage(); |
||
2430 | |||
2431 | ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2432 | Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2433 | this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
||
2434 | |||
2435 | double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
||
2436 | double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
||
2437 | final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
||
2438 | ccf944bb | ljiyeon | |
2439 | d4b0c723 | KangIngu | } |
2440 | } |
||
2441 | |||
2442 | public void Delete_Start() |
||
2443 | { |
||
2444 | if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
||
2445 | { |
||
2446 | Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
||
2447 | |||
2448 | UndoData = new Undo_data() |
||
2449 | { |
||
2450 | IsUndo = false, |
||
2451 | Event = Event_Type.Delete, |
||
2452 | EventTime = DateTime.Now, |
||
2453 | Markup_List = new List<Multi_Undo_data>() |
||
2454 | }; |
||
2455 | |||
2456 | foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
||
2457 | { |
||
2458 | if (item.GetType().Name == "AdornerFinal") |
||
2459 | { |
||
2460 | (item as Controls.AdornerFinal).unRegister(); |
||
2461 | |||
2462 | foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
||
2463 | { |
||
2464 | //if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
||
2465 | if (!ViewerDataModel.Instance.MarkupControls_USER.Contains(InnerItem.DrawingData)) |
||
2466 | { |
||
2467 | |||
2468 | multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
||
2469 | UndoData.Markup_List.Add(multi_Undo_Data); |
||
2470 | multi_Undo_Data = new Multi_Undo_data(); |
||
2471 | |||
2472 | ViewerDataModel.Instance.MarkupControls.Remove(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo); |
||
2473 | |||
2474 | var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault(); |
||
2475 | |||
2476 | ViewerDataModel.Instance.MarkupList_USER.Remove(Item_); |
||
2477 | ccf944bb | ljiyeon | |
2478 | 6707a5c7 | ljiyeon | //임시파일에서도 삭제한다. |
2479 | temp.DelTemp((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString()); |
||
2480 | |||
2481 | } |
||
2482 | d4b0c723 | KangIngu | } |
2483 | } |
||
2484 | |||
2485 | ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
||
2486 | { |
||
2487 | ViewerDataModel.Instance.UndoDataList.Remove(i); |
||
2488 | }); |
||
2489 | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
||
2490 | } |
||
2491 | } |
||
2492 | this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
||
2493 | } |
||
2494 | |||
2495 | 787a4489 | KangIngu | } |
2496 | } |