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