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