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