markus / KCOM / Views / MainMenu.xaml.cs @ 944be2fa
이력 | 보기 | 이력해설 | 다운로드 (245 KB)
1 | 787a4489 | KangIngu | |
---|---|---|---|
2 | using MarkupToPDF.Controls.Common; |
||
3 | using MarkupToPDF.Controls.Line; |
||
4 | using MarkupToPDF.Controls.Polygon; |
||
5 | using MarkupToPDF.Controls.Shape; |
||
6 | using MarkupToPDF.Controls.Text; |
||
7 | using MarkupToPDF.Controls.Etc; |
||
8 | 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.Data; |
||
15 | using System.Windows.Documents; |
||
16 | using System.Windows.Input; |
||
17 | using System.Windows.Media; |
||
18 | using System.Windows.Media.Imaging; |
||
19 | using System.Windows.Navigation; |
||
20 | using System.Windows.Shapes; |
||
21 | using KCOM.Common; |
||
22 | using IKCOM; |
||
23 | using System.Windows.Ink; |
||
24 | using System.Collections.ObjectModel; |
||
25 | using Telerik.Windows.Controls; |
||
26 | using KCOM.Events; |
||
27 | using System.Reflection; |
||
28 | using MarkupToPDF.Common; |
||
29 | using KCOM.Controls; |
||
30 | 670a4be2 | humkyung | using KCOMDataModel.DataModel; |
31 | d7548b21 | ljiyeon | using System.Xml; |
32 | 6707a5c7 | ljiyeon | using static KCOM.TempFile; |
33 | using System.Windows.Threading; |
||
34 | using System.Diagnostics; |
||
35 | using System.Threading; |
||
36 | 510cbd2a | ljiyeon | using System.Windows.Resources; |
37 | 53880c83 | ljiyeon | using Svg2Xaml; |
38 | using System.Runtime.InteropServices; |
||
39 | using System.Windows.Media.Effects; |
||
40 | 684ef11c | ljiyeon | using MarkupToPDF.Controls.Cad; |
41 | 036650a0 | humkyung | using MarkupToPDF.Controls.Parsing; |
42 | fddb48f7 | ljiyeon | using Telerik.Windows.Data; |
43 | using System.ComponentModel; |
||
44 | 787a4489 | KangIngu | |
45 | namespace KCOM.Views |
||
46 | { |
||
47 | public static class ControlExtensions |
||
48 | { |
||
49 | public static T Clone<T>(this T controlToClone) |
||
50 | where T : System.Windows.Controls.Control |
||
51 | { |
||
52 | System.Reflection.PropertyInfo[] controlProperties = typeof(T).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); |
||
53 | |||
54 | T instance = Activator.CreateInstance<T>(); |
||
55 | |||
56 | foreach (PropertyInfo propInfo in controlProperties) |
||
57 | { |
||
58 | if (propInfo.CanWrite) |
||
59 | { |
||
60 | if (propInfo.Name != "WindowTarget") |
||
61 | propInfo.SetValue(instance, propInfo.GetValue(controlToClone, null), null); |
||
62 | } |
||
63 | } |
||
64 | return instance; |
||
65 | } |
||
66 | } |
||
67 | |||
68 | a0bab669 | KangIngu | public class MyConsole |
69 | { |
||
70 | private readonly System.Threading.ManualResetEvent _readLineSignal; |
||
71 | private string _lastLine; |
||
72 | public MyConsole() |
||
73 | { |
||
74 | _readLineSignal = new System.Threading.ManualResetEvent(false); |
||
75 | Gui = new TextBox(); |
||
76 | Gui.AcceptsReturn = true; |
||
77 | Gui.KeyUp += OnKeyUp; |
||
78 | } |
||
79 | |||
80 | private void OnKeyUp(object sender, KeyEventArgs e) |
||
81 | { |
||
82 | // this is always fired on UI thread |
||
83 | if (e.Key == Key.Enter) |
||
84 | { |
||
85 | // quick and dirty, but that is not relevant to your question |
||
86 | _lastLine = Gui.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Last(); |
||
87 | // now, when you detected that user typed a line, set signal |
||
88 | _readLineSignal.Set(); |
||
89 | } |
||
90 | } |
||
91 | |||
92 | public TextBox Gui { get; private set; } |
||
93 | |||
94 | public string ReadLine() |
||
95 | { |
||
96 | // that should always be called from non-ui thread |
||
97 | if (Gui.Dispatcher.CheckAccess()) |
||
98 | throw new Exception("Cannot be called on UI thread"); |
||
99 | // reset signal |
||
100 | _readLineSignal.Reset(); |
||
101 | // wait until signal is set. This call is blocking, but since we are on non-ui thread - there is no problem with that |
||
102 | _readLineSignal.WaitOne(); |
||
103 | // we got signalled - return line user typed. |
||
104 | return _lastLine; |
||
105 | } |
||
106 | |||
107 | public void WriteLine(string line) |
||
108 | { |
||
109 | if (!Gui.Dispatcher.CheckAccess()) |
||
110 | { |
||
111 | Gui.Dispatcher.Invoke(new Action(() => WriteLine(line))); |
||
112 | return; |
||
113 | } |
||
114 | |||
115 | Gui.Text += line + Environment.NewLine; |
||
116 | } |
||
117 | } |
||
118 | |||
119 | 787a4489 | KangIngu | /// <summary> |
120 | /// MainMenu.xaml에 대한 상호 작용 논리 |
||
121 | /// </summary> |
||
122 | public partial class MainMenu : UserControl |
||
123 | { |
||
124 | #region 프로퍼티 |
||
125 | public CommentUserInfo currentControl { get; set; } |
||
126 | public ControlType controlType { get; set; } |
||
127 | e6a9ddaf | humkyung | private Move move = new Move(); |
128 | 787a4489 | KangIngu | private double[] rotateValue = { 0, 90, 180, 270 }; |
129 | public MouseHandlingMode mouseHandlingMode = MouseHandlingMode.None; |
||
130 | private static readonly double DragThreshold = 5; |
||
131 | eb2b9248 | KangIngu | private System.Windows.Input.Cursor cursor { get; set; } |
132 | 787a4489 | KangIngu | private Point canvasDrawingMouseDownPoint; |
133 | public string filename { get; set; } |
||
134 | private Point canvasZoomPanningMouseDownPoint; |
||
135 | public Point getCurrentPoint; |
||
136 | private Point canvasZoommovingMouseDownPoint; |
||
137 | List<object> ControlList = new List<object>(); |
||
138 | private ListBox listBox = new ListBox(); |
||
139 | private Dictionary<Geometry, string> selected_item = new Dictionary<Geometry, string>(); |
||
140 | private bool isDraggingSelectionRect = false; |
||
141 | DrawingAttributes inkDA = new DrawingAttributes(); |
||
142 | private VPRevision CurrentRev { get; set; } |
||
143 | public RadRibbonButton btnConsolidate { get; set; } |
||
144 | public RadRibbonButton btnFinalPDF { get; set; } |
||
145 | public RadRibbonButton btnTeamConsolidate { get; set; } |
||
146 | 80458c15 | ljiyeon | public RadRibbonButton btnConsolidateFinalPDF { get; set; } |
147 | |||
148 | 787a4489 | KangIngu | public string Filename_ { get; set; } |
149 | public double L_Size = 0; |
||
150 | public AdornerFinal adorner_; |
||
151 | public Multi_Undo_data multi_Undo_Data; |
||
152 | 5ce56a3a | KangIngu | public string Symbol_ID = ""; |
153 | 787a4489 | KangIngu | /// <summary> |
154 | /// Set to 'true' when the left mouse-button is down. |
||
155 | /// </summary> |
||
156 | 9f473fb7 | KangIngu | public bool isLeftMouseButtonDownOnWindow = false; |
157 | 787a4489 | KangIngu | |
158 | public InkPresenter _InkBoard = null; |
||
159 | Stroke stroke; |
||
160 | Boolean IsDrawing = false; |
||
161 | StylusPointCollection strokePoints; |
||
162 | 53880c83 | ljiyeon | //StylusPointCollection erasePoints; |
163 | 787a4489 | KangIngu | RenderTargetBitmap canvasImage; |
164 | Point Sync_Offset_Point; |
||
165 | |||
166 | //강인구 테스트 |
||
167 | private Path _SelectionPath { get; set; } |
||
168 | public Path SelectionPath |
||
169 | { |
||
170 | get |
||
171 | { |
||
172 | return _SelectionPath; |
||
173 | } |
||
174 | set |
||
175 | { |
||
176 | if (_SelectionPath != value) |
||
177 | { |
||
178 | _SelectionPath = value; |
||
179 | RaisePropertyChanged("SelectionPath"); |
||
180 | |||
181 | } |
||
182 | } |
||
183 | } |
||
184 | |||
185 | private System.Windows.Controls.Image _imageViewer { get; set; } |
||
186 | public System.Windows.Controls.Image imageViewer |
||
187 | { |
||
188 | get |
||
189 | { |
||
190 | if (_imageViewer == null) |
||
191 | { |
||
192 | _imageViewer = new System.Windows.Controls.Image(); |
||
193 | return _imageViewer; |
||
194 | } |
||
195 | else |
||
196 | { |
||
197 | return _imageViewer; |
||
198 | } |
||
199 | } |
||
200 | set |
||
201 | { |
||
202 | if (_imageViewer != value) |
||
203 | { |
||
204 | _imageViewer = value; |
||
205 | } |
||
206 | } |
||
207 | } |
||
208 | |||
209 | public bool IsSyncPDFMode { get; set; } |
||
210 | |||
211 | private System.Windows.Controls.Image _imageViewer_Compare { get; set; } |
||
212 | public System.Windows.Controls.Image imageViewer_Compare |
||
213 | { |
||
214 | get |
||
215 | { |
||
216 | if (_imageViewer_Compare == null) |
||
217 | { |
||
218 | _imageViewer_Compare = new System.Windows.Controls.Image(); |
||
219 | return _imageViewer_Compare; |
||
220 | } |
||
221 | else |
||
222 | { |
||
223 | return _imageViewer_Compare; |
||
224 | } |
||
225 | } |
||
226 | set |
||
227 | { |
||
228 | if (_imageViewer_Compare != value) |
||
229 | { |
||
230 | _imageViewer_Compare = value; |
||
231 | } |
||
232 | } |
||
233 | } |
||
234 | |||
235 | #endregion |
||
236 | 90e7968d | ljiyeon | |
237 | 787a4489 | KangIngu | public MainMenu() |
238 | { |
||
239 | e0cfc73c | ljiyeon | App.splashString(ISplashMessage.MAINMENU_0); |
240 | e0204db0 | djkim | //InitializeComponent(); |
241 | 90e7968d | ljiyeon | this.Loaded += MainMenu_Loaded; |
242 | 787a4489 | KangIngu | } |
243 | 6707a5c7 | ljiyeon | |
244 | public class TempDt |
||
245 | { |
||
246 | public int PageNumber { get; set; } |
||
247 | public string CommentID { get; set; } |
||
248 | public string ConvertData { get; set; } |
||
249 | public int DATA_TYPE { get; set; } |
||
250 | public string MarkupInfoID { get; set; } |
||
251 | public int IsUpdate { get; set; } |
||
252 | } |
||
253 | |||
254 | List<TempDt> tempDtList = new List<TempDt>(); |
||
255 | 90e7968d | ljiyeon | |
256 | 787a4489 | KangIngu | private void SetCursor() |
257 | { |
||
258 | this.Cursor = cursor; |
||
259 | } |
||
260 | |||
261 | private bool IsDrawingEnable(Point _canvasZoomPanningMouseDownPoint) |
||
262 | { |
||
263 | if ((_canvasZoomPanningMouseDownPoint.X > 0 && |
||
264 | ca40e004 | ljiyeon | zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.X) && |
265 | (_canvasZoomPanningMouseDownPoint.Y > 0 && |
||
266 | zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.Y)) |
||
267 | 787a4489 | KangIngu | { |
268 | return true; |
||
269 | } |
||
270 | |||
271 | return false; |
||
272 | } |
||
273 | |||
274 | ca40e004 | ljiyeon | private bool IsRotationDrawingEnable(Point _canvasZoomPanningMouseDownPoint) |
275 | { |
||
276 | if (rotate.Angle == 90 || rotate.Angle == 270) |
||
277 | { |
||
278 | if ((_canvasZoomPanningMouseDownPoint.X > 0 && |
||
279 | zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.X) && |
||
280 | (_canvasZoomPanningMouseDownPoint.Y > 0 && |
||
281 | zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.Y)) |
||
282 | { |
||
283 | return true; |
||
284 | } |
||
285 | } |
||
286 | else |
||
287 | { |
||
288 | if ((_canvasZoomPanningMouseDownPoint.X > 0 && |
||
289 | zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.X) && |
||
290 | (_canvasZoomPanningMouseDownPoint.Y > 0 && |
||
291 | zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.Y)) |
||
292 | { |
||
293 | return true; |
||
294 | } |
||
295 | 90e7968d | ljiyeon | } |
296 | ca40e004 | ljiyeon | |
297 | return false; |
||
298 | } |
||
299 | |||
300 | 90e7968d | ljiyeon | |
301 | 787a4489 | KangIngu | public void DeleteItem(MarkupInfoItem item) |
302 | { |
||
303 | if (PreviewUserMarkupInfoItem != null && item.Consolidate == 1 && item.AvoidConsolidate == 0) |
||
304 | { |
||
305 | App.Custom_ViewInfoId = PreviewUserMarkupInfoItem.MarkupInfoID; |
||
306 | } |
||
307 | |||
308 | ViewerDataModel.Instance._markupInfoList.Remove(item); |
||
309 | |||
310 | ViewerDataModel.Instance.MarkupControls.Where(data => data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(a => |
||
311 | { |
||
312 | ViewerDataModel.Instance.MarkupControls.Remove(a); |
||
313 | }); |
||
314 | |||
315 | ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(a => |
||
316 | { |
||
317 | ViewerDataModel.Instance.MarkupControls_USER.Remove(a); |
||
318 | }); |
||
319 | |||
320 | d62c0439 | humkyung | ViewerDataModel.Instance.MyMarkupList.Where(data => data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(a => |
321 | 787a4489 | KangIngu | { |
322 | ComingNewBieEnd = false; |
||
323 | d62c0439 | humkyung | ViewerDataModel.Instance.MyMarkupList.Remove(a); |
324 | 6707a5c7 | ljiyeon | //임시파일에서도 삭제 |
325 | a20d338f | ljiyeon | TempFile.DelTemp(a.ID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString()); |
326 | 787a4489 | KangIngu | }); |
327 | |||
328 | gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
||
329 | bb3a236d | ljiyeon | |
330 | 787a4489 | KangIngu | if (PreviewUserMarkupInfoItem == null && gridViewMarkup.SelectedItems.Where(d => (d as MarkupInfoItem).UserID == App.ViewInfo.UserID).FirstOrDefault() == null) |
331 | { |
||
332 | if (gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList().Where(d => d.UserID == App.ViewInfo.UserID).Count() == 0) |
||
333 | { |
||
334 | 24678e06 | humkyung | var infoId = Commons.shortGuid(); |
335 | 787a4489 | KangIngu | PreviewUserMarkupInfoItem = new MarkupInfoItem |
336 | { |
||
337 | CreateTime = DateTime.Now, |
||
338 | Depatment = userData.DEPARTMENT, |
||
339 | 992a98b4 | KangIngu | UpdateTime = DateTime.Now, |
340 | 787a4489 | KangIngu | DisplayColor = "#FFFF0000", |
341 | UserID = userData.ID, |
||
342 | UserName = userData.NAME, |
||
343 | PageCount = 1, |
||
344 | Description = "", |
||
345 | MarkupInfoID = infoId, |
||
346 | MarkupList = null, |
||
347 | 24678e06 | humkyung | MarkupVersionID = Commons.shortGuid(), |
348 | 787a4489 | KangIngu | Consolidate = 0, |
349 | PartConsolidate = 0, |
||
350 | userDelete = true, |
||
351 | AvoidConsolidate = 0, |
||
352 | IsPreviewUser = true |
||
353 | }; |
||
354 | App.Custom_ViewInfoId = infoId; |
||
355 | } |
||
356 | } |
||
357 | 0f065e57 | ljiyeon | Logger.sendReqLog("DeleteMarkupAsync", App.ViewInfo.ProjectNO + "," + item.MarkupInfoID, 1); |
358 | 787a4489 | KangIngu | BaseClient.DeleteMarkupAsync(App.ViewInfo.ProjectNO, item.MarkupInfoID); |
359 | } |
||
360 | |||
361 | 959b3ef2 | humkyung | /// <summary> |
362 | /// delete selected comments |
||
363 | /// </summary> |
||
364 | /// <param name="sender"></param> |
||
365 | /// <param name="e"></param> |
||
366 | 787a4489 | KangIngu | public void DeleteCommentEvent(object sender, RoutedEventArgs e) |
367 | { |
||
368 | //선택된 어도너가 있을시 삭제가 되지 않음(강인구 추가) |
||
369 | 077896be | humkyung | SelectionSet.Instance.UnSelect(this); |
370 | 787a4489 | KangIngu | |
371 | Button content = (sender as Button); |
||
372 | MarkupInfoItem item = content.CommandParameter as MarkupInfoItem; |
||
373 | |||
374 | DeleteItem(item); |
||
375 | } |
||
376 | |||
377 | System.Windows.Media.Animation.DoubleAnimation da = new System.Windows.Media.Animation.DoubleAnimation(); |
||
378 | |||
379 | 6707a5c7 | ljiyeon | private static Timer timer; |
380 | private int InitInterval = KCOM.Properties.Settings.Default.InitInterval; |
||
381 | 787a4489 | KangIngu | private void MainMenu_Loaded(object sender, RoutedEventArgs e) |
382 | 90e7968d | ljiyeon | { |
383 | 510cbd2a | ljiyeon | InitializeComponent(); |
384 | 0c997b99 | ljiyeon | |
385 | 90e7968d | ljiyeon | //System.Diagnostics.Debug.WriteLine("MainMenu() : " + sw.ElapsedMilliseconds.ToString() + "ms"); |
386 | |||
387 | 787a4489 | KangIngu | if (App.ParameterMode) |
388 | 6707a5c7 | ljiyeon | { |
389 | f7caaaaf | ljiyeon | App.splashString(ISplashMessage.MAINMENU_1); |
390 | 6707a5c7 | ljiyeon | this.pageNavigator.PageChanging += pageNavigator_PageChanging; |
391 | afaa7c92 | djkim | this.pageNavigator.PageChanged += PageNavigator_PageChanged; |
392 | 6707a5c7 | ljiyeon | imageViewer_Compare = new Image(); |
393 | ViewerDataModel.Instance.Capture_Opacity = 0; |
||
394 | da.From = 0.8; |
||
395 | da.To = 0; |
||
396 | da.Duration = new Duration(TimeSpan.FromSeconds(1)); |
||
397 | da.AutoReverse = true; |
||
398 | e0204db0 | djkim | da.RepeatBehavior = System.Windows.Media.Animation.RepeatBehavior.Forever; |
399 | |||
400 | if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission) |
||
401 | 90e7968d | ljiyeon | { |
402 | e0204db0 | djkim | this.SymbolPane.Visibility = Visibility.Collapsed; |
403 | this.FavoritePane.Visibility = Visibility.Collapsed; |
||
404 | this.drawingRotateCanvas.IsHitTestVisible = false; |
||
405 | 90e7968d | ljiyeon | } |
406 | 6707a5c7 | ljiyeon | } |
407 | 90e7968d | ljiyeon | timer = new Timer(timercallback, null, 0, InitInterval * 60000); |
408 | ccf944bb | ljiyeon | } |
409 | |||
410 | afaa7c92 | djkim | |
411 | |||
412 | 6707a5c7 | ljiyeon | private void timercallback(Object o) |
413 | ccf944bb | ljiyeon | { |
414 | 6707a5c7 | ljiyeon | Stopwatch sw = new Stopwatch(); |
415 | sw.Start(); |
||
416 | 3b484ebb | ljiyeon | TempFile.TempFileAdd(); |
417 | 6707a5c7 | ljiyeon | sw.Stop(); |
418 | ccf944bb | ljiyeon | |
419 | 90e7968d | ljiyeon | Dispatcher.InvokeAsync(new Action(delegate |
420 | ccf944bb | ljiyeon | { |
421 | 6707a5c7 | ljiyeon | if (this.ParentOfType<MainWindow>().dzTopMenu.cbAutoSave.IsChecked == true) //Auto Save Checked? |
422 | { |
||
423 | timer.Change(((int)this.ParentOfType<MainWindow>().dzTopMenu.cbSaveInterval.Value * 60000) / 2, sw.ElapsedMilliseconds); //Timer Setting |
||
424 | } |
||
425 | })); |
||
426 | ccf944bb | ljiyeon | |
427 | 90e7968d | ljiyeon | ////GC.Collect(); |
428 | 6707a5c7 | ljiyeon | } |
429 | 077896be | humkyung | |
430 | d62c0439 | humkyung | /// <summary> |
431 | /// update my markuplist |
||
432 | /// - update existing markup data if already exist |
||
433 | /// - add new markup data if control is new |
||
434 | /// </summary> |
||
435 | public void UpdateMyMarkupList() |
||
436 | 787a4489 | KangIngu | { |
437 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_ChangeCommentReact", 1); |
438 | 787a4489 | KangIngu | bool isComingNewBie = false; |
439 | |||
440 | d62c0439 | humkyung | /// add or update markup list |
441 | foreach (var control in ViewerDataModel.Instance.MarkupControls_USER) |
||
442 | 787a4489 | KangIngu | { |
443 | d62c0439 | humkyung | var root = MarkupParser.MarkupToString(control, App.ViewInfo.UserID); |
444 | 90e7968d | ljiyeon | |
445 | d62c0439 | humkyung | var exist = ViewerDataModel.Instance.MyMarkupList.Where(data => data.ID == root.CommentID).FirstOrDefault(); |
446 | if (exist != null) //신규 추가 된 코멘트 |
||
447 | { |
||
448 | if (exist.Data != root.ConvertData) //코멘트가 같은지 |
||
449 | 6707a5c7 | ljiyeon | { |
450 | d62c0439 | humkyung | exist.Data = root.ConvertData; |
451 | exist.IsUpdate = true; |
||
452 | ComingNewBieEnd = false; |
||
453 | 6707a5c7 | ljiyeon | } |
454 | d62c0439 | humkyung | } |
455 | else if (root.CommentID != null) |
||
456 | { |
||
457 | isComingNewBie = true; |
||
458 | ViewerDataModel.Instance.MyMarkupList.Add(new MarkupItemEx |
||
459 | 6707a5c7 | ljiyeon | { |
460 | d62c0439 | humkyung | ID = control.CommentID, |
461 | Data = root.ConvertData, |
||
462 | Data_Type = root.DATA_TYPE, |
||
463 | MarkupInfoID = App.Custom_ViewInfoId, |
||
464 | PageNumber = this.pageNavigator.CurrentPage.PageNumber, |
||
465 | Symbol_ID = control.SymbolID, |
||
466 | c0977e97 | djkim | //Group_ID = control.GroupID, |
467 | d62c0439 | humkyung | }); |
468 | ComingNewBieEnd = false; |
||
469 | 787a4489 | KangIngu | } |
470 | } |
||
471 | |||
472 | d62c0439 | humkyung | /// delete markup list |
473 | int iPageNo = Convert.ToInt32(this.ParentOfType<MainWindow>().dzTopMenu.tlcurrentPage.Text); |
||
474 | var deleted = (from markup in ViewerDataModel.Instance.MyMarkupList |
||
475 | where (markup.PageNumber == iPageNo) && (null == ViewerDataModel.Instance.MarkupControls_USER.Where(control => control.CommentID == markup.ID).FirstOrDefault()) |
||
476 | select markup).ToList(); |
||
477 | foreach(var markup in deleted) ViewerDataModel.Instance.MyMarkupList.Remove(markup); |
||
478 | /// up to here |
||
479 | 6707a5c7 | ljiyeon | |
480 | 787a4489 | KangIngu | if (PreviewUserMarkupInfoItem != null && isComingNewBie && !ComingNewBieEnd) |
481 | { |
||
482 | if (ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == PreviewUserMarkupInfoItem.UserID).FirstOrDefault() == null) |
||
483 | { |
||
484 | ComingNewBieEnd = true; |
||
485 | ViewerDataModel.Instance._markupInfoList.Insert(0, PreviewUserMarkupInfoItem); |
||
486 | PreviewUserMarkupInfoItem.IsPreviewUser = false; |
||
487 | gridViewMarkup.ItemsSource = null; |
||
488 | gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
||
489 | gridViewMarkup.SelectedItem = PreviewUserMarkupInfoItem; |
||
490 | fddb48f7 | ljiyeon | |
491 | GroupDescriptor descriptor = new GroupDescriptor(); |
||
492 | descriptor.Member = "Depatment"; |
||
493 | descriptor.DisplayContent = "DEPT"; |
||
494 | descriptor.SortDirection = ListSortDirection.Ascending; |
||
495 | gridViewMarkup.GroupDescriptors.Add(descriptor); |
||
496 | 787a4489 | KangIngu | } |
497 | } |
||
498 | } |
||
499 | |||
500 | bool ComingNewBieEnd = false; |
||
501 | |||
502 | afaa7c92 | djkim | private void PageNavigator_PageChanged(object sender, Sample.PageChangeEventArgs e) |
503 | { |
||
504 | if (zoomAndPanCanvas2.Width.IsNaN()) |
||
505 | { |
||
506 | zoomAndPanControl.ZoomTo(new Rect { X = 0, Y = 0, Width = zoomAndPanCanvas.Width, Height = zoomAndPanCanvas.Height }); |
||
507 | } |
||
508 | |||
509 | Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
||
510 | Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
||
511 | |||
512 | List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
||
513 | foreach (var info in gridSelectionItem) |
||
514 | { |
||
515 | Logger.sendCheckLog(String.Format("==>{0}", info), 1); |
||
516 | } |
||
517 | /// fire selection event |
||
518 | this.gridViewMarkup.UnselectAll(); |
||
519 | this.gridViewMarkup.Select(gridSelectionItem); |
||
520 | |||
521 | if (!testPanel2.IsHidden) |
||
522 | { |
||
523 | ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX; |
||
524 | ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY; |
||
525 | ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale; |
||
526 | |||
527 | Common.ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
||
528 | List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); |
||
529 | |||
530 | |||
531 | foreach (var item in gridSelectionRevItem) |
||
532 | { |
||
533 | item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
||
534 | { |
||
535 | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
||
536 | }); |
||
537 | } |
||
538 | } |
||
539 | |||
540 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
541 | instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
||
542 | instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
||
543 | |||
544 | instanceMain.dzTopMenu.rotateOffSet = 0; |
||
545 | var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER).FirstOrDefault(); |
||
546 | drawingPannelRotate(pageinfo.PAGE_ANGLE); |
||
547 | |||
548 | 944be2fa | djkim | SetCommentPages(true); |
549 | afaa7c92 | djkim | } |
550 | cb5c7f06 | humkyung | |
551 | /// <summary> |
||
552 | /// start page changing |
||
553 | /// - save controls if page is modified |
||
554 | /// - starting download page image |
||
555 | /// </summary> |
||
556 | /// <param name="sender"></param> |
||
557 | /// <param name="e"></param> |
||
558 | 787a4489 | KangIngu | private void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e) |
559 | 548c696e | ljiyeon | { |
560 | cb5c7f06 | humkyung | this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); |
561 | 548c696e | ljiyeon | |
562 | 787a4489 | KangIngu | CompareMode.IsChecked = false; |
563 | var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? e.PageNumber + ViewerDataModel.Instance.PageBalanceNumber : e.PageNumber; |
||
564 | |||
565 | #region 페이지가 벗어난 경우 |
||
566 | |||
567 | if (BalancePoint < 1) |
||
568 | { |
||
569 | BalancePoint = 1; |
||
570 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
571 | } |
||
572 | |||
573 | if (pageNavigator.PageCount < BalancePoint) |
||
574 | { |
||
575 | BalancePoint = pageNavigator.PageCount; |
||
576 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
577 | } |
||
578 | |||
579 | #endregion |
||
580 | |||
581 | ViewerDataModel.Instance.PageNumber = BalancePoint; |
||
582 | |||
583 | a874198d | humkyung | string uri = ""; |
584 | a1716fa5 | KangIngu | if (userData.COMPANY != "EXT") |
585 | a874198d | humkyung | { |
586 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, e.PageNumber); |
587 | a874198d | humkyung | } |
588 | else |
||
589 | { |
||
590 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, e.PageNumber); |
591 | a874198d | humkyung | } |
592 | 548c696e | ljiyeon | |
593 | 8a9f6742 | djkim | var defaultBitmapImage = new BitmapImage(); |
594 | defaultBitmapImage.BeginInit(); |
||
595 | d064038c | djkim | defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache; |
596 | 8a9f6742 | djkim | defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad; |
597 | defaultBitmapImage.UriSource = new Uri(uri); |
||
598 | bb4e3ec4 | djkim | defaultBitmapImage.DecodePixelWidth = Int32.Parse(e.CurrentPage.PAGE_WIDTH); |
599 | defaultBitmapImage.DecodePixelHeight = Int32.Parse(e.CurrentPage.PAGE_HEIGHT); |
||
600 | 8a9f6742 | djkim | defaultBitmapImage.EndInit(); |
601 | |||
602 | e0cfc73c | ljiyeon | ViewerDataModel.Instance.ImageViewPath = null; |
603 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_BitmapImage Downloading", 1); |
604 | 787a4489 | KangIngu | if (defaultBitmapImage.IsDownloading) |
605 | { |
||
606 | 122914ba | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_BitmapImage IsDownloading", 1); |
607 | 787a4489 | KangIngu | defaultBitmapImage.DownloadCompleted += (ex, arg) => |
608 | e0cfc73c | ljiyeon | { |
609 | bb4e3ec4 | djkim | defaultBitmapImage.Freeze(); |
610 | 787a4489 | KangIngu | ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage; |
611 | ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth; |
||
612 | ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight; |
||
613 | bb4e3ec4 | djkim | mainPanel.UpdateLayout(); |
614 | 944be2fa | djkim | this.pageNavigator.ChangePage(e.PageNumber); |
615 | bb4e3ec4 | djkim | |
616 | //image dispose |
||
617 | defaultBitmapImage = null; |
||
618 | GC.Collect(); |
||
619 | 787a4489 | KangIngu | }; |
620 | } |
||
621 | |||
622 | zoomAndPanCanvas.Width = Convert.ToDouble(e.CurrentPage.PAGE_WIDTH); |
||
623 | zoomAndPanCanvas.Height = Convert.ToDouble(e.CurrentPage.PAGE_HEIGHT); |
||
624 | |||
625 | |||
626 | Common.ViewerDataModel.Instance.ContentWidth = zoomAndPanCanvas.Width; |
||
627 | Common.ViewerDataModel.Instance.ContentHeight = zoomAndPanCanvas.Height; |
||
628 | inkBoard.Width = zoomAndPanCanvas.Width; |
||
629 | inkBoard.Height = zoomAndPanCanvas.Height; |
||
630 | |||
631 | 90e7968d | ljiyeon | |
632 | 787a4489 | KangIngu | if (!testPanel2.IsHidden) |
633 | { |
||
634 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_!testPanel2.IsHidden 일 때", 1); |
635 | 787a4489 | KangIngu | //PDF모드일때 잠시 대기(강인구) |
636 | if (IsSyncPDFMode) |
||
637 | { |
||
638 | Get_FinalImage.Get_PdfImage get_PdfImage = new Get_FinalImage.Get_PdfImage(); |
||
639 | var pdfpath = new BitmapImage(new Uri(get_PdfImage.Run(CurrentRev.TO_VENDOR, App.ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber))); |
||
640 | |||
641 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_pdfpath Image Downloading", 1); |
642 | 787a4489 | KangIngu | if (pdfpath.IsDownloading) |
643 | { |
||
644 | pdfpath.DownloadCompleted += (ex, arg) => |
||
645 | { |
||
646 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_pdfpath Image DownloadCompleted", 1); |
647 | 787a4489 | KangIngu | ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
648 | ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
||
649 | ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
||
650 | zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
||
651 | zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
||
652 | }; |
||
653 | } |
||
654 | else |
||
655 | { |
||
656 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_pdfpath Image Page Setting", 1); |
657 | 787a4489 | KangIngu | ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
658 | ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
||
659 | ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
||
660 | |||
661 | zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
||
662 | zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
||
663 | } |
||
664 | } |
||
665 | else |
||
666 | { |
||
667 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_uri2 값 설정", 1); |
668 | a874198d | humkyung | string uri2 = ""; |
669 | a1716fa5 | KangIngu | if (userData.COMPANY != "EXT") |
670 | a874198d | humkyung | { |
671 | 84c48033 | djkim | uri2 = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, BalancePoint); |
672 | a874198d | humkyung | } |
673 | else |
||
674 | { |
||
675 | 84c48033 | djkim | uri2 = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, BalancePoint); |
676 | a874198d | humkyung | } |
677 | a1716fa5 | KangIngu | |
678 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_defaultBitmapImage_Compare BitmapImage 설정", 1); |
679 | 787a4489 | KangIngu | var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri2)); |
680 | bb4e3ec4 | djkim | defaultBitmapImage_Compare.BeginInit(); |
681 | defaultBitmapImage_Compare.CacheOption = BitmapCacheOption.OnLoad; |
||
682 | defaultBitmapImage_Compare.UriSource = new Uri(uri2); |
||
683 | defaultBitmapImage_Compare.DecodePixelWidth = Int32.Parse(e.CurrentPage.PAGE_WIDTH); |
||
684 | defaultBitmapImage_Compare.DecodePixelHeight = Int32.Parse(e.CurrentPage.PAGE_HEIGHT); |
||
685 | defaultBitmapImage_Compare.EndInit(); |
||
686 | 787a4489 | KangIngu | |
687 | bb4e3ec4 | djkim | ViewerDataModel.Instance.ImageViewPath_C = null; |
688 | 787a4489 | KangIngu | |
689 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_zoomAndPanControl ZoomTo 설정", 1); |
690 | 787a4489 | KangIngu | zoomAndPanControl.ZoomTo(new Rect |
691 | { |
||
692 | X = 0, |
||
693 | Y = 0, |
||
694 | Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width), |
||
695 | Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height), |
||
696 | }); |
||
697 | |||
698 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_defaultBitmapImage_Compare Downloading", 1); |
699 | 787a4489 | KangIngu | if (defaultBitmapImage_Compare.IsDownloading) |
700 | { |
||
701 | defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) => |
||
702 | { |
||
703 | bb4e3ec4 | djkim | defaultBitmapImage_Compare.Freeze(); |
704 | 787a4489 | KangIngu | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
705 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
706 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
707 | zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth; |
||
708 | zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight; |
||
709 | |||
710 | zoomAndPanControl.ZoomTo(new Rect |
||
711 | { |
||
712 | X = 0, |
||
713 | Y = 0, |
||
714 | Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width), |
||
715 | Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height), |
||
716 | }); |
||
717 | bb4e3ec4 | djkim | |
718 | //defaultBitmapImage_Compare dispose |
||
719 | defaultBitmapImage_Compare = null; |
||
720 | GC.Collect(); |
||
721 | 787a4489 | KangIngu | }; |
722 | } |
||
723 | } |
||
724 | tlSyncPageNum.Text = String.Format("Current Page : {0}", BalancePoint); |
||
725 | } |
||
726 | |||
727 | } |
||
728 | 90e7968d | ljiyeon | |
729 | 787a4489 | KangIngu | private void SetCommentPages(bool onlyMe = false) |
730 | { |
||
731 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_SetCommentPages Setting", 1); |
732 | 787a4489 | KangIngu | List<UsersCommentPagesMember> _pages = new List<UsersCommentPagesMember>(); |
733 | foreach (var item in ViewerDataModel.Instance._markupInfoList) |
||
734 | { |
||
735 | UsersCommentPagesMember instance = new UsersCommentPagesMember(); |
||
736 | instance.UserName = item.UserName; |
||
737 | instance.Depart = item.Depatment; |
||
738 | instance.MarkupInfoID = item.MarkupInfoID; |
||
739 | instance.IsSelected = true; |
||
740 | instance.isConSolidation = item.Consolidate; |
||
741 | instance.SetColor = item.DisplayColor; |
||
742 | if (item.UserID == App.ViewInfo.UserID && item.MarkupInfoID == item.MarkupInfoID) |
||
743 | { |
||
744 | d62c0439 | humkyung | instance.PageNumber = ViewerDataModel.Instance.MyMarkupList.Select(d => d.PageNumber).ToList(); |
745 | 787a4489 | KangIngu | } |
746 | else |
||
747 | { |
||
748 | instance.PageNumber = ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.MarkupInfoID == item.MarkupInfoID).Select(d => d.PageNumber).ToList(); |
||
749 | } |
||
750 | _pages.Add(instance); |
||
751 | } |
||
752 | this.pageNavigator.SetCommentList(_pages.ToList()); |
||
753 | } |
||
754 | |||
755 | private void zoomAndPanControl_MouseWheel(object sender, MouseWheelEventArgs e) |
||
756 | { |
||
757 | if (e.MiddleButton == MouseButtonState.Pressed) |
||
758 | { |
||
759 | |||
760 | } |
||
761 | e.Handled = true; |
||
762 | if (e.Delta > 0) |
||
763 | { |
||
764 | Point currentContentMousePoint = e.GetPosition(zoomAndPanCanvas); |
||
765 | ZoomIn(currentContentMousePoint); |
||
766 | } |
||
767 | else |
||
768 | { |
||
769 | Point currentContentMousePoint = e.GetPosition(zoomAndPanCanvas); |
||
770 | ZoomOut(currentContentMousePoint); |
||
771 | } |
||
772 | } |
||
773 | |||
774 | a1716fa5 | KangIngu | private void zoomAndPanControl2_MouseWheel(object sender, MouseWheelEventArgs e) |
775 | { |
||
776 | e.Handled = true; |
||
777 | if (e.Delta > 0) |
||
778 | { |
||
779 | Point currentContentMousePoint = e.GetPosition(zoomAndPanCanvas2); |
||
780 | ZoomIn_Sync(currentContentMousePoint); |
||
781 | } |
||
782 | else |
||
783 | { |
||
784 | Point currentContentMousePoint = e.GetPosition(zoomAndPanCanvas2); |
||
785 | ZoomOut_Sync(currentContentMousePoint); |
||
786 | } |
||
787 | } |
||
788 | |||
789 | 787a4489 | KangIngu | #region ZoomIn & ZoomOut |
790 | |||
791 | private void ZoomOut_Executed(object sender, ExecutedRoutedEventArgs e) |
||
792 | { |
||
793 | ZoomOut(new Point(zoomAndPanControl.ContentZoomFocusX, |
||
794 | zoomAndPanControl.ContentZoomFocusY)); |
||
795 | } |
||
796 | |||
797 | private void ZoomIn_Executed(object sender, ExecutedRoutedEventArgs e) |
||
798 | { |
||
799 | ZoomIn(new Point(zoomAndPanControl.ContentZoomFocusX, |
||
800 | zoomAndPanControl.ContentZoomFocusY)); |
||
801 | } |
||
802 | |||
803 | |||
804 | //강인구 추가 (줌 인아웃 수치 변경) |
||
805 | //큰해상도의 문서일 경우 줌 인 아웃시 사이즈 변동이 큼 |
||
806 | private void ZoomOut(Point contentZoomCenter) |
||
807 | { |
||
808 | if (zoomAndPanControl.ContentScale > 0.39) |
||
809 | { |
||
810 | zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl.ContentScale - 0.2, contentZoomCenter); |
||
811 | } |
||
812 | else |
||
813 | { |
||
814 | zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl.ContentScale / 2, contentZoomCenter); |
||
815 | } |
||
816 | |||
817 | 9cd2865b | KangIngu | if (zoomAndPanControl2 != null && Sync.IsChecked) |
818 | 787a4489 | KangIngu | { |
819 | 9cd2865b | KangIngu | zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl.ContentScale, contentZoomCenter); |
820 | 787a4489 | KangIngu | } |
821 | } |
||
822 | |||
823 | private void ZoomIn(Point contentZoomCenter) |
||
824 | { |
||
825 | if (zoomAndPanControl.ContentScale > 0.19) |
||
826 | { |
||
827 | zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl.ContentScale + 0.2, contentZoomCenter); |
||
828 | } |
||
829 | else |
||
830 | { |
||
831 | zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl.ContentScale * 2, contentZoomCenter); |
||
832 | } |
||
833 | |||
834 | 9cd2865b | KangIngu | if (zoomAndPanControl2 != null && Sync.IsChecked) |
835 | 787a4489 | KangIngu | { |
836 | 9cd2865b | KangIngu | zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl.ContentScale, contentZoomCenter); |
837 | 787a4489 | KangIngu | } |
838 | a1716fa5 | KangIngu | |
839 | } |
||
840 | |||
841 | private void ZoomOut_Sync(Point contentZoomCenter) |
||
842 | { |
||
843 | if (zoomAndPanControl2.ContentScale > 0.39) |
||
844 | { |
||
845 | zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale - 0.2, contentZoomCenter); |
||
846 | } |
||
847 | else |
||
848 | { |
||
849 | zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale / 2, contentZoomCenter); |
||
850 | } |
||
851 | |||
852 | if (Sync.IsChecked) |
||
853 | { |
||
854 | zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl2.ContentScale, contentZoomCenter); |
||
855 | } |
||
856 | } |
||
857 | |||
858 | private void ZoomIn_Sync(Point contentZoomCenter) |
||
859 | { |
||
860 | if (zoomAndPanControl2.ContentScale > 0.19) |
||
861 | { |
||
862 | zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale + 0.2, contentZoomCenter); |
||
863 | } |
||
864 | else |
||
865 | { |
||
866 | zoomAndPanControl2.ZoomAboutPoint(zoomAndPanControl2.ContentScale * 2, contentZoomCenter); |
||
867 | } |
||
868 | |||
869 | if (Sync.IsChecked) |
||
870 | { |
||
871 | zoomAndPanControl.ZoomAboutPoint(zoomAndPanControl2.ContentScale, contentZoomCenter); |
||
872 | } |
||
873 | 787a4489 | KangIngu | } |
874 | |||
875 | private void ZoomOut() |
||
876 | { |
||
877 | zoomAndPanControl.ContentScale -= 0.1; |
||
878 | //if (zoomAndPanControl2 != null) |
||
879 | //{ |
||
880 | // zoomAndPanControl2.ContentScale -= 0.1; |
||
881 | //} |
||
882 | } |
||
883 | |||
884 | private void ZoomIn() |
||
885 | { |
||
886 | zoomAndPanControl.ContentScale += 0.1; |
||
887 | //if (zoomAndPanControl2 != null) |
||
888 | //{ |
||
889 | // zoomAndPanControl2.ContentScale += 0.1; |
||
890 | //} |
||
891 | } |
||
892 | |||
893 | #endregion |
||
894 | |||
895 | private void init() |
||
896 | { |
||
897 | foreach (var item in ViewerDataModel.Instance.MarkupControls) |
||
898 | { |
||
899 | |||
900 | ControlList.Clear(); |
||
901 | listBox.Items.Clear(); |
||
902 | selected_item.Clear(); |
||
903 | |||
904 | (item as IMarkupCommonData).IsSelected = false; |
||
905 | } |
||
906 | |||
907 | } |
||
908 | |||
909 | private HitTestResultBehavior MyCallback(HitTestResult result) |
||
910 | { |
||
911 | //this.cursor = Cursors.UpArrow; |
||
912 | var element = result.VisualHit; |
||
913 | while (element != null && !(element is CommentUserInfo)) |
||
914 | element = VisualTreeHelper.GetParent(element); |
||
915 | |||
916 | if (element == null) |
||
917 | { |
||
918 | return HitTestResultBehavior.Stop; |
||
919 | } |
||
920 | else |
||
921 | { |
||
922 | if (element is CommentUserInfo) |
||
923 | { |
||
924 | if (!hitList.Contains(element)) |
||
925 | { |
||
926 | hitList.Add((CommentUserInfo)element); |
||
927 | } |
||
928 | else |
||
929 | { |
||
930 | return HitTestResultBehavior.Stop; |
||
931 | } |
||
932 | } |
||
933 | } |
||
934 | return HitTestResultBehavior.Continue; |
||
935 | } |
||
936 | |||
937 | public void ReleaseSelectPath() |
||
938 | { |
||
939 | if (SelectionPath == null) |
||
940 | { |
||
941 | SelectionPath = new Path(); |
||
942 | SelectionPath.Name = ""; |
||
943 | } |
||
944 | if (SelectionPath.Name != "") |
||
945 | { |
||
946 | SelectionPath.Name = "None"; |
||
947 | } |
||
948 | SelectionPath.Opacity = 0.01; |
||
949 | SelectionPath.RenderTransform = null; |
||
950 | SelectionPath.RenderTransformOrigin = new Point(0, 0); |
||
951 | } |
||
952 | |||
953 | #region 컨트롤 초기화 |
||
954 | public void Control_Init(object control) |
||
955 | { |
||
956 | if (L_Size != 0 && (control as IPath) != null) |
||
957 | { |
||
958 | (control as IPath).LineSize = L_Size; |
||
959 | L_Size = 0; |
||
960 | } |
||
961 | |||
962 | switch (control.GetType().Name) |
||
963 | { |
||
964 | case "RectangleControl": |
||
965 | { |
||
966 | (control as RectangleControl).StrokeColor = Brushes.Red; |
||
967 | } |
||
968 | break; |
||
969 | case "CircleControl": |
||
970 | { |
||
971 | (control as CircleControl).StrokeColor = Brushes.Red; |
||
972 | } |
||
973 | break; |
||
974 | case "TriControl": |
||
975 | { |
||
976 | (control as TriControl).StrokeColor = Brushes.Red; |
||
977 | } |
||
978 | break; |
||
979 | case "RectCloudControl": |
||
980 | { |
||
981 | (control as RectCloudControl).StrokeColor = Brushes.Red; |
||
982 | } |
||
983 | break; |
||
984 | case "CloudControl": |
||
985 | { |
||
986 | (control as CloudControl).StrokeColor = Brushes.Red; |
||
987 | } |
||
988 | break; |
||
989 | case "PolygonControl": |
||
990 | { |
||
991 | (control as PolygonControl).StrokeColor = Brushes.Red; |
||
992 | } |
||
993 | break; |
||
994 | case "ArcControl": |
||
995 | { |
||
996 | (control as ArcControl).StrokeColor = Brushes.Red; |
||
997 | } |
||
998 | break; |
||
999 | 40b3ce25 | ljiyeon | case "ArrowArcControl": |
1000 | { |
||
1001 | (control as ArrowArcControl).StrokeColor = Brushes.Red; |
||
1002 | } |
||
1003 | break; |
||
1004 | 787a4489 | KangIngu | case "LineControl": |
1005 | { |
||
1006 | (control as LineControl).StrokeColor = Brushes.Red; |
||
1007 | } |
||
1008 | break; |
||
1009 | case "ArrowControl_Multi": |
||
1010 | { |
||
1011 | (control as ArrowControl_Multi).StrokeColor = Brushes.Red; |
||
1012 | } |
||
1013 | break; |
||
1014 | case "TextControl": |
||
1015 | { |
||
1016 | (control as TextControl).BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
||
1017 | } |
||
1018 | break; |
||
1019 | case "ArrowTextControl": |
||
1020 | { |
||
1021 | (control as ArrowTextControl).BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
||
1022 | } |
||
1023 | break; |
||
1024 | 684ef11c | ljiyeon | case "InsideWhiteControl": |
1025 | { |
||
1026 | (control as InsideWhiteControl).StrokeColor = Brushes.White; |
||
1027 | } |
||
1028 | break; |
||
1029 | case "OverlapWhiteControl": |
||
1030 | { |
||
1031 | (control as OverlapWhiteControl).StrokeColor = Brushes.White; |
||
1032 | } |
||
1033 | break; |
||
1034 | case "ClipWhiteControl": |
||
1035 | { |
||
1036 | (control as ClipWhiteControl).StrokeColor = Brushes.White; |
||
1037 | } |
||
1038 | break; |
||
1039 | case "CoordinateControl": |
||
1040 | { |
||
1041 | (control as CoordinateControl).StrokeColor = Brushes.Black; |
||
1042 | } |
||
1043 | break; |
||
1044 | 787a4489 | KangIngu | } |
1045 | } |
||
1046 | #endregion |
||
1047 | |||
1048 | public void firstCondition_MouseLeave(object sender, MouseEventArgs e) |
||
1049 | { |
||
1050 | //Control_Init(e.Source); |
||
1051 | } |
||
1052 | 7211e0c2 | ljiyeon | //private Window _dragdropWindow = null; |
1053 | 53880c83 | ljiyeon | |
1054 | [DllImport("user32.dll")] |
||
1055 | [return: MarshalAs(UnmanagedType.Bool)] |
||
1056 | internal static extern bool GetCursorPos(ref Win32Point pt); |
||
1057 | |||
1058 | [StructLayout(LayoutKind.Sequential)] |
||
1059 | internal struct Win32Point |
||
1060 | { |
||
1061 | public Int32 X; |
||
1062 | public Int32 Y; |
||
1063 | }; |
||
1064 | 7211e0c2 | ljiyeon | /* |
1065 | public string symbol_id = null; |
||
1066 | public long symbol_group_id; |
||
1067 | public int symbol_SelectedIndex; |
||
1068 | public ImageSource symbol_img; |
||
1069 | public string symbol_Data = null; |
||
1070 | public void symboldata(string id, long group_id, int SelectedIndex, string Data_, ImageSource img) |
||
1071 | { |
||
1072 | PlaceImageSymbol(symbol_id, symbol_group_id, symbol_SelectedIndex, new Point(zoomAndPanCanvas.ActualWidth / 2, |
||
1073 | zoomAndPanCanvas.ActualHeight / 2)); |
||
1074 | |||
1075 | |||
1076 | if (this._dragdropWindow != null) |
||
1077 | { |
||
1078 | this._dragdropWindow.Close(); |
||
1079 | this._dragdropWindow = null; |
||
1080 | } |
||
1081 | |||
1082 | symbol_id = id; |
||
1083 | symbol_group_id = group_id; |
||
1084 | symbol_SelectedIndex = SelectedIndex; |
||
1085 | symbol_Data = Data_; |
||
1086 | symbol_img = img; |
||
1087 | |||
1088 | |||
1089 | CreateDragDropWindow2(img); |
||
1090 | |||
1091 | } |
||
1092 | 53880c83 | ljiyeon | |
1093 | 7211e0c2 | ljiyeon | private void CreateDragDropWindow2(ImageSource image) |
1094 | 53880c83 | ljiyeon | { |
1095 | this._dragdropWindow = new Window(); |
||
1096 | _dragdropWindow.Cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
||
1097 | _dragdropWindow.WindowStyle = WindowStyle.None; |
||
1098 | _dragdropWindow.AllowsTransparency = true; |
||
1099 | _dragdropWindow.AllowDrop = false; |
||
1100 | _dragdropWindow.Background = null; |
||
1101 | _dragdropWindow.IsHitTestVisible = false; |
||
1102 | _dragdropWindow.SizeToContent = SizeToContent.WidthAndHeight; |
||
1103 | _dragdropWindow.Topmost = true; |
||
1104 | _dragdropWindow.ShowInTaskbar = false; |
||
1105 | |||
1106 | Rectangle r = new Rectangle(); |
||
1107 | r.Width = image.Width; |
||
1108 | r.Height = image.Height; |
||
1109 | r.Opacity = 0.5; |
||
1110 | r.Fill = new ImageBrush(image); |
||
1111 | this._dragdropWindow.Content = r; |
||
1112 | |||
1113 | Win32Point w32Mouse = new Win32Point(); |
||
1114 | GetCursorPos(ref w32Mouse); |
||
1115 | |||
1116 | //w32Mouse.X = getCurrentPoint.X; |
||
1117 | this._dragdropWindow.Left = w32Mouse.X - (image.Width / 2); |
||
1118 | this._dragdropWindow.Top = w32Mouse.Y - (image.Height / 2); |
||
1119 | this._dragdropWindow.Show(); |
||
1120 | } |
||
1121 | 7211e0c2 | ljiyeon | */ |
1122 | 787a4489 | KangIngu | private void zoomAndPanControl_MouseMove(object sender, MouseEventArgs e) |
1123 | { |
||
1124 | if (Common.ViewerDataModel.Instance.SelectedControl == "Batch") |
||
1125 | { |
||
1126 | if (!floatingTip.IsOpen) { floatingTip.IsOpen = true; } |
||
1127 | |||
1128 | Point currentPos = e.GetPosition(rect); |
||
1129 | d71ee575 | djkim | |
1130 | 787a4489 | KangIngu | floatingTip.HorizontalOffset = currentPos.X + 20; |
1131 | floatingTip.VerticalOffset = currentPos.Y; |
||
1132 | } |
||
1133 | |||
1134 | getCurrentPoint = e.GetPosition(drawingRotateCanvas); |
||
1135 | a36a37c3 | humkyung | |
1136 | e6a9ddaf | humkyung | if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed)) |
1137 | 787a4489 | KangIngu | { |
1138 | e54660e8 | KangIngu | SetCursor(); |
1139 | 787a4489 | KangIngu | Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas); |
1140 | Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas); |
||
1141 | |||
1142 | Vector dragOffset = currentCanvasZoomPanningMouseMovePoint - canvasZoommovingMouseDownPoint; |
||
1143 | zoomAndPanControl.ContentOffsetX -= dragOffset.X; |
||
1144 | zoomAndPanControl.ContentOffsetY -= dragOffset.Y; |
||
1145 | 9cd2865b | KangIngu | |
1146 | a1716fa5 | KangIngu | if (Sync.IsChecked) |
1147 | 9cd2865b | KangIngu | { |
1148 | ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX; |
||
1149 | ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY; |
||
1150 | } |
||
1151 | 787a4489 | KangIngu | } |
1152 | 992a98b4 | KangIngu | |
1153 | e6a9ddaf | humkyung | if (mouseHandlingMode == MouseHandlingMode.Drawing && currentControl != null) |
1154 | 787a4489 | KangIngu | { |
1155 | Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas); |
||
1156 | Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas); |
||
1157 | SetCursor(); |
||
1158 | |||
1159 | if (currentControl != null) |
||
1160 | { |
||
1161 | double moveX = currentCanvasDrawingMouseMovePoint.X - canvasDrawingMouseDownPoint.X; |
||
1162 | double moveY = currentCanvasDrawingMouseMovePoint.Y - canvasDrawingMouseDownPoint.Y; |
||
1163 | //강인구 추가 |
||
1164 | currentControl.Opacity = ViewerDataModel.Instance.ControlOpacity; |
||
1165 | |||
1166 | if ((currentControl as IPath) != null) |
||
1167 | { |
||
1168 | (currentControl as IPath).LineSize = ViewerDataModel.Instance.LineSize; |
||
1169 | } |
||
1170 | 5ce56a3a | KangIngu | if ((currentControl as LineControl) != null) |
1171 | { |
||
1172 | (currentControl as LineControl).Interval = ViewerDataModel.Instance.Interval; |
||
1173 | } |
||
1174 | |||
1175 | 787a4489 | KangIngu | if ((currentControl as IShapeControl) != null) |
1176 | { |
||
1177 | (currentControl as IShapeControl).Paint = ViewerDataModel.Instance.paintSet; |
||
1178 | } |
||
1179 | if ((currentControl as TextControl) != null) |
||
1180 | { |
||
1181 | if (this.ParentOfType<MainWindow>().dzTopMenu.btnItalic.IsChecked == true) |
||
1182 | { |
||
1183 | (currentControl as TextControl).TextStyle = FontStyles.Italic; |
||
1184 | } |
||
1185 | if (this.ParentOfType<MainWindow>().dzTopMenu.btnBold.IsChecked == true) |
||
1186 | { |
||
1187 | d4b0c723 | KangIngu | (currentControl as TextControl).TextWeight = FontWeights.Bold; |
1188 | 787a4489 | KangIngu | } |
1189 | if (this.ParentOfType<MainWindow>().dzTopMenu.btnUnderLine.IsChecked == true) |
||
1190 | { |
||
1191 | (currentControl as TextControl).UnderLine = TextDecorations.Underline; |
||
1192 | } |
||
1193 | } |
||
1194 | else if ((currentControl as ArrowTextControl) != null) |
||
1195 | { |
||
1196 | if (this.ParentOfType<MainWindow>().dzTopMenu.btnItalic.IsChecked == true) |
||
1197 | { |
||
1198 | (currentControl as ArrowTextControl).TextStyle = FontStyles.Italic; |
||
1199 | } |
||
1200 | if (this.ParentOfType<MainWindow>().dzTopMenu.btnBold.IsChecked == true) |
||
1201 | { |
||
1202 | d4b0c723 | KangIngu | (currentControl as ArrowTextControl).TextWeight = FontWeights.Bold; |
1203 | 787a4489 | KangIngu | } |
1204 | if (this.ParentOfType<MainWindow>().dzTopMenu.btnUnderLine.IsChecked == true) |
||
1205 | { |
||
1206 | (currentControl as ArrowTextControl).UnderLine = TextDecorations.Underline; |
||
1207 | } |
||
1208 | } |
||
1209 | 9f473fb7 | KangIngu | else if ((currentControl as RectCloudControl) != null) |
1210 | { |
||
1211 | (currentControl as RectCloudControl).ArcLength = ViewerDataModel.Instance.ArcLength; |
||
1212 | } |
||
1213 | else if ((currentControl as CloudControl) != null) |
||
1214 | { |
||
1215 | (currentControl as CloudControl).ArcLength = ViewerDataModel.Instance.ArcLength; |
||
1216 | } |
||
1217 | 787a4489 | KangIngu | |
1218 | switch (controlType) |
||
1219 | { |
||
1220 | 684ef11c | ljiyeon | case (ControlType.Coordinate): |
1221 | { |
||
1222 | var control = currentControl as CoordinateControl; |
||
1223 | if (control != null) |
||
1224 | { |
||
1225 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1226 | 684ef11c | ljiyeon | control.DashSize = ViewerDataModel.Instance.DashSize; |
1227 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1228 | } |
||
1229 | } |
||
1230 | break; |
||
1231 | case (ControlType.InsideWhite): |
||
1232 | { |
||
1233 | var control = currentControl as InsideWhiteControl; |
||
1234 | if (control != null) |
||
1235 | { |
||
1236 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1237 | 684ef11c | ljiyeon | control.DashSize = ViewerDataModel.Instance.DashSize; |
1238 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1239 | control.Paint = PaintSet.Fill; |
||
1240 | } |
||
1241 | } |
||
1242 | break; |
||
1243 | a6272c57 | humkyung | case ControlType.OverlapWhite: |
1244 | 684ef11c | ljiyeon | { |
1245 | var control = currentControl as OverlapWhiteControl; |
||
1246 | if (control != null) |
||
1247 | { |
||
1248 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1249 | 684ef11c | ljiyeon | control.DashSize = ViewerDataModel.Instance.DashSize; |
1250 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1251 | control.Paint = PaintSet.Fill; |
||
1252 | } |
||
1253 | } |
||
1254 | break; |
||
1255 | a6272c57 | humkyung | case ControlType.ClipWhite: |
1256 | 684ef11c | ljiyeon | { |
1257 | var control = currentControl as ClipWhiteControl; |
||
1258 | if (control != null) |
||
1259 | { |
||
1260 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1261 | 684ef11c | ljiyeon | control.DashSize = ViewerDataModel.Instance.DashSize; |
1262 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1263 | control.Paint = PaintSet.Fill; |
||
1264 | } |
||
1265 | } |
||
1266 | break; |
||
1267 | 787a4489 | KangIngu | case ControlType.RectCloud: |
1268 | { |
||
1269 | var control = currentControl as RectCloudControl; |
||
1270 | if (control != null) |
||
1271 | { |
||
1272 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1273 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1274 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1275 | } |
||
1276 | } |
||
1277 | break; |
||
1278 | case ControlType.SingleLine: |
||
1279 | case ControlType.CancelLine: |
||
1280 | case ControlType.ArrowLine: |
||
1281 | case ControlType.TwinLine: |
||
1282 | case ControlType.DimLine: |
||
1283 | { |
||
1284 | d71ee575 | djkim | var control = currentControl as LineControl; |
1285 | if (control != null) |
||
1286 | 787a4489 | KangIngu | { |
1287 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1288 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1289 | } |
||
1290 | } |
||
1291 | break; |
||
1292 | |||
1293 | case ControlType.ArcLine: |
||
1294 | { |
||
1295 | d71ee575 | djkim | var control = currentControl as ArcControl; |
1296 | if (control != null) |
||
1297 | 787a4489 | KangIngu | { |
1298 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1299 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1300 | } |
||
1301 | } |
||
1302 | break; |
||
1303 | |||
1304 | case ControlType.ArcArrow: |
||
1305 | { |
||
1306 | 40b3ce25 | ljiyeon | var control = currentControl as ArrowArcControl; |
1307 | d71ee575 | djkim | if (control != null) |
1308 | 787a4489 | KangIngu | { |
1309 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1310 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1311 | } |
||
1312 | } |
||
1313 | break; |
||
1314 | |||
1315 | case ControlType.ArrowMultiLine: |
||
1316 | { |
||
1317 | d71ee575 | djkim | var control = currentControl as ArrowControl_Multi; |
1318 | if (control != null) |
||
1319 | 787a4489 | KangIngu | { |
1320 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1321 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1322 | } |
||
1323 | } |
||
1324 | break; |
||
1325 | |||
1326 | case ControlType.Circle: |
||
1327 | { |
||
1328 | a6272c57 | humkyung | if (currentControl != null) |
1329 | 787a4489 | KangIngu | { |
1330 | a6272c57 | humkyung | currentControl.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1331 | (currentControl as CircleControl).DashSize = ViewerDataModel.Instance.DashSize; |
||
1332 | (currentControl as CircleControl).Paint = ViewerDataModel.Instance.paintSet; |
||
1333 | 787a4489 | KangIngu | } |
1334 | } |
||
1335 | break; |
||
1336 | |||
1337 | case ControlType.PolygonCloud: |
||
1338 | { |
||
1339 | var control = currentControl as CloudControl; |
||
1340 | if (control != null) |
||
1341 | { |
||
1342 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1343 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1344 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1345 | } |
||
1346 | } |
||
1347 | break; |
||
1348 | |||
1349 | case ControlType.Triangle: |
||
1350 | { |
||
1351 | var control = currentControl as TriControl; |
||
1352 | if (control != null) |
||
1353 | { |
||
1354 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1355 | 787a4489 | KangIngu | control.DashSize = ViewerDataModel.Instance.DashSize; |
1356 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1357 | } |
||
1358 | } |
||
1359 | break; |
||
1360 | |||
1361 | case ControlType.ImgControl: |
||
1362 | { |
||
1363 | var control = currentControl as ImgControl; |
||
1364 | if (control != null) |
||
1365 | { |
||
1366 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1367 | 787a4489 | KangIngu | } |
1368 | } |
||
1369 | break; |
||
1370 | |||
1371 | case ControlType.Date: |
||
1372 | { |
||
1373 | var control = currentControl as DateControl; |
||
1374 | if (control != null) |
||
1375 | { |
||
1376 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1377 | 787a4489 | KangIngu | } |
1378 | } |
||
1379 | break; |
||
1380 | |||
1381 | case ControlType.ArrowTextControl: |
||
1382 | case ControlType.ArrowTransTextControl: |
||
1383 | case ControlType.ArrowTextBorderControl: |
||
1384 | case ControlType.ArrowTransTextBorderControl: |
||
1385 | case ControlType.ArrowTextCloudControl: |
||
1386 | case ControlType.ArrowTransTextCloudControl: |
||
1387 | { |
||
1388 | var control = currentControl as ArrowTextControl; |
||
1389 | if (control != null) |
||
1390 | { |
||
1391 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1392 | 787a4489 | KangIngu | } |
1393 | } |
||
1394 | break; |
||
1395 | case ControlType.PolygonControl: |
||
1396 | e6a9ddaf | humkyung | case ControlType.ChainLine: |
1397 | 787a4489 | KangIngu | { |
1398 | var control = currentControl as PolygonControl; |
||
1399 | if (control != null) |
||
1400 | { |
||
1401 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1402 | 787a4489 | KangIngu | control.Paint = ViewerDataModel.Instance.paintSet; |
1403 | control.DashSize = ViewerDataModel.Instance.DashSize; |
||
1404 | control.Paint = ViewerDataModel.Instance.paintSet; |
||
1405 | } |
||
1406 | } |
||
1407 | break; |
||
1408 | case ControlType.Sign: |
||
1409 | { |
||
1410 | var control = currentControl as SignControl; |
||
1411 | if (control != null) |
||
1412 | { |
||
1413 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1414 | 787a4489 | KangIngu | } |
1415 | } |
||
1416 | break; |
||
1417 | case ControlType.Symbol: |
||
1418 | { |
||
1419 | var control = currentControl as SymControl; |
||
1420 | if (control != null) |
||
1421 | { |
||
1422 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1423 | 787a4489 | KangIngu | } |
1424 | } |
||
1425 | break; |
||
1426 | case ControlType.Stamp: |
||
1427 | { |
||
1428 | var control = currentControl as SymControlN; |
||
1429 | if (control != null) |
||
1430 | { |
||
1431 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1432 | 787a4489 | KangIngu | } |
1433 | } |
||
1434 | break; |
||
1435 | a6272c57 | humkyung | case ControlType.Rectangle: |
1436 | 787a4489 | KangIngu | case ControlType.Mark: |
1437 | { |
||
1438 | var control = currentControl as RectangleControl; |
||
1439 | if (control != null) |
||
1440 | { |
||
1441 | a6272c57 | humkyung | control.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.checkAxis, ViewerDataModel.Instance.IsPressShift); |
1442 | if(control.ControlType == ControlType.Mark) control.Paint = PaintSet.Fill; |
||
1443 | 787a4489 | KangIngu | } |
1444 | } |
||
1445 | break; |
||
1446 | case ControlType.PenControl: |
||
1447 | { |
||
1448 | stroke.StylusPoints.Add(new StylusPoint(currentCanvasDrawingMouseMovePoint.X, currentCanvasDrawingMouseMovePoint.Y)); |
||
1449 | //inkBoard.Strokes.Add(stroke); |
||
1450 | } |
||
1451 | break; |
||
1452 | default: |
||
1453 | break; |
||
1454 | } |
||
1455 | } |
||
1456 | } |
||
1457 | 29cf2c0c | humkyung | else if(mouseHandlingMode == MouseHandlingMode.Drawing && e.LeftButton == MouseButtonState.Pressed) |
1458 | { |
||
1459 | Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas); |
||
1460 | Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas); |
||
1461 | SetCursor(); |
||
1462 | if (currentControl == null) |
||
1463 | { |
||
1464 | switch (controlType) |
||
1465 | { |
||
1466 | case ControlType.PenControl: |
||
1467 | { |
||
1468 | if (inkBoard.Tag.ToString() == "Ink") |
||
1469 | { |
||
1470 | stroke.StylusPoints.Add(new StylusPoint(currentCanvasDrawingMouseMovePoint.X, currentCanvasDrawingMouseMovePoint.Y)); |
||
1471 | } |
||
1472 | else if (inkBoard.Tag.ToString() == "EraseByPoint") |
||
1473 | { |
||
1474 | RemovePointStroke(currentCanvasDrawingMouseMovePoint); |
||
1475 | } |
||
1476 | else if (inkBoard.Tag.ToString() == "EraseByStroke") |
||
1477 | { |
||
1478 | RemoveLineStroke(currentCanvasDrawingMouseMovePoint); |
||
1479 | } |
||
1480 | |||
1481 | //inkBoard.Strokes.Add(stroke); |
||
1482 | } |
||
1483 | break; |
||
1484 | } |
||
1485 | return; |
||
1486 | } |
||
1487 | } |
||
1488 | e6a9ddaf | humkyung | else if (((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.Selecting) || |
1489 | ((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.Capture) || |
||
1490 | ((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.DragZoom)) |
||
1491 | 787a4489 | KangIngu | { |
1492 | Point curMouseDownPoint = e.GetPosition(drawingRotateCanvas); |
||
1493 | |||
1494 | if (isDraggingSelectionRect) |
||
1495 | { |
||
1496 | UpdateDragSelectionRect(canvasDrawingMouseDownPoint, curMouseDownPoint); |
||
1497 | e.Handled = true; |
||
1498 | } |
||
1499 | else if (isLeftMouseButtonDownOnWindow) |
||
1500 | { |
||
1501 | var dragDelta = curMouseDownPoint - canvasDrawingMouseDownPoint; |
||
1502 | double dragDistance = Math.Abs(dragDelta.Length); |
||
1503 | |||
1504 | if (dragDistance > DragThreshold) |
||
1505 | { |
||
1506 | isDraggingSelectionRect = true; |
||
1507 | InitDragSelectionRect(canvasDrawingMouseDownPoint, curMouseDownPoint); |
||
1508 | } |
||
1509 | |||
1510 | e.Handled = true; |
||
1511 | } |
||
1512 | |||
1513 | if (canvasDrawingMouseDownPoint == curMouseDownPoint) |
||
1514 | { |
||
1515 | } |
||
1516 | else |
||
1517 | { |
||
1518 | e.Handled = true; |
||
1519 | } |
||
1520 | } |
||
1521 | 7211e0c2 | ljiyeon | /* |
1522 | e6a9ddaf | humkyung | else if ((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.DragSymbol) |
1523 | 53880c83 | ljiyeon | { //symbol |
1524 | if(_dragdropWindow != null) |
||
1525 | { |
||
1526 | Win32Point w32Mouse = new Win32Point(); |
||
1527 | GetCursorPos(ref w32Mouse); |
||
1528 | |||
1529 | this._dragdropWindow.Left = w32Mouse.X - (symbol_img.Width / 2); |
||
1530 | this._dragdropWindow.Top = w32Mouse.Y - (symbol_img.Height / 2); |
||
1531 | } |
||
1532 | } |
||
1533 | 7211e0c2 | ljiyeon | */ |
1534 | e6a9ddaf | humkyung | else if ((e.LeftButton == MouseButtonState.Released) && (e.MiddleButton == MouseButtonState.Released) && |
1535 | (e.RightButton == MouseButtonState.Released) && ViewerDataModel.Instance.MarkupControls_USER.Count > 0) |
||
1536 | 787a4489 | KangIngu | { |
1537 | 05009a0e | ljiyeon | var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault(); |
1538 | e6a9ddaf | humkyung | if(control != null) |
1539 | 787a4489 | KangIngu | { |
1540 | this.cursor = Cursors.Hand; |
||
1541 | SetCursor(); |
||
1542 | } |
||
1543 | else |
||
1544 | { |
||
1545 | 510cbd2a | ljiyeon | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
1546 | 787a4489 | KangIngu | SetCursor(); |
1547 | } |
||
1548 | } |
||
1549 | else |
||
1550 | { |
||
1551 | } |
||
1552 | } |
||
1553 | |||
1554 | a1716fa5 | KangIngu | private void zoomAndPanControl2_MouseMove(object sender, MouseEventArgs e) |
1555 | { |
||
1556 | e6a9ddaf | humkyung | if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed)) |
1557 | a1716fa5 | KangIngu | { |
1558 | SetCursor(); |
||
1559 | Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas2); |
||
1560 | Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas2); |
||
1561 | |||
1562 | Vector dragOffset = currentCanvasZoomPanningMouseMovePoint - canvasZoommovingMouseDownPoint; |
||
1563 | |||
1564 | ViewerDataModel.Instance.Sync_ContentOffsetX -= dragOffset.X; |
||
1565 | ViewerDataModel.Instance.Sync_ContentOffsetY -= dragOffset.Y; |
||
1566 | |||
1567 | if (Sync.IsChecked) |
||
1568 | { |
||
1569 | zoomAndPanControl.ContentOffsetX = ViewerDataModel.Instance.Sync_ContentOffsetX; |
||
1570 | zoomAndPanControl.ContentOffsetY = ViewerDataModel.Instance.Sync_ContentOffsetY; |
||
1571 | } |
||
1572 | } |
||
1573 | } |
||
1574 | |||
1575 | 787a4489 | KangIngu | private List<CommentUserInfo> hitList = new List<CommentUserInfo>(); |
1576 | |||
1577 | private EllipseGeometry hitArea = new EllipseGeometry(); |
||
1578 | |||
1579 | private void zoomAndPanControl_MouseUp(object sender, MouseButtonEventArgs e) |
||
1580 | { |
||
1581 | IsDrawing = false; |
||
1582 | |||
1583 | if (mouseHandlingMode != MouseHandlingMode.None) |
||
1584 | { |
||
1585 | if (mouseHandlingMode == MouseHandlingMode.Drawing) |
||
1586 | { |
||
1587 | 510cbd2a | ljiyeon | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
1588 | 787a4489 | KangIngu | |
1589 | SetCursor(); |
||
1590 | |||
1591 | switch (controlType) |
||
1592 | { |
||
1593 | case ControlType.None: |
||
1594 | break; |
||
1595 | case ControlType.Rectangle: |
||
1596 | { |
||
1597 | |||
1598 | } |
||
1599 | break; |
||
1600 | case ControlType.PenControl: |
||
1601 | { |
||
1602 | |||
1603 | } |
||
1604 | break; |
||
1605 | default: |
||
1606 | break; |
||
1607 | } |
||
1608 | } |
||
1609 | 9f473fb7 | KangIngu | else if (mouseHandlingMode == MouseHandlingMode.Selecting && e.ChangedButton == MouseButton.Left || mouseHandlingMode == MouseHandlingMode.Capture && e.ChangedButton == MouseButton.Left || mouseHandlingMode == MouseHandlingMode.DragZoom && e.ChangedButton == MouseButton.Left) |
1610 | 787a4489 | KangIngu | { |
1611 | if (isLeftMouseButtonDownOnWindow) |
||
1612 | { |
||
1613 | bool wasDragSelectionApplied = false; |
||
1614 | |||
1615 | if (isDraggingSelectionRect) |
||
1616 | { |
||
1617 | 53880c83 | ljiyeon | if (mouseHandlingMode == MouseHandlingMode.Capture && controlType == ControlType.ImgControl) |
1618 | { |
||
1619 | dragCaptureBorder.Visibility = Visibility.Collapsed; |
||
1620 | mouseHandlingMode = MouseHandlingMode.None; |
||
1621 | Point endPoint = e.GetPosition(zoomAndPanCanvas); |
||
1622 | symbolselectindex = symbolPanel_Instance.RadTab.SelectedIndex; |
||
1623 | Set_Symbol_Capture(endPoint); |
||
1624 | ViewerDataModel.Instance.ViewVisible = Visibility.Collapsed; |
||
1625 | ViewerDataModel.Instance.ViewVisible = Visibility.Visible; |
||
1626 | ViewerDataModel.Instance.Capture_Opacity = 0; |
||
1627 | } |
||
1628 | else if (mouseHandlingMode == MouseHandlingMode.Capture) |
||
1629 | 787a4489 | KangIngu | { |
1630 | dragCaptureBorder.Visibility = Visibility.Collapsed; |
||
1631 | mouseHandlingMode = MouseHandlingMode.None; |
||
1632 | Set_Capture(); |
||
1633 | |||
1634 | ViewerDataModel.Instance.ViewVisible = Visibility.Collapsed; |
||
1635 | ViewerDataModel.Instance.ViewVisible = Visibility.Visible; |
||
1636 | ViewerDataModel.Instance.Capture_Opacity = 0; |
||
1637 | } |
||
1638 | 9f473fb7 | KangIngu | else if (mouseHandlingMode == MouseHandlingMode.Selecting) |
1639 | 787a4489 | KangIngu | { |
1640 | ApplyDragSelectionRect(); |
||
1641 | } |
||
1642 | 9f473fb7 | KangIngu | else |
1643 | { |
||
1644 | double x = Canvas.GetLeft(dragZoomBorder); |
||
1645 | double y = Canvas.GetTop(dragZoomBorder); |
||
1646 | double width = dragZoomBorder.Width; |
||
1647 | double height = dragZoomBorder.Height; |
||
1648 | Rect dragRect = new Rect(x, y, width, height); |
||
1649 | |||
1650 | ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(dragRect); |
||
1651 | |||
1652 | dragZoomBorder.Visibility = Visibility.Collapsed; |
||
1653 | } |
||
1654 | 787a4489 | KangIngu | |
1655 | 9f473fb7 | KangIngu | isDraggingSelectionRect = false; |
1656 | 787a4489 | KangIngu | e.Handled = true; |
1657 | wasDragSelectionApplied = true; |
||
1658 | } |
||
1659 | |||
1660 | if (isLeftMouseButtonDownOnWindow) |
||
1661 | { |
||
1662 | isLeftMouseButtonDownOnWindow = false; |
||
1663 | this.ReleaseMouseCapture(); |
||
1664 | e.Handled = true; |
||
1665 | } |
||
1666 | |||
1667 | if (!wasDragSelectionApplied) |
||
1668 | { |
||
1669 | init(); |
||
1670 | } |
||
1671 | } |
||
1672 | } |
||
1673 | e6a9ddaf | humkyung | else if (e.RightButton == MouseButtonState.Pressed) |
1674 | 787a4489 | KangIngu | { |
1675 | 510cbd2a | ljiyeon | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
1676 | 787a4489 | KangIngu | SetCursor(); |
1677 | } |
||
1678 | |||
1679 | zoomAndPanControl.ReleaseMouseCapture(); |
||
1680 | |||
1681 | |||
1682 | e.Handled = true; |
||
1683 | } |
||
1684 | else |
||
1685 | { |
||
1686 | 510cbd2a | ljiyeon | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
1687 | 787a4489 | KangIngu | SetCursor(); |
1688 | } |
||
1689 | |||
1690 | e6a9ddaf | humkyung | ///mouseButtonDown = MouseButton.Left; |
1691 | 787a4489 | KangIngu | //controlType = ControlType.SingleLine; |
1692 | } |
||
1693 | |||
1694 | 53880c83 | ljiyeon | public void Set_Symbol_Capture(Point endPoint) |
1695 | { |
||
1696 | double x = canvasDrawingMouseDownPoint.X; |
||
1697 | double y = canvasDrawingMouseDownPoint.Y; |
||
1698 | if(x > endPoint.X) |
||
1699 | { |
||
1700 | x = endPoint.X; |
||
1701 | y = endPoint.Y; |
||
1702 | } |
||
1703 | |||
1704 | double width = dragCaptureBorder.Width; |
||
1705 | double height = dragCaptureBorder.Height; |
||
1706 | |||
1707 | canvasImage = ConverterBitmapImage(zoomAndPanCanvas); |
||
1708 | |||
1709 | if (x < 0) |
||
1710 | { |
||
1711 | width += x; |
||
1712 | x = 0; |
||
1713 | } |
||
1714 | if (y < 0) |
||
1715 | { |
||
1716 | height += y; |
||
1717 | y = 0; |
||
1718 | |||
1719 | width = (int)canvasImage.PixelWidth - x; |
||
1720 | } |
||
1721 | if (x + width > canvasImage.PixelWidth) |
||
1722 | { |
||
1723 | width = (int)canvasImage.PixelWidth - x; |
||
1724 | } |
||
1725 | if (y + height > canvasImage.PixelHeight) |
||
1726 | { |
||
1727 | height = (int)canvasImage.PixelHeight - y; |
||
1728 | } |
||
1729 | var rect = new Int32Rect((int)x, (int)y, (int)width, (int)height); |
||
1730 | |||
1731 | string uri = ""; |
||
1732 | if (userData.COMPANY != "EXT") |
||
1733 | { |
||
1734 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, |
1735 | 53880c83 | ljiyeon | (Convert.ToInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber); |
1736 | } |
||
1737 | else |
||
1738 | { |
||
1739 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, |
1740 | 53880c83 | ljiyeon | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber); |
1741 | } |
||
1742 | |||
1743 | var defaultBitmapImage = new BitmapImage(); |
||
1744 | defaultBitmapImage.BeginInit(); |
||
1745 | defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache; |
||
1746 | defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad; |
||
1747 | defaultBitmapImage.UriSource = new Uri(uri); |
||
1748 | defaultBitmapImage.EndInit(); |
||
1749 | |||
1750 | 90e7968d | ljiyeon | //GC.Collect(); |
1751 | 53880c83 | ljiyeon | |
1752 | if (defaultBitmapImage.IsDownloading) |
||
1753 | { |
||
1754 | defaultBitmapImage.DownloadCompleted += (ex, arg) => |
||
1755 | { |
||
1756 | defaultBitmapImage.Freeze(); |
||
1757 | 90e7968d | ljiyeon | //GC.Collect(); |
1758 | 53880c83 | ljiyeon | BitmapSource bs = new CroppedBitmap(defaultBitmapImage, rect); |
1759 | Save_Symbol_Capture(bs, (int)x, (int)y, (int)width, (int)height); |
||
1760 | }; |
||
1761 | } |
||
1762 | } |
||
1763 | |||
1764 | a1716fa5 | KangIngu | private void zoomAndPanControl2_MouseUp(object sender, MouseButtonEventArgs e) |
1765 | { |
||
1766 | e6a9ddaf | humkyung | ///mouseButtonDown = MouseButton.Left; |
1767 | a1716fa5 | KangIngu | } |
1768 | |||
1769 | 787a4489 | KangIngu | private void zoomAndPanControl_MouseLeave(object sender, MouseEventArgs e) |
1770 | { |
||
1771 | e6a9ddaf | humkyung | ///mouseButtonDown = MouseButton.Left; |
1772 | 53880c83 | ljiyeon | //this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
1773 | 787a4489 | KangIngu | } |
1774 | |||
1775 | private void zoomAndPanControl_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
||
1776 | { |
||
1777 | |||
1778 | } |
||
1779 | |||
1780 | 4804a4fb | humkyung | /// <summary> |
1781 | /// select items by dragging |
||
1782 | /// </summary> |
||
1783 | 787a4489 | KangIngu | private void ApplyDragSelectionRect() |
1784 | { |
||
1785 | dragSelectionBorder.Visibility = Visibility.Collapsed; |
||
1786 | |||
1787 | double x = Canvas.GetLeft(dragSelectionBorder); |
||
1788 | double y = Canvas.GetTop(dragSelectionBorder); |
||
1789 | double width = dragSelectionBorder.Width; |
||
1790 | double height = dragSelectionBorder.Height; |
||
1791 | Boolean Flag = false; |
||
1792 | List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
||
1793 | f87a00b1 | ljiyeon | var Items = ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.Visibility != Visibility.Hidden).ToList(); |
1794 | 787a4489 | KangIngu | |
1795 | e6a9ddaf | humkyung | Rect dragRect = new Rect(x, y, width, height); |
1796 | ///dragRect.Inflate(width / 10, height / 10); |
||
1797 | 787a4489 | KangIngu | |
1798 | foreach (var item in Items) |
||
1799 | { |
||
1800 | 91efe37a | humkyung | Flag = SelectionSet.Instance.SelectControl(item, dragRect); |
1801 | 787a4489 | KangIngu | |
1802 | if (Flag) |
||
1803 | { |
||
1804 | adornerSet.Add(item); |
||
1805 | 05009a0e | ljiyeon | ViewerDataModel.Instance.MarkupControls_USER.Remove(item); |
1806 | 787a4489 | KangIngu | Control_Style(item); |
1807 | } |
||
1808 | } |
||
1809 | if (adornerSet.Count > 0) |
||
1810 | { |
||
1811 | Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
||
1812 | SelectLayer.Children.Add(final); |
||
1813 | } |
||
1814 | } |
||
1815 | |||
1816 | private void InitDragSelectionRect(Point pt1, Point pt2) |
||
1817 | { |
||
1818 | 9f473fb7 | KangIngu | //캡쳐 중 |
1819 | if (mouseHandlingMode == MouseHandlingMode.Capture) |
||
1820 | { |
||
1821 | dragCaptureBorder.Visibility = Visibility.Visible; |
||
1822 | } |
||
1823 | 787a4489 | KangIngu | //선택 중 |
1824 | 9f473fb7 | KangIngu | else if (mouseHandlingMode == MouseHandlingMode.Selecting) |
1825 | 787a4489 | KangIngu | { |
1826 | e54660e8 | KangIngu | |
1827 | 787a4489 | KangIngu | dragSelectionBorder.Visibility = Visibility.Visible; |
1828 | } |
||
1829 | else |
||
1830 | { |
||
1831 | 9f473fb7 | KangIngu | dragZoomBorder.Visibility = Visibility.Visible; |
1832 | 787a4489 | KangIngu | } |
1833 | UpdateDragSelectionRect(pt1, pt2); |
||
1834 | } |
||
1835 | |||
1836 | /// <summary> |
||
1837 | /// Update the position and size of the rectangle used for drag selection. |
||
1838 | /// </summary> |
||
1839 | private void UpdateDragSelectionRect(Point pt1, Point pt2) |
||
1840 | { |
||
1841 | double x, y, width, height; |
||
1842 | |||
1843 | // |
||
1844 | // Determine x,y,width and height of the rect inverting the points if necessary. |
||
1845 | // |
||
1846 | |||
1847 | if (pt2.X < pt1.X) |
||
1848 | { |
||
1849 | x = pt2.X; |
||
1850 | width = pt1.X - pt2.X; |
||
1851 | } |
||
1852 | else |
||
1853 | { |
||
1854 | x = pt1.X; |
||
1855 | width = pt2.X - pt1.X; |
||
1856 | } |
||
1857 | |||
1858 | if (pt2.Y < pt1.Y) |
||
1859 | { |
||
1860 | y = pt2.Y; |
||
1861 | height = pt1.Y - pt2.Y; |
||
1862 | } |
||
1863 | else |
||
1864 | { |
||
1865 | y = pt1.Y; |
||
1866 | height = pt2.Y - pt1.Y; |
||
1867 | } |
||
1868 | |||
1869 | // |
||
1870 | // Update the coordinates of the rectangle used for drag selection. |
||
1871 | // |
||
1872 | 9f473fb7 | KangIngu | //캡쳐 중 |
1873 | if (mouseHandlingMode == MouseHandlingMode.Capture) |
||
1874 | { |
||
1875 | Canvas.SetLeft(dragCaptureBorder, x); |
||
1876 | Canvas.SetTop(dragCaptureBorder, y); |
||
1877 | dragCaptureBorder.Width = width; |
||
1878 | dragCaptureBorder.Height = height; |
||
1879 | } |
||
1880 | 787a4489 | KangIngu | //선택 중 |
1881 | a1716fa5 | KangIngu | else if (mouseHandlingMode == MouseHandlingMode.Selecting) |
1882 | 787a4489 | KangIngu | { |
1883 | Canvas.SetLeft(dragSelectionBorder, x); |
||
1884 | Canvas.SetTop(dragSelectionBorder, y); |
||
1885 | dragSelectionBorder.Width = width; |
||
1886 | dragSelectionBorder.Height = height; |
||
1887 | } |
||
1888 | else |
||
1889 | { |
||
1890 | 9f473fb7 | KangIngu | Canvas.SetLeft(dragZoomBorder, x); |
1891 | Canvas.SetTop(dragZoomBorder, y); |
||
1892 | dragZoomBorder.Width = width; |
||
1893 | dragZoomBorder.Height = height; |
||
1894 | 787a4489 | KangIngu | } |
1895 | } |
||
1896 | |||
1897 | private void drawingPannelRotate(double angle) |
||
1898 | { |
||
1899 | 548c696e | ljiyeon | Logger.sendCheckLog("pageNavigator_PageChanging_drawingPannelRotate Setting", 1); |
1900 | 787a4489 | KangIngu | rotate.Angle = angle; |
1901 | var rotationNum = Math.Abs((rotate.Angle / 90)); |
||
1902 | |||
1903 | if (angle == 90 || angle == 270) |
||
1904 | { |
||
1905 | double emptySize = zoomAndPanCanvas.Width; |
||
1906 | zoomAndPanCanvas.Width = zoomAndPanCanvas.Height; |
||
1907 | zoomAndPanCanvas.Height = emptySize; |
||
1908 | } |
||
1909 | if (angle == 0) |
||
1910 | { |
||
1911 | translate.X = 0; |
||
1912 | translate.Y = 0; |
||
1913 | } |
||
1914 | else if (angle == 90) |
||
1915 | { |
||
1916 | translate.X = zoomAndPanCanvas.Width; |
||
1917 | translate.Y = 0; |
||
1918 | } |
||
1919 | else if (angle == 180) |
||
1920 | { |
||
1921 | translate.X = zoomAndPanCanvas.Width; |
||
1922 | translate.Y = zoomAndPanCanvas.Height; |
||
1923 | } |
||
1924 | else |
||
1925 | { |
||
1926 | translate.X = 0; |
||
1927 | translate.Y = zoomAndPanCanvas.Height; |
||
1928 | } |
||
1929 | |||
1930 | zoomAndPanControl.RotationAngle = rotate.Angle; |
||
1931 | |||
1932 | |||
1933 | if (!testPanel2.IsHidden) |
||
1934 | { |
||
1935 | zoomAndPanControl2.RotationAngle = rotate.Angle; |
||
1936 | zoomAndPanCanvas2.Width = zoomAndPanCanvas.Width; |
||
1937 | zoomAndPanCanvas2.Height = zoomAndPanCanvas.Height; |
||
1938 | } |
||
1939 | |||
1940 | ViewerDataModel.Instance.ContentWidth = zoomAndPanCanvas.Width; |
||
1941 | ViewerDataModel.Instance.ContentHeight = zoomAndPanCanvas.Height; |
||
1942 | ViewerDataModel.Instance.AngleOffsetX = translate.X; |
||
1943 | ViewerDataModel.Instance.AngleOffsetY = translate.Y; |
||
1944 | ViewerDataModel.Instance.Angle = rotate.Angle; |
||
1945 | } |
||
1946 | |||
1947 | 53880c83 | ljiyeon | public void PlaceImageSymbol(string id, long group_id, int SelectedIndex, Point canvasZoomPanningMouseDownPoint) |
1948 | 787a4489 | KangIngu | { |
1949 | 53880c83 | ljiyeon | string Data_ = ""; |
1950 | |||
1951 | try |
||
1952 | { |
||
1953 | Logger.sendReqLog("GetSymbolImageURL: ", id + "," + SelectedIndex, 1); |
||
1954 | Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolImageURL(id, SelectedIndex); |
||
1955 | if (Data_ != null || Data_ != "") |
||
1956 | { |
||
1957 | Logger.sendResLog("GetSymbolImageURL", "TRUE", 1); |
||
1958 | } |
||
1959 | else |
||
1960 | { |
||
1961 | Logger.sendResLog("GetSymbolImageURL", "FALSE", 1); |
||
1962 | } |
||
1963 | |||
1964 | c0977e97 | djkim | //MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
1965 | //{ |
||
1966 | // SYMBOL_ID = id,//InnerItem.Symbol_ID |
||
1967 | // STATE = 0, |
||
1968 | //}; |
||
1969 | 53880c83 | ljiyeon | if (Data_ != null) |
1970 | { |
||
1971 | Image img = new Image(); |
||
1972 | //img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Data_)); |
||
1973 | if (Data_.Contains(".svg")) |
||
1974 | { |
||
1975 | byte[] imageData = null; |
||
1976 | DrawingImage image = null; |
||
1977 | using (System.Net.WebClient web = new System.Net.WebClient()) |
||
1978 | { |
||
1979 | imageData = web.DownloadData(new Uri(Data_)); |
||
1980 | System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
||
1981 | image = SvgReader.Load(stream); |
||
1982 | } |
||
1983 | img.Source = image; |
||
1984 | } |
||
1985 | else |
||
1986 | { |
||
1987 | img.Source = new BitmapImage(new Uri(Data_)); |
||
1988 | } |
||
1989 | |||
1990 | var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
||
1991 | { |
||
1992 | PointSet = new List<Point>(), |
||
1993 | FilePath = Data_, |
||
1994 | ImageData = img.Source, |
||
1995 | StartPoint = canvasZoomPanningMouseDownPoint, |
||
1996 | EndPoint = new Point(canvasZoomPanningMouseDownPoint.X + img.Source.Width, |
||
1997 | canvasZoomPanningMouseDownPoint.Y + img.Source.Height), |
||
1998 | TopRightPoint = new Point(canvasZoomPanningMouseDownPoint.X+img.Source.Width, |
||
1999 | canvasZoomPanningMouseDownPoint.Y), |
||
2000 | LeftBottomPoint = new Point(canvasZoomPanningMouseDownPoint.X, |
||
2001 | canvasZoomPanningMouseDownPoint.Y + img.Source.Height) |
||
2002 | }; |
||
2003 | |||
2004 | currentControl.PointSet = new List<Point> |
||
2005 | { |
||
2006 | currentControl.StartPoint, |
||
2007 | currentControl.LeftBottomPoint, |
||
2008 | currentControl.EndPoint, |
||
2009 | currentControl.TopRightPoint, |
||
2010 | }; |
||
2011 | Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
||
2012 | UndoData = new Undo_data() |
||
2013 | { |
||
2014 | IsUndo = false, |
||
2015 | Event = Event_Type.Create, |
||
2016 | EventTime = DateTime.Now, |
||
2017 | Markup_List = new List<Multi_Undo_data>() |
||
2018 | }; |
||
2019 | ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
||
2020 | { |
||
2021 | ViewerDataModel.Instance.UndoDataList.Remove(i); |
||
2022 | }); |
||
2023 | |||
2024 | //multi_Undo_Data = dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2025 | multi_Undo_Data = Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2026 | UndoData.Markup_List.Add(multi_Undo_Data); |
||
2027 | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
||
2028 | |||
2029 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2030 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2031 | 53880c83 | ljiyeon | currentControl.SymbolID = id; |
2032 | currentControl.GroupID = group_id; |
||
2033 | currentControl.ApplyTemplate(); |
||
2034 | currentControl.SetImage(); |
||
2035 | |||
2036 | ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2037 | Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
2038 | SelectLayer.Children.Add(final); |
||
2039 | } |
||
2040 | } |
||
2041 | catch (Exception ex) |
||
2042 | { |
||
2043 | this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error"); |
||
2044 | } |
||
2045 | } |
||
2046 | |||
2047 | private void zoomAndPanControl_MouseDown(object sender, MouseButtonEventArgs e) |
||
2048 | { |
||
2049 | 992a98b4 | KangIngu | var set_option = this.ParentOfType<MainWindow>().dzTopMenu.Parent.ChildrenOfType<RadNumericUpDown>().Where(item => item.IsKeyboardFocusWithin).FirstOrDefault(); |
2050 | be04d12c | djkim | if (set_option != null && !string.IsNullOrEmpty(set_option.ContentText)) |
2051 | 992a98b4 | KangIngu | { |
2052 | set_option.Value = double.Parse(set_option.ContentText); |
||
2053 | } |
||
2054 | |||
2055 | f959ea6f | humkyung | ConvertInkControlToPolygon(); |
2056 | 787a4489 | KangIngu | |
2057 | d62c0439 | humkyung | ///TODO: |
2058 | 787a4489 | KangIngu | var text_item = ViewerDataModel.Instance.MarkupControls_USER.Where(data => |
2059 | (data as TextControl) != null && (data as TextControl).Text == "" || (data as ArrowTextControl) != null && (data as ArrowTextControl).ArrowText == "").FirstOrDefault(); |
||
2060 | |||
2061 | a1716fa5 | KangIngu | if (text_item != null && (currentControl as ArrowTextControl) == null) |
2062 | 787a4489 | KangIngu | { |
2063 | ViewerDataModel.Instance.MarkupControls_USER.Remove(text_item); |
||
2064 | } |
||
2065 | d62c0439 | humkyung | /// up to here |
2066 | 787a4489 | KangIngu | |
2067 | foreach (var arrow_text in ViewerDataModel.Instance.MarkupControls_USER) |
||
2068 | { |
||
2069 | if (arrow_text as ArrowTextControl != null) |
||
2070 | { |
||
2071 | (arrow_text as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
||
2072 | } |
||
2073 | } |
||
2074 | |||
2075 | 49b217ad | humkyung | //if (currentControl != null) |
2076 | 787a4489 | KangIngu | { |
2077 | var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).Base_TextBox.Visibility == Visibility.Visible).FirstOrDefault(); |
||
2078 | if (text_item_ != null) |
||
2079 | { |
||
2080 | (text_item_ as TextControl).Base_TextBlock.Visibility = Visibility.Visible; |
||
2081 | (text_item_ as TextControl).Base_TextBox.Visibility = Visibility.Collapsed; |
||
2082 | (text_item_ as TextControl).EnableEditing = false; |
||
2083 | 49b217ad | humkyung | currentControl = null; |
2084 | 787a4489 | KangIngu | } |
2085 | |||
2086 | var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as ArrowTextControl) != null && (data as ArrowTextControl).IsEditingMode == true).FirstOrDefault(); |
||
2087 | 49b217ad | humkyung | if (Arrowtext_item_ != null && ((Arrowtext_item_ as ArrowTextControl).IsNew == false)) |
2088 | 787a4489 | KangIngu | { |
2089 | (Arrowtext_item_ as ArrowTextControl).IsEditingMode = false; |
||
2090 | (Arrowtext_item_ as ArrowTextControl).Base_TextBox.Focusable = false; |
||
2091 | 49b217ad | humkyung | currentControl = null; |
2092 | 787a4489 | KangIngu | } |
2093 | } |
||
2094 | |||
2095 | ca40e004 | ljiyeon | double Ang = 0; |
2096 | 787a4489 | KangIngu | if (rotate.Angle != 0) |
2097 | { |
||
2098 | Ang = 360 - rotate.Angle; |
||
2099 | } |
||
2100 | |||
2101 | if (e.OriginalSource is System.Windows.Controls.Image) |
||
2102 | { |
||
2103 | (e.OriginalSource as System.Windows.Controls.Image).Focus(); |
||
2104 | } |
||
2105 | 7211e0c2 | ljiyeon | /* |
2106 | e6a9ddaf | humkyung | if (mouseHandlingMode == MouseHandlingMode.DragSymbol && e.LeftButton == MouseButtonState.Pressed) |
2107 | 53880c83 | ljiyeon | { |
2108 | canvasZoomPanningMouseDownPoint = e.GetPosition(zoomAndPanCanvas); |
||
2109 | if(symbol_id != null) |
||
2110 | { |
||
2111 | PlaceImageSymbol(symbol_id, symbol_group_id, symbol_SelectedIndex, canvasZoomPanningMouseDownPoint); |
||
2112 | } |
||
2113 | } |
||
2114 | |||
2115 | e6a9ddaf | humkyung | if (mouseHandlingMode == MouseHandlingMode.DragSymbol && e.RightButton == MouseButtonState.Pressed) |
2116 | 53880c83 | ljiyeon | { |
2117 | if (this._dragdropWindow != null) |
||
2118 | { |
||
2119 | this._dragdropWindow.Close(); |
||
2120 | this._dragdropWindow = null; |
||
2121 | symbol_id = null; |
||
2122 | } |
||
2123 | } |
||
2124 | 7211e0c2 | ljiyeon | */ |
2125 | 53880c83 | ljiyeon | |
2126 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2127 | 787a4489 | KangIngu | { |
2128 | canvasDrawingMouseDownPoint = e.GetPosition(drawingRotateCanvas); |
||
2129 | canvasZoomPanningMouseDownPoint = e.GetPosition(zoomAndPanCanvas); |
||
2130 | |||
2131 | 510cbd2a | ljiyeon | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
2132 | 787a4489 | KangIngu | SetCursor(); |
2133 | |||
2134 | f513c215 | humkyung | if (!ViewerDataModel.Instance.IsPressCtrl) SelectionSet.Instance.UnSelect(this); |
2135 | 787a4489 | KangIngu | } |
2136 | f513c215 | humkyung | |
2137 | e6a9ddaf | humkyung | if (e.MiddleButton == MouseButtonState.Pressed) |
2138 | 787a4489 | KangIngu | { |
2139 | canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas); |
||
2140 | cursor = Cursors.SizeAll; |
||
2141 | SetCursor(); |
||
2142 | } |
||
2143 | e6a9ddaf | humkyung | if (e.RightButton == MouseButtonState.Pressed) |
2144 | 787a4489 | KangIngu | { |
2145 | canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas); |
||
2146 | cursor = Cursors.SizeAll; |
||
2147 | SetCursor(); |
||
2148 | } |
||
2149 | e6a9ddaf | humkyung | else if (e.XButton1 == MouseButtonState.Pressed) |
2150 | 787a4489 | KangIngu | { |
2151 | if (this.pageNavigator.CurrentPage.PageNumber + 1 <= this.pageNavigator.PageCount) |
||
2152 | { |
||
2153 | 3908a575 | humkyung | this.pageNavigator.GotoPage(this.pageNavigator.CurrentPage.PageNumber + 1); |
2154 | 787a4489 | KangIngu | } |
2155 | |||
2156 | 3908a575 | humkyung | //this.pageNavigator.GotoPage(this.pageNavigator._NextPage.PageNumber); |
2157 | 787a4489 | KangIngu | |
2158 | } |
||
2159 | e6a9ddaf | humkyung | else if (e.XButton2 == MouseButtonState.Pressed) |
2160 | 787a4489 | KangIngu | { |
2161 | if (this.pageNavigator.CurrentPage.PageNumber > 1) |
||
2162 | { |
||
2163 | this.pageNavigator.GotoPage(this.pageNavigator.CurrentPage.PageNumber - 1); |
||
2164 | } |
||
2165 | } |
||
2166 | |||
2167 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed && mouseHandlingMode != MouseHandlingMode.Drawing && currentControl == null) |
2168 | 787a4489 | KangIngu | { |
2169 | if (mouseHandlingMode == MouseHandlingMode.Selecting) |
||
2170 | { |
||
2171 | if (SelectLayer.Children.Count == 0) |
||
2172 | { |
||
2173 | isLeftMouseButtonDownOnWindow = true; |
||
2174 | mouseHandlingMode = MouseHandlingMode.Selecting; |
||
2175 | } |
||
2176 | |||
2177 | if (controlType == ControlType.None) |
||
2178 | { |
||
2179 | isLeftMouseButtonDownOnWindow = true; |
||
2180 | } |
||
2181 | } |
||
2182 | |||
2183 | f513c215 | humkyung | /// 캡쳐 모드 설정 |
2184 | 9f473fb7 | KangIngu | if (mouseHandlingMode == MouseHandlingMode.Capture) |
2185 | { |
||
2186 | dragCaptureBorder.Visibility = Visibility.Visible; |
||
2187 | isLeftMouseButtonDownOnWindow = true; |
||
2188 | } |
||
2189 | |||
2190 | f513c215 | humkyung | /// 줌 모드 설정 |
2191 | 9f473fb7 | KangIngu | if (mouseHandlingMode == MouseHandlingMode.DragZoom) |
2192 | { |
||
2193 | isLeftMouseButtonDownOnWindow = true; |
||
2194 | 1066bae3 | ljiyeon | } |
2195 | 787a4489 | KangIngu | |
2196 | 05009a0e | ljiyeon | var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault(); |
2197 | 787a4489 | KangIngu | if (control != null) |
2198 | { |
||
2199 | d62c0439 | humkyung | AdornerFinal final = null; |
2200 | 787a4489 | KangIngu | |
2201 | if (!ViewerDataModel.Instance.IsPressCtrl) |
||
2202 | { |
||
2203 | d62c0439 | humkyung | /// 기존 selection 해제 |
2204 | 077896be | humkyung | SelectionSet.Instance.UnSelect(this); |
2205 | d62c0439 | humkyung | |
2206 | 787a4489 | KangIngu | final = new AdornerFinal(control); |
2207 | |||
2208 | f513c215 | humkyung | this.Control_Style(control); |
2209 | 787a4489 | KangIngu | |
2210 | if ((control as IPath) != null) |
||
2211 | { |
||
2212 | if ((control as IPath).LineSize != 0) |
||
2213 | { |
||
2214 | ViewerDataModel.Instance.LineSize = (control as IPath).LineSize; |
||
2215 | } |
||
2216 | } |
||
2217 | if ((control as IShapeControl) != null) |
||
2218 | { |
||
2219 | if ((control as IShapeControl).Paint == PaintSet.Hatch) |
||
2220 | { |
||
2221 | ViewerDataModel.Instance.checkHatchShape = true; |
||
2222 | } |
||
2223 | else if ((control as IShapeControl).Paint == PaintSet.Fill) |
||
2224 | { |
||
2225 | ViewerDataModel.Instance.checkFillShape = true; |
||
2226 | } |
||
2227 | else |
||
2228 | { |
||
2229 | ViewerDataModel.Instance.checkHatchShape = false; |
||
2230 | ViewerDataModel.Instance.checkFillShape = false; |
||
2231 | } |
||
2232 | ViewerDataModel.Instance.paintSet = (control as IShapeControl).Paint; |
||
2233 | } |
||
2234 | 9f473fb7 | KangIngu | |
2235 | 787a4489 | KangIngu | ViewerDataModel.Instance.ControlOpacity = control.Opacity; |
2236 | d4b0c723 | KangIngu | |
2237 | if ((control as TextControl) != null) |
||
2238 | { |
||
2239 | 71d7e0bf | 송근호 | if(!((control as TextControl).EnableEditing)) { |
2240 | (control as TextControl).EnableEditing = true; |
||
2241 | } |
||
2242 | |||
2243 | d4b0c723 | KangIngu | if ((control as TextControl).TextStyle == FontStyles.Italic) |
2244 | { |
||
2245 | ViewerDataModel.Instance.checkTextStyle = true; |
||
2246 | } |
||
2247 | else |
||
2248 | { |
||
2249 | ViewerDataModel.Instance.checkTextStyle = false; |
||
2250 | } |
||
2251 | |||
2252 | if ((control as TextControl).TextStyle == FontStyles.Italic) |
||
2253 | { |
||
2254 | ViewerDataModel.Instance.checkTextStyle = true; |
||
2255 | } |
||
2256 | else |
||
2257 | { |
||
2258 | ViewerDataModel.Instance.checkTextStyle = false; |
||
2259 | } |
||
2260 | if ((control as TextControl).TextWeight == FontWeights.Bold) |
||
2261 | { |
||
2262 | ViewerDataModel.Instance.checkTextWeight = true; |
||
2263 | } |
||
2264 | else |
||
2265 | { |
||
2266 | ViewerDataModel.Instance.checkTextWeight = false; |
||
2267 | } |
||
2268 | if ((control as TextControl).UnderLine == TextDecorations.Underline) |
||
2269 | { |
||
2270 | ViewerDataModel.Instance.checkUnderLine = true; |
||
2271 | } |
||
2272 | else |
||
2273 | { |
||
2274 | ViewerDataModel.Instance.checkUnderLine = false; |
||
2275 | } |
||
2276 | ViewerDataModel.Instance.TextSize = (control as TextControl).TextSize; |
||
2277 | ViewerDataModel.Instance.checkHighlight = (control as TextControl).IsHighLight; |
||
2278 | e54660e8 | KangIngu | |
2279 | d4b0c723 | KangIngu | } |
2280 | else if ((control as ArrowTextControl) != null) |
||
2281 | { |
||
2282 | 120b8b00 | 송근호 | if (!((control as ArrowTextControl).EnableEditing)) |
2283 | { |
||
2284 | 71d7e0bf | 송근호 | (control as ArrowTextControl).EnableEditing = true; |
2285 | } |
||
2286 | e17af42b | KangIngu | if ((control as ArrowTextControl).TextStyle == FontStyles.Italic) |
2287 | d4b0c723 | KangIngu | { |
2288 | e17af42b | KangIngu | ViewerDataModel.Instance.checkTextStyle = true; |
2289 | } |
||
2290 | else |
||
2291 | { |
||
2292 | ViewerDataModel.Instance.checkTextStyle = false; |
||
2293 | } |
||
2294 | |||
2295 | if ((control as ArrowTextControl).TextStyle == FontStyles.Italic) |
||
2296 | { |
||
2297 | ViewerDataModel.Instance.checkTextStyle = true; |
||
2298 | d4b0c723 | KangIngu | } |
2299 | e17af42b | KangIngu | else |
2300 | d4b0c723 | KangIngu | { |
2301 | e17af42b | KangIngu | ViewerDataModel.Instance.checkTextStyle = false; |
2302 | d4b0c723 | KangIngu | } |
2303 | e17af42b | KangIngu | if ((control as ArrowTextControl).TextWeight == FontWeights.Bold) |
2304 | d4b0c723 | KangIngu | { |
2305 | e17af42b | KangIngu | ViewerDataModel.Instance.checkTextWeight = true; |
2306 | } |
||
2307 | else |
||
2308 | { |
||
2309 | ViewerDataModel.Instance.checkTextWeight = false; |
||
2310 | } |
||
2311 | if ((control as ArrowTextControl).UnderLine == TextDecorations.Underline) |
||
2312 | { |
||
2313 | ViewerDataModel.Instance.checkUnderLine = true; |
||
2314 | } |
||
2315 | else |
||
2316 | { |
||
2317 | ViewerDataModel.Instance.checkUnderLine = false; |
||
2318 | d4b0c723 | KangIngu | } |
2319 | ViewerDataModel.Instance.checkHighlight = (control as ArrowTextControl).isHighLight; |
||
2320 | ViewerDataModel.Instance.TextSize = (control as ArrowTextControl).TextSize; |
||
2321 | } |
||
2322 | 9f473fb7 | KangIngu | else if ((control as RectCloudControl) != null) |
2323 | { |
||
2324 | ViewerDataModel.Instance.ArcLength = (control as RectCloudControl).ArcLength; |
||
2325 | } |
||
2326 | else if ((control as CloudControl) != null) |
||
2327 | { |
||
2328 | ViewerDataModel.Instance.ArcLength = (control as CloudControl).ArcLength; |
||
2329 | } |
||
2330 | 787a4489 | KangIngu | } |
2331 | else |
||
2332 | { |
||
2333 | d62c0439 | humkyung | List<CommentUserInfo> comment = SelectionSet.Instance.SelectedItems; |
2334 | SelectionSet.Instance.UnSelect(this); |
||
2335 | 787a4489 | KangIngu | comment.Add(control); |
2336 | |||
2337 | Control_Style(control); |
||
2338 | |||
2339 | final = new AdornerFinal(comment); |
||
2340 | } |
||
2341 | |||
2342 | f513c215 | humkyung | if (final != null) |
2343 | { |
||
2344 | this.SelectLayer.Children.Add(final); |
||
2345 | } |
||
2346 | 6707a5c7 | ljiyeon | } |
2347 | 787a4489 | KangIngu | } |
2348 | else if (mouseHandlingMode == MouseHandlingMode.Drawing) |
||
2349 | 6707a5c7 | ljiyeon | { |
2350 | 787a4489 | KangIngu | init(); |
2351 | //강인구 추가(우 클릭 일 경우 커서 변경 하지 않음) |
||
2352 | if (cursor != Cursors.SizeAll) |
||
2353 | { |
||
2354 | cursor = Cursors.Cross; |
||
2355 | SetCursor(); |
||
2356 | } |
||
2357 | bool init_user = false; |
||
2358 | foreach (var user in gridViewMarkup.Items) |
||
2359 | { |
||
2360 | if ((user as MarkupInfoItem).UserID == App.ViewInfo.UserID) |
||
2361 | { |
||
2362 | init_user = true; |
||
2363 | } |
||
2364 | } |
||
2365 | if (init_user && gridViewMarkup.SelectedItems.Where(d => (d as MarkupInfoItem).UserID == App.ViewInfo.UserID).FirstOrDefault() == null && e.LeftButton == MouseButtonState.Pressed) |
||
2366 | { |
||
2367 | RadWindow.Alert(new DialogParameters |
||
2368 | { |
||
2369 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
2370 | 787a4489 | KangIngu | Theme = new VisualStudio2013Theme(), |
2371 | Header = "안내", |
||
2372 | Content = "기존의 코멘트가 존재합니다. 사용자 리스트에서 먼저 선택해주세요", |
||
2373 | }); |
||
2374 | return; |
||
2375 | } |
||
2376 | else |
||
2377 | { |
||
2378 | var item = gridViewMarkup.SelectedItems.Where(d => (d as MarkupInfoItem).UserID == App.ViewInfo.UserID).FirstOrDefault() as MarkupInfoItem; |
||
2379 | if (item != null) |
||
2380 | { |
||
2381 | App.Custom_ViewInfoId = item.MarkupInfoID; |
||
2382 | } |
||
2383 | } |
||
2384 | |||
2385 | 75448f5e | ljiyeon | switch (controlType) |
2386 | 787a4489 | KangIngu | { |
2387 | 684ef11c | ljiyeon | case ControlType.Coordinate: |
2388 | { |
||
2389 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2390 | 684ef11c | ljiyeon | { |
2391 | if (currentControl is CoordinateControl) |
||
2392 | { |
||
2393 | if (IsGetoutpoint((currentControl as CoordinateControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2394 | { |
||
2395 | return; |
||
2396 | } |
||
2397 | |||
2398 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2399 | 684ef11c | ljiyeon | |
2400 | currentControl = null; |
||
2401 | this.cursor = Cursors.Arrow; |
||
2402 | } |
||
2403 | else |
||
2404 | { |
||
2405 | this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); |
||
2406 | d62c0439 | humkyung | if (ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber |
2407 | 684ef11c | ljiyeon | && d.Data_Type == Convert.ToInt32(MarkupToPDF.Controls.Common.ControlType.Coordinate)).Count() > 0) |
2408 | { |
||
2409 | currentControl = null; |
||
2410 | this.cursor = Cursors.Arrow; |
||
2411 | Common.ViewerDataModel.Instance.SystemMain.DialogMessage_Alert("이미 해당 페이지의 도면 영역을 설정하셨습니다.", "Notice"); |
||
2412 | return; |
||
2413 | } |
||
2414 | else |
||
2415 | { |
||
2416 | currentControl = new CoordinateControl |
||
2417 | { |
||
2418 | Background = new SolidColorBrush(Colors.Black), |
||
2419 | f67f164e | humkyung | StartPoint = this.canvasDrawingMouseDownPoint, |
2420 | 684ef11c | ljiyeon | ControlType = ControlType.Coordinate |
2421 | }; |
||
2422 | |||
2423 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2424 | 684ef11c | ljiyeon | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2425 | currentControl.IsNew = true; |
||
2426 | |||
2427 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2428 | |||
2429 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
2430 | } |
||
2431 | } |
||
2432 | } |
||
2433 | } |
||
2434 | break; |
||
2435 | case ControlType.InsideWhite: |
||
2436 | { |
||
2437 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2438 | 684ef11c | ljiyeon | { |
2439 | if (currentControl is InsideWhiteControl) |
||
2440 | { |
||
2441 | if (IsGetoutpoint((currentControl as InsideWhiteControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2442 | { |
||
2443 | return; |
||
2444 | } |
||
2445 | |||
2446 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2447 | 684ef11c | ljiyeon | |
2448 | currentControl = null; |
||
2449 | this.cursor = Cursors.Arrow; |
||
2450 | } |
||
2451 | else |
||
2452 | { |
||
2453 | currentControl = new InsideWhiteControl |
||
2454 | { |
||
2455 | Background = new SolidColorBrush(Colors.Black), |
||
2456 | f67f164e | humkyung | StartPoint = this.canvasDrawingMouseDownPoint, |
2457 | 684ef11c | ljiyeon | ControlType = ControlType.InsideWhite |
2458 | }; |
||
2459 | |||
2460 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2461 | 684ef11c | ljiyeon | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2462 | currentControl.IsNew = true; |
||
2463 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2464 | |||
2465 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
2466 | } |
||
2467 | } |
||
2468 | } |
||
2469 | break; |
||
2470 | case ControlType.OverlapWhite: |
||
2471 | { |
||
2472 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2473 | 684ef11c | ljiyeon | { |
2474 | if (currentControl is OverlapWhiteControl) |
||
2475 | { |
||
2476 | if (IsGetoutpoint((currentControl as OverlapWhiteControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2477 | { |
||
2478 | return; |
||
2479 | } |
||
2480 | |||
2481 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2482 | 684ef11c | ljiyeon | |
2483 | currentControl = null; |
||
2484 | this.cursor = Cursors.Arrow; |
||
2485 | } |
||
2486 | else |
||
2487 | { |
||
2488 | currentControl = new OverlapWhiteControl |
||
2489 | { |
||
2490 | Background = new SolidColorBrush(Colors.Black), |
||
2491 | f67f164e | humkyung | StartPoint = this.canvasDrawingMouseDownPoint, |
2492 | 684ef11c | ljiyeon | ControlType = ControlType.OverlapWhite |
2493 | }; |
||
2494 | |||
2495 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2496 | 684ef11c | ljiyeon | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2497 | currentControl.IsNew = true; |
||
2498 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2499 | |||
2500 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
2501 | } |
||
2502 | } |
||
2503 | } |
||
2504 | break; |
||
2505 | case ControlType.ClipWhite: |
||
2506 | { |
||
2507 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2508 | 684ef11c | ljiyeon | { |
2509 | if (currentControl is ClipWhiteControl) |
||
2510 | { |
||
2511 | if (IsGetoutpoint((currentControl as ClipWhiteControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2512 | { |
||
2513 | return; |
||
2514 | } |
||
2515 | |||
2516 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2517 | 684ef11c | ljiyeon | |
2518 | currentControl = null; |
||
2519 | this.cursor = Cursors.Arrow; |
||
2520 | } |
||
2521 | else |
||
2522 | { |
||
2523 | currentControl = new ClipWhiteControl |
||
2524 | { |
||
2525 | Background = new SolidColorBrush(Colors.Black), |
||
2526 | a6272c57 | humkyung | StartPoint = this.canvasDrawingMouseDownPoint, |
2527 | 684ef11c | ljiyeon | ControlType = ControlType.ClipWhite |
2528 | }; |
||
2529 | |||
2530 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2531 | 684ef11c | ljiyeon | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2532 | currentControl.IsNew = true; |
||
2533 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2534 | |||
2535 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
2536 | } |
||
2537 | } |
||
2538 | } |
||
2539 | break; |
||
2540 | 787a4489 | KangIngu | case ControlType.Rectangle: |
2541 | { |
||
2542 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2543 | 787a4489 | KangIngu | { |
2544 | f67f164e | humkyung | if (currentControl is RectangleControl) |
2545 | { |
||
2546 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2547 | if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2548 | 787a4489 | KangIngu | { |
2549 | f67f164e | humkyung | return; |
2550 | } |
||
2551 | 787a4489 | KangIngu | |
2552 | f67f164e | humkyung | CreateCommand.Instance.Execute(currentControl); |
2553 | currentControl = null; |
||
2554 | 510cbd2a | ljiyeon | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
2555 | f67f164e | humkyung | } |
2556 | else |
||
2557 | { |
||
2558 | currentControl = new RectangleControl |
||
2559 | 787a4489 | KangIngu | { |
2560 | f67f164e | humkyung | Background = new SolidColorBrush(Colors.Black), |
2561 | StartPoint = this.canvasDrawingMouseDownPoint, |
||
2562 | ControlType = ControlType.Rectangle |
||
2563 | }; |
||
2564 | 787a4489 | KangIngu | |
2565 | f67f164e | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2566 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
2567 | currentControl.IsNew = true; |
||
2568 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2569 | 787a4489 | KangIngu | |
2570 | f67f164e | humkyung | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
2571 | } |
||
2572 | 787a4489 | KangIngu | } |
2573 | } |
||
2574 | break; |
||
2575 | case ControlType.RectCloud: |
||
2576 | { |
||
2577 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2578 | 787a4489 | KangIngu | { |
2579 | f67f164e | humkyung | if (currentControl is RectCloudControl) |
2580 | { |
||
2581 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2582 | if (IsGetoutpoint((currentControl as RectCloudControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2583 | 787a4489 | KangIngu | { |
2584 | f67f164e | humkyung | return; |
2585 | } |
||
2586 | e66f22eb | KangIngu | |
2587 | f67f164e | humkyung | CreateCommand.Instance.Execute(currentControl); |
2588 | 787a4489 | KangIngu | |
2589 | f67f164e | humkyung | currentControl = null; |
2590 | |||
2591 | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
||
2592 | } |
||
2593 | else |
||
2594 | { |
||
2595 | currentControl = new RectCloudControl |
||
2596 | 787a4489 | KangIngu | { |
2597 | f67f164e | humkyung | StartPoint = this.canvasDrawingMouseDownPoint, |
2598 | ControlType = ControlType.RectCloud, |
||
2599 | Background = new SolidColorBrush(Colors.Black) |
||
2600 | }; |
||
2601 | 787a4489 | KangIngu | |
2602 | f67f164e | humkyung | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2603 | currentControl.CommentID = Commons.shortGuid(); |
||
2604 | currentControl.IsNew = true; |
||
2605 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2606 | } |
||
2607 | 787a4489 | KangIngu | } |
2608 | } |
||
2609 | break; |
||
2610 | case ControlType.Circle: |
||
2611 | { |
||
2612 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2613 | 787a4489 | KangIngu | { |
2614 | f67f164e | humkyung | if (currentControl is CircleControl) |
2615 | { |
||
2616 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2617 | if (IsGetoutpoint((currentControl as CircleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2618 | 787a4489 | KangIngu | { |
2619 | f67f164e | humkyung | return; |
2620 | } |
||
2621 | e66f22eb | KangIngu | |
2622 | f67f164e | humkyung | CreateCommand.Instance.Execute(currentControl); |
2623 | 787a4489 | KangIngu | |
2624 | f67f164e | humkyung | currentControl = null; |
2625 | } |
||
2626 | else |
||
2627 | { |
||
2628 | currentControl = new CircleControl |
||
2629 | 787a4489 | KangIngu | { |
2630 | f67f164e | humkyung | StartPoint = this.canvasDrawingMouseDownPoint, |
2631 | LeftBottomPoint = this.canvasDrawingMouseDownPoint, |
||
2632 | Background = new SolidColorBrush(Colors.Black) |
||
2633 | }; |
||
2634 | 787a4489 | KangIngu | |
2635 | f67f164e | humkyung | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2636 | currentControl.CommentID = Commons.shortGuid(); |
||
2637 | currentControl.IsNew = true; |
||
2638 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2639 | } |
||
2640 | 787a4489 | KangIngu | } |
2641 | } |
||
2642 | break; |
||
2643 | case ControlType.Triangle: |
||
2644 | { |
||
2645 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2646 | 787a4489 | KangIngu | { |
2647 | f67f164e | humkyung | if (currentControl is TriControl) |
2648 | { |
||
2649 | var content = currentControl as TriControl; |
||
2650 | if (content.MidPoint == new Point(0, 0)) |
||
2651 | 787a4489 | KangIngu | { |
2652 | f67f164e | humkyung | content.MidPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y); |
2653 | 787a4489 | KangIngu | } |
2654 | else |
||
2655 | { |
||
2656 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
2657 | f67f164e | humkyung | if (IsGetoutpoint((currentControl as TriControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
2658 | e66f22eb | KangIngu | { |
2659 | return; |
||
2660 | } |
||
2661 | |||
2662 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2663 | 787a4489 | KangIngu | |
2664 | currentControl = null; |
||
2665 | } |
||
2666 | f67f164e | humkyung | } |
2667 | else |
||
2668 | { |
||
2669 | currentControl = new TriControl |
||
2670 | 787a4489 | KangIngu | { |
2671 | f67f164e | humkyung | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
2672 | Background = new SolidColorBrush(Colors.Black), |
||
2673 | }; |
||
2674 | 787a4489 | KangIngu | |
2675 | f67f164e | humkyung | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2676 | currentControl.CommentID = Commons.shortGuid(); |
||
2677 | currentControl.IsNew = true; |
||
2678 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2679 | } |
||
2680 | 787a4489 | KangIngu | } |
2681 | } |
||
2682 | break; |
||
2683 | case ControlType.CancelLine: |
||
2684 | f67f164e | humkyung | case ControlType.SingleLine: |
2685 | case ControlType.ArrowLine: |
||
2686 | case ControlType.TwinLine: |
||
2687 | case ControlType.DimLine: |
||
2688 | 787a4489 | KangIngu | { |
2689 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2690 | 787a4489 | KangIngu | { |
2691 | f67f164e | humkyung | if (currentControl is LineControl) |
2692 | { |
||
2693 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2694 | if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2695 | 787a4489 | KangIngu | { |
2696 | f67f164e | humkyung | return; |
2697 | 787a4489 | KangIngu | } |
2698 | f67f164e | humkyung | |
2699 | CreateCommand.Instance.Execute(currentControl); |
||
2700 | currentControl = null; |
||
2701 | this.MainAngle.Visibility = Visibility.Collapsed; |
||
2702 | } |
||
2703 | else |
||
2704 | { |
||
2705 | currentControl = new LineControl |
||
2706 | 787a4489 | KangIngu | { |
2707 | f67f164e | humkyung | ControlType = this.controlType, |
2708 | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
||
2709 | Background = new SolidColorBrush(Colors.Black) |
||
2710 | }; |
||
2711 | 787a4489 | KangIngu | |
2712 | f67f164e | humkyung | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2713 | currentControl.CommentID = Commons.shortGuid(); |
||
2714 | currentControl.IsNew = true; |
||
2715 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2716 | this.MainAngle.Visibility = Visibility.Visible; |
||
2717 | } |
||
2718 | 787a4489 | KangIngu | } |
2719 | } |
||
2720 | break; |
||
2721 | f67f164e | humkyung | case ControlType.PolygonControl: |
2722 | 787a4489 | KangIngu | { |
2723 | f67f164e | humkyung | if (currentControl is PolygonControl) |
2724 | 787a4489 | KangIngu | { |
2725 | f67f164e | humkyung | var control = currentControl as PolygonControl; |
2726 | e66f22eb | KangIngu | |
2727 | f67f164e | humkyung | if (e.RightButton == MouseButtonState.Pressed) |
2728 | { |
||
2729 | control.IsCompleted = true; |
||
2730 | } |
||
2731 | 787a4489 | KangIngu | |
2732 | f67f164e | humkyung | if (!control.IsCompleted) |
2733 | { |
||
2734 | control.PointSet.Add(control.EndPoint); |
||
2735 | } |
||
2736 | else |
||
2737 | { |
||
2738 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2739 | if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2740 | 787a4489 | KangIngu | { |
2741 | f67f164e | humkyung | return; |
2742 | 787a4489 | KangIngu | } |
2743 | e66f22eb | KangIngu | |
2744 | f67f164e | humkyung | var firstPoint = control.PointSet.First(); |
2745 | control.DashSize = ViewerDataModel.Instance.DashSize; |
||
2746 | control.LineSize = ViewerDataModel.Instance.LineSize; |
||
2747 | control.PointSet.Add(firstPoint); |
||
2748 | 787a4489 | KangIngu | |
2749 | f67f164e | humkyung | control.ApplyOverViewData(); |
2750 | |||
2751 | CreateCommand.Instance.Execute(currentControl); |
||
2752 | 0d00f9c8 | humkyung | control.UpdateControl(); |
2753 | f67f164e | humkyung | currentControl = null; |
2754 | } |
||
2755 | 787a4489 | KangIngu | } |
2756 | f67f164e | humkyung | else |
2757 | 787a4489 | KangIngu | { |
2758 | f67f164e | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2759 | { |
||
2760 | currentControl = new PolygonControl |
||
2761 | 787a4489 | KangIngu | { |
2762 | f67f164e | humkyung | PointSet = new List<Point>(), |
2763 | }; |
||
2764 | 787a4489 | KangIngu | |
2765 | f67f164e | humkyung | var polygonControl = (currentControl as PolygonControl); |
2766 | currentControl.CommentID = Commons.shortGuid(); |
||
2767 | currentControl.IsNew = true; |
||
2768 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
2769 | polygonControl.StartPoint = canvasDrawingMouseDownPoint; |
||
2770 | polygonControl.EndPoint = canvasDrawingMouseDownPoint; |
||
2771 | polygonControl.PointSet.Add(canvasDrawingMouseDownPoint); |
||
2772 | polygonControl.PointSet.Add(canvasDrawingMouseDownPoint); |
||
2773 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2774 | polygonControl.ApplyTemplate(); |
||
2775 | polygonControl.Visibility = Visibility.Visible; |
||
2776 | } |
||
2777 | 787a4489 | KangIngu | } |
2778 | } |
||
2779 | break; |
||
2780 | case ControlType.ChainLine: |
||
2781 | { |
||
2782 | if (currentControl is PolygonControl) |
||
2783 | { |
||
2784 | var control = currentControl as PolygonControl; |
||
2785 | |||
2786 | e6a9ddaf | humkyung | if (e.RightButton == MouseButtonState.Pressed) |
2787 | 787a4489 | KangIngu | { |
2788 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
2789 | if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2790 | e66f22eb | KangIngu | { |
2791 | return; |
||
2792 | } |
||
2793 | |||
2794 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2795 | 787a4489 | KangIngu | |
2796 | currentControl = null; |
||
2797 | 2eac4f76 | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
2798 | 787a4489 | KangIngu | return; |
2799 | } |
||
2800 | |||
2801 | if (!control.IsCompleted) |
||
2802 | { |
||
2803 | control.PointSet.Add(control.EndPoint); |
||
2804 | 2eac4f76 | KangIngu | this.MainAngle.Visibility = Visibility.Visible; |
2805 | 787a4489 | KangIngu | } |
2806 | } |
||
2807 | else |
||
2808 | { |
||
2809 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2810 | 787a4489 | KangIngu | { |
2811 | 2eac4f76 | KangIngu | MainAngle.Visibility = Visibility.Visible; |
2812 | 787a4489 | KangIngu | currentControl = new PolygonControl |
2813 | { |
||
2814 | PointSet = new List<Point>(), |
||
2815 | //강인구 추가(ChainLine일때는 채우기 스타일을 주지 않기 위해 설정) |
||
2816 | ControlType = ControlType.ChainLine, |
||
2817 | DashSize = ViewerDataModel.Instance.DashSize, |
||
2818 | LineSize = ViewerDataModel.Instance.LineSize, |
||
2819 | //PointC = new StylusPointSet() |
||
2820 | }; |
||
2821 | |||
2822 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
2823 | //{ |
||
2824 | 787a4489 | KangIngu | var polygonControl = (currentControl as PolygonControl); |
2825 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2826 | 787a4489 | KangIngu | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2827 | currentControl.IsNew = true; |
||
2828 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2829 | //currentControl.OnApplyTemplate(); |
||
2830 | //polygonControl.PointC.pointSet.Add(canvasDrawingMouseDownPoint); |
||
2831 | //polygonControl.PointC.pointSet.Add(canvasDrawingMouseDownPoint); |
||
2832 | polygonControl.PointSet.Add(canvasDrawingMouseDownPoint); |
||
2833 | polygonControl.PointSet.Add(canvasDrawingMouseDownPoint); |
||
2834 | e66f22eb | KangIngu | //} |
2835 | 787a4489 | KangIngu | } |
2836 | } |
||
2837 | } |
||
2838 | break; |
||
2839 | case ControlType.ArcLine: |
||
2840 | { |
||
2841 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2842 | 787a4489 | KangIngu | { |
2843 | f67f164e | humkyung | if (currentControl is ArcControl) |
2844 | { |
||
2845 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2846 | if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2847 | 787a4489 | KangIngu | { |
2848 | f67f164e | humkyung | return; |
2849 | } |
||
2850 | e66f22eb | KangIngu | |
2851 | f67f164e | humkyung | CreateCommand.Instance.Execute(currentControl); |
2852 | 787a4489 | KangIngu | |
2853 | f67f164e | humkyung | currentControl = null; |
2854 | this.MainAngle.Visibility = Visibility.Collapsed; |
||
2855 | } |
||
2856 | else |
||
2857 | { |
||
2858 | currentControl = new ArcControl |
||
2859 | 787a4489 | KangIngu | { |
2860 | f67f164e | humkyung | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
2861 | Background = new SolidColorBrush(Colors.Black) |
||
2862 | }; |
||
2863 | currentControl.CommentID = Commons.shortGuid(); |
||
2864 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
2865 | currentControl.IsNew = true; |
||
2866 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2867 | this.MainAngle.Visibility = Visibility.Visible; |
||
2868 | } |
||
2869 | 787a4489 | KangIngu | } |
2870 | e6a9ddaf | humkyung | else if (e.RightButton == MouseButtonState.Pressed) |
2871 | 787a4489 | KangIngu | { |
2872 | if (currentControl != null) |
||
2873 | { |
||
2874 | (currentControl as ArcControl).setClock(); |
||
2875 | 05f4d127 | KangIngu | (currentControl as ArcControl).MidPoint = new Point(0, 0); |
2876 | 787a4489 | KangIngu | } |
2877 | } |
||
2878 | } |
||
2879 | break; |
||
2880 | case ControlType.ArcArrow: |
||
2881 | { |
||
2882 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2883 | 787a4489 | KangIngu | { |
2884 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
2885 | //{ |
||
2886 | 40b3ce25 | ljiyeon | if (currentControl is ArrowArcControl) |
2887 | { |
||
2888 | //20180906 LJY TEST IsRotationDrawingEnable |
||
2889 | if (IsGetoutpoint((currentControl as ArrowArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2890 | 787a4489 | KangIngu | { |
2891 | 40b3ce25 | ljiyeon | return; |
2892 | } |
||
2893 | e66f22eb | KangIngu | |
2894 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2895 | 787a4489 | KangIngu | |
2896 | 40b3ce25 | ljiyeon | currentControl = null; |
2897 | this.MainAngle.Visibility = Visibility.Collapsed; |
||
2898 | } |
||
2899 | else |
||
2900 | { |
||
2901 | currentControl = new ArrowArcControl |
||
2902 | 787a4489 | KangIngu | { |
2903 | a6272c57 | humkyung | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
2904 | 40b3ce25 | ljiyeon | Background = new SolidColorBrush(Colors.Black) |
2905 | }; |
||
2906 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2907 | 40b3ce25 | ljiyeon | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2908 | currentControl.IsNew = true; |
||
2909 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2910 | this.MainAngle.Visibility = Visibility.Visible; |
||
2911 | } |
||
2912 | e66f22eb | KangIngu | //} |
2913 | 787a4489 | KangIngu | } |
2914 | e6a9ddaf | humkyung | else if (e.RightButton == MouseButtonState.Pressed) |
2915 | 787a4489 | KangIngu | { |
2916 | 40b3ce25 | ljiyeon | if (currentControl != null) |
2917 | { |
||
2918 | (currentControl as ArrowArcControl).setClock(); |
||
2919 | (currentControl as ArrowArcControl).MidPoint = new Point(0, 0); |
||
2920 | //(currentControl as ArcControl).ApplyTemplate(); |
||
2921 | } |
||
2922 | 787a4489 | KangIngu | } |
2923 | } |
||
2924 | break; |
||
2925 | case ControlType.ArrowMultiLine: |
||
2926 | { |
||
2927 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
2928 | 787a4489 | KangIngu | { |
2929 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
2930 | //{ |
||
2931 | 787a4489 | KangIngu | |
2932 | if (currentControl is ArrowControl_Multi) |
||
2933 | { |
||
2934 | var content = currentControl as ArrowControl_Multi; |
||
2935 | if (content.MiddlePoint == new Point(0, 0)) |
||
2936 | { |
||
2937 | 2eac4f76 | KangIngu | if (ViewerDataModel.Instance.checkAxis || ViewerDataModel.Instance.IsPressShift) |
2938 | { |
||
2939 | content.MiddlePoint = content.EndPoint; |
||
2940 | } |
||
2941 | else |
||
2942 | { |
||
2943 | content.MiddlePoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y); |
||
2944 | } |
||
2945 | 787a4489 | KangIngu | } |
2946 | else |
||
2947 | { |
||
2948 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
2949 | if (IsGetoutpoint((currentControl as ArrowControl_Multi).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2950 | e66f22eb | KangIngu | { |
2951 | return; |
||
2952 | } |
||
2953 | |||
2954 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
2955 | 787a4489 | KangIngu | |
2956 | currentControl = null; |
||
2957 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
2958 | 787a4489 | KangIngu | } |
2959 | } |
||
2960 | else |
||
2961 | { |
||
2962 | currentControl = new ArrowControl_Multi |
||
2963 | { |
||
2964 | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
||
2965 | Background = new SolidColorBrush(Colors.Black) |
||
2966 | }; |
||
2967 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
2968 | 787a4489 | KangIngu | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
2969 | currentControl.IsNew = true; |
||
2970 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
2971 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Visible; |
2972 | 787a4489 | KangIngu | } |
2973 | e66f22eb | KangIngu | //} |
2974 | 787a4489 | KangIngu | } |
2975 | } |
||
2976 | break; |
||
2977 | case ControlType.PolygonCloud: |
||
2978 | { |
||
2979 | if (currentControl is CloudControl) |
||
2980 | { |
||
2981 | var control = currentControl as CloudControl; |
||
2982 | e6a9ddaf | humkyung | if (e.RightButton == MouseButtonState.Pressed) |
2983 | 787a4489 | KangIngu | { |
2984 | control.IsCompleted = true; |
||
2985 | } |
||
2986 | |||
2987 | if (!control.IsCompleted) |
||
2988 | { |
||
2989 | control.PointSet.Add(control.EndPoint); |
||
2990 | } |
||
2991 | else |
||
2992 | { |
||
2993 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
2994 | if (IsGetoutpoint((currentControl as CloudControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
2995 | e66f22eb | KangIngu | { |
2996 | return; |
||
2997 | } |
||
2998 | |||
2999 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3000 | 787a4489 | KangIngu | |
3001 | control.isTransOn = true; |
||
3002 | var firstPoint = control.PointSet.First(); |
||
3003 | |||
3004 | control.PointSet.Add(firstPoint); |
||
3005 | control.DrawingCloud(); |
||
3006 | control.ApplyOverViewData(); |
||
3007 | |||
3008 | currentControl = null; |
||
3009 | } |
||
3010 | } |
||
3011 | else |
||
3012 | { |
||
3013 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3014 | 787a4489 | KangIngu | { |
3015 | currentControl = new CloudControl |
||
3016 | { |
||
3017 | PointSet = new List<Point>(), |
||
3018 | PointC = new StylusPointSet() |
||
3019 | }; |
||
3020 | |||
3021 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3022 | //{ |
||
3023 | 787a4489 | KangIngu | var polygonControl = (currentControl as CloudControl); |
3024 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3025 | 787a4489 | KangIngu | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3026 | currentControl.IsNew = true; |
||
3027 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3028 | |||
3029 | polygonControl.PointSet.Add(canvasDrawingMouseDownPoint); |
||
3030 | polygonControl.PointSet.Add(canvasDrawingMouseDownPoint); |
||
3031 | b9ce7aee | ljiyeon | |
3032 | e66f22eb | KangIngu | //} |
3033 | 787a4489 | KangIngu | } |
3034 | } |
||
3035 | } |
||
3036 | break; |
||
3037 | case ControlType.ImgControl: |
||
3038 | { |
||
3039 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3040 | 787a4489 | KangIngu | { |
3041 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3042 | //{ |
||
3043 | 787a4489 | KangIngu | if (currentControl is ImgControl) |
3044 | { |
||
3045 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3046 | if (IsGetoutpoint((currentControl as ImgControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3047 | e66f22eb | KangIngu | { |
3048 | return; |
||
3049 | } |
||
3050 | |||
3051 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3052 | 53880c83 | ljiyeon | controlType = ControlType.ImgControl; |
3053 | 787a4489 | KangIngu | currentControl = null; |
3054 | } |
||
3055 | else |
||
3056 | { |
||
3057 | c73426a9 | ljiyeon | |
3058 | 787a4489 | KangIngu | string extension = System.IO.Path.GetExtension(filename).ToUpper(); |
3059 | 53880c83 | ljiyeon | if (extension == ".PNG" || extension == ".JPEG" || extension == ".GIF" || extension == ".BMP" || extension == ".JPG" || extension == ".SVG") |
3060 | 787a4489 | KangIngu | { |
3061 | Image img = new Image(); |
||
3062 | 53880c83 | ljiyeon | if (filename.Contains(".svg")) |
3063 | { |
||
3064 | byte[] imageData = null; |
||
3065 | DrawingImage image = null; |
||
3066 | using (System.Net.WebClient web = new System.Net.WebClient()) |
||
3067 | { |
||
3068 | imageData = web.DownloadData(new Uri(filename)); |
||
3069 | System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
||
3070 | image = SvgReader.Load(stream); |
||
3071 | } |
||
3072 | img.Source = image; |
||
3073 | } |
||
3074 | else |
||
3075 | { |
||
3076 | img.Source = new BitmapImage(new Uri(filename)); |
||
3077 | } |
||
3078 | 787a4489 | KangIngu | |
3079 | currentControl = new ImgControl |
||
3080 | { |
||
3081 | 53880c83 | ljiyeon | Background = new SolidColorBrush(Colors.Black), |
3082 | PointSet = new List<Point>(), |
||
3083 | FilePath = filename, |
||
3084 | ImageData = img.Source, |
||
3085 | StartPoint = canvasDrawingMouseDownPoint, |
||
3086 | EndPoint = new Point(canvasDrawingMouseDownPoint.X + 100, canvasDrawingMouseDownPoint.Y + 100), |
||
3087 | TopRightPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y + 100), |
||
3088 | LeftBottomPoint = new Point(canvasDrawingMouseDownPoint.X + 100, canvasDrawingMouseDownPoint.Y), |
||
3089 | ControlType = ControlType.ImgControl |
||
3090 | }; |
||
3091 | |||
3092 | |||
3093 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3094 | 53880c83 | ljiyeon | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3095 | currentControl.IsNew = true; |
||
3096 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3097 | |||
3098 | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
||
3099 | (currentControl as ImgControl).Angle -= rotate.Angle; |
||
3100 | } |
||
3101 | 787a4489 | KangIngu | } |
3102 | e66f22eb | KangIngu | //} |
3103 | 787a4489 | KangIngu | } |
3104 | } |
||
3105 | break; |
||
3106 | case ControlType.Date: |
||
3107 | { |
||
3108 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3109 | 787a4489 | KangIngu | { |
3110 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3111 | //{ |
||
3112 | 787a4489 | KangIngu | if (currentControl is DateControl) |
3113 | { |
||
3114 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3115 | if (IsGetoutpoint((currentControl as DateControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3116 | e66f22eb | KangIngu | { |
3117 | return; |
||
3118 | } |
||
3119 | |||
3120 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3121 | 787a4489 | KangIngu | currentControl = null; |
3122 | |||
3123 | if (Common.ViewerDataModel.Instance.SelectedControl == "Batch") |
||
3124 | { |
||
3125 | controlType = ControlType.None; |
||
3126 | IsSwingMode = false; |
||
3127 | Common.ViewerDataModel.Instance.SelectedControl = ""; |
||
3128 | Common.ViewerDataModel.Instance.ControlTag = null; |
||
3129 | mouseHandlingMode = MouseHandlingMode.None; |
||
3130 | this.ParentOfType<MainWindow>().dzTopMenu.btn_Batch.IsChecked = false; |
||
3131 | txtBatch.Visibility = Visibility.Collapsed; |
||
3132 | |||
3133 | } |
||
3134 | } |
||
3135 | else |
||
3136 | { |
||
3137 | currentControl = new DateControl |
||
3138 | { |
||
3139 | a6272c57 | humkyung | StartPoint = canvasDrawingMouseDownPoint, |
3140 | 787a4489 | KangIngu | Background = new SolidColorBrush(Colors.Black) |
3141 | }; |
||
3142 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3143 | 787a4489 | KangIngu | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3144 | currentControl.IsNew = true; |
||
3145 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3146 | ca40e004 | ljiyeon | |
3147 | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
||
3148 | (currentControl as DateControl).Angle -= rotate.Angle; |
||
3149 | } |
||
3150 | e66f22eb | KangIngu | //} |
3151 | 787a4489 | KangIngu | } |
3152 | } |
||
3153 | break; |
||
3154 | case ControlType.TextControl: |
||
3155 | { |
||
3156 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3157 | 787a4489 | KangIngu | { |
3158 | if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
||
3159 | { |
||
3160 | currentControl = new TextControl |
||
3161 | { |
||
3162 | ControlType = controlType |
||
3163 | }; |
||
3164 | 610a4b86 | KangIngu | (currentControl as TextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3165 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3166 | 8742caa5 | humkyung | currentControl.IsNew = true; |
3167 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3168 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3169 | 1066bae3 | ljiyeon | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
3170 | |||
3171 | 8742caa5 | humkyung | currentControl.SetValue(TextControl.CanvasXProperty, canvasDrawingMouseDownPoint.X); |
3172 | currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y); |
||
3173 | 6b5d33c6 | djkim | |
3174 | 8742caa5 | humkyung | (currentControl as TextControl).ControlType_No = 0; |
3175 | (currentControl as TextControl).Angle -= rotate.Angle; |
||
3176 | (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3177 | 6b5d33c6 | djkim | (currentControl as TextControl).ApplyTemplate(); |
3178 | (currentControl as TextControl).Base_TextBox.Focus(); |
||
3179 | 787a4489 | KangIngu | |
3180 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3181 | 787a4489 | KangIngu | } |
3182 | } |
||
3183 | } |
||
3184 | break; |
||
3185 | case ControlType.TextBorder: |
||
3186 | { |
||
3187 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3188 | 787a4489 | KangIngu | { |
3189 | if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
||
3190 | { |
||
3191 | currentControl = new TextControl |
||
3192 | { |
||
3193 | ControlType = controlType |
||
3194 | }; |
||
3195 | |||
3196 | 610a4b86 | KangIngu | (currentControl as TextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3197 | 787a4489 | KangIngu | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3198 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3199 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3200 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3201 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3202 | currentControl.SetValue(TextControl.CanvasXProperty, canvasDrawingMouseDownPoint.X); |
||
3203 | currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y); |
||
3204 | 6b5d33c6 | djkim | |
3205 | 787a4489 | KangIngu | (currentControl as TextControl).ControlType_No = 1; |
3206 | (currentControl as TextControl).Angle = Ang; |
||
3207 | (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3208 | 6b5d33c6 | djkim | (currentControl as TextControl).ApplyTemplate(); |
3209 | (currentControl as TextControl).Base_TextBox.Focus(); |
||
3210 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3211 | 787a4489 | KangIngu | } |
3212 | } |
||
3213 | } |
||
3214 | break; |
||
3215 | case ControlType.TextCloud: |
||
3216 | { |
||
3217 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3218 | 787a4489 | KangIngu | { |
3219 | if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
||
3220 | { |
||
3221 | currentControl = new TextControl |
||
3222 | { |
||
3223 | ControlType = controlType |
||
3224 | }; |
||
3225 | 610a4b86 | KangIngu | |
3226 | (currentControl as TextControl).TextSize = ViewerDataModel.Instance.TextSize; |
||
3227 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3228 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3229 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3230 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3231 | |||
3232 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3233 | currentControl.SetValue(TextControl.CanvasXProperty, canvasDrawingMouseDownPoint.X); |
||
3234 | 6b5d33c6 | djkim | currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y); |
3235 | 787a4489 | KangIngu | |
3236 | (currentControl as TextControl).Angle = Ang; |
||
3237 | (currentControl as TextControl).ControlType_No = 2; |
||
3238 | (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3239 | 6b5d33c6 | djkim | (currentControl as TextControl).ApplyTemplate(); |
3240 | (currentControl as TextControl).Base_TextBox.Focus(); |
||
3241 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3242 | 49b217ad | humkyung | //currentControl = null; |
3243 | 787a4489 | KangIngu | } |
3244 | } |
||
3245 | } |
||
3246 | break; |
||
3247 | case ControlType.ArrowTextControl: |
||
3248 | ca40e004 | ljiyeon | { |
3249 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3250 | 787a4489 | KangIngu | { |
3251 | if (currentControl is ArrowTextControl) |
||
3252 | { |
||
3253 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3254 | if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3255 | e66f22eb | KangIngu | { |
3256 | return; |
||
3257 | f513c215 | humkyung | } |
3258 | e66f22eb | KangIngu | |
3259 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3260 | 787a4489 | KangIngu | |
3261 | (currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
||
3262 | (currentControl as ArrowTextControl).EnableEditing = false; |
||
3263 | 49b217ad | humkyung | (currentControl as ArrowTextControl).IsNew = false; |
3264 | 787a4489 | KangIngu | currentControl = null; |
3265 | } |
||
3266 | else |
||
3267 | { |
||
3268 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3269 | //{ |
||
3270 | 787a4489 | KangIngu | currentControl = new ArrowTextControl(); |
3271 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3272 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3273 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3274 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3275 | |||
3276 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3277 | currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
||
3278 | currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
||
3279 | 610a4b86 | KangIngu | (currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3280 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
3281 | |||
3282 | ca40e004 | ljiyeon | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3283 | (currentControl as ArrowTextControl).Angle -= rotate.Angle; |
||
3284 | 787a4489 | KangIngu | |
3285 | ca40e004 | ljiyeon | (currentControl as ArrowTextControl).ApplyTemplate(); |
3286 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3287 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Visible; |
3288 | ca40e004 | ljiyeon | |
3289 | |||
3290 | e66f22eb | KangIngu | //} |
3291 | 787a4489 | KangIngu | } |
3292 | } |
||
3293 | } |
||
3294 | break; |
||
3295 | case ControlType.ArrowTransTextControl: |
||
3296 | { |
||
3297 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3298 | 787a4489 | KangIngu | { |
3299 | if (currentControl is ArrowTextControl) |
||
3300 | { |
||
3301 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3302 | if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3303 | e66f22eb | KangIngu | { |
3304 | return; |
||
3305 | f513c215 | humkyung | } |
3306 | e66f22eb | KangIngu | |
3307 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3308 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
3309 | 49b217ad | humkyung | currentControl.IsNew = false; |
3310 | 787a4489 | KangIngu | currentControl = null; |
3311 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
3312 | 787a4489 | KangIngu | } |
3313 | else |
||
3314 | { |
||
3315 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3316 | //{ |
||
3317 | 120b8b00 | 송근호 | currentControl = new ArrowTextControl() |
3318 | { |
||
3319 | ControlType = ControlType.ArrowTransTextControl |
||
3320 | }; |
||
3321 | currentControl.CommentID = Commons.shortGuid(); |
||
3322 | currentControl.IsNew = true; |
||
3323 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3324 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3325 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3326 | currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
||
3327 | currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
||
3328 | (currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
||
3329 | (currentControl as ArrowTextControl).isFixed = true; |
||
3330 | (currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3331 | 787a4489 | KangIngu | |
3332 | 120b8b00 | 송근호 | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3333 | (currentControl as ArrowTextControl).Angle -= rotate.Angle; |
||
3334 | ca40e004 | ljiyeon | |
3335 | 120b8b00 | 송근호 | (currentControl as ArrowTextControl).ApplyTemplate(); |
3336 | (currentControl as ArrowTextControl).Base_TextBox.Focus(); |
||
3337 | (currentControl as ArrowTextControl).isTrans = true; |
||
3338 | 787a4489 | KangIngu | } |
3339 | } |
||
3340 | } |
||
3341 | break; |
||
3342 | case ControlType.ArrowTextBorderControl: |
||
3343 | ca40e004 | ljiyeon | { |
3344 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3345 | 787a4489 | KangIngu | { |
3346 | if (currentControl is ArrowTextControl) |
||
3347 | { |
||
3348 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3349 | if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3350 | e66f22eb | KangIngu | { |
3351 | return; |
||
3352 | } |
||
3353 | |||
3354 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3355 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
3356 | 49b217ad | humkyung | currentControl.IsNew = false; |
3357 | 787a4489 | KangIngu | currentControl = null; |
3358 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
3359 | 787a4489 | KangIngu | } |
3360 | else |
||
3361 | { |
||
3362 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3363 | //{ |
||
3364 | 787a4489 | KangIngu | currentControl = new ArrowTextControl() |
3365 | { |
||
3366 | ArrowTextStyle = MarkupToPDF.Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect |
||
3367 | }; |
||
3368 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3369 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3370 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3371 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3372 | |||
3373 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3374 | |||
3375 | currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
||
3376 | |||
3377 | currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
||
3378 | (currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3379 | 610a4b86 | KangIngu | (currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3380 | 787a4489 | KangIngu | |
3381 | ca40e004 | ljiyeon | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3382 | (currentControl as ArrowTextControl).Angle -= rotate.Angle; |
||
3383 | (currentControl as ArrowTextControl).ApplyTemplate(); |
||
3384 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3385 | ca40e004 | ljiyeon | this.MainAngle.Visibility = Visibility.Visible; |
3386 | e66f22eb | KangIngu | //} |
3387 | 787a4489 | KangIngu | } |
3388 | } |
||
3389 | } |
||
3390 | break; |
||
3391 | case ControlType.ArrowTransTextBorderControl: |
||
3392 | { |
||
3393 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3394 | 787a4489 | KangIngu | { |
3395 | if (currentControl is ArrowTextControl) |
||
3396 | { |
||
3397 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3398 | if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3399 | e66f22eb | KangIngu | { |
3400 | return; |
||
3401 | } |
||
3402 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3403 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
3404 | 49b217ad | humkyung | currentControl.IsNew = false; |
3405 | 787a4489 | KangIngu | currentControl = null; |
3406 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
3407 | 787a4489 | KangIngu | } |
3408 | else |
||
3409 | { |
||
3410 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3411 | //{ |
||
3412 | ca40e004 | ljiyeon | |
3413 | |||
3414 | currentControl = new ArrowTextControl() |
||
3415 | 120b8b00 | 송근호 | { |
3416 | ArrowTextStyle = MarkupToPDF.Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect, |
||
3417 | ControlType = ControlType.ArrowTransTextBorderControl |
||
3418 | |||
3419 | }; |
||
3420 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3421 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3422 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3423 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3424 | |||
3425 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3426 | |||
3427 | currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
||
3428 | ca40e004 | ljiyeon | currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
3429 | 610a4b86 | KangIngu | (currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3430 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).isFixed = true; |
3431 | (currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3432 | ca40e004 | ljiyeon | |
3433 | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
||
3434 | (currentControl as ArrowTextControl).Angle -= rotate.Angle; |
||
3435 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).ApplyTemplate(); |
3436 | |||
3437 | ca40e004 | ljiyeon | (currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3438 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Visible; |
3439 | ca40e004 | ljiyeon | |
3440 | //20180911 LJY |
||
3441 | (currentControl as ArrowTextControl).isTrans = true; |
||
3442 | |||
3443 | |||
3444 | e66f22eb | KangIngu | //} |
3445 | 787a4489 | KangIngu | } |
3446 | } |
||
3447 | } |
||
3448 | break; |
||
3449 | case ControlType.ArrowTextCloudControl: |
||
3450 | { |
||
3451 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3452 | 787a4489 | KangIngu | { |
3453 | if (currentControl is ArrowTextControl) |
||
3454 | { |
||
3455 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3456 | if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3457 | e66f22eb | KangIngu | { |
3458 | return; |
||
3459 | } |
||
3460 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3461 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
3462 | 49b217ad | humkyung | currentControl.IsNew = false; |
3463 | 787a4489 | KangIngu | currentControl = null; |
3464 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
3465 | 787a4489 | KangIngu | } |
3466 | else |
||
3467 | { |
||
3468 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3469 | //{ |
||
3470 | 787a4489 | KangIngu | currentControl = new ArrowTextControl() |
3471 | { |
||
3472 | ArrowTextStyle = MarkupToPDF.Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud |
||
3473 | }; |
||
3474 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3475 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3476 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3477 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3478 | |||
3479 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3480 | currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
||
3481 | ca40e004 | ljiyeon | currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
3482 | 610a4b86 | KangIngu | (currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3483 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
3484 | |||
3485 | ca40e004 | ljiyeon | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3486 | (currentControl as ArrowTextControl).Angle -= rotate.Angle; |
||
3487 | |||
3488 | (currentControl as ArrowTextControl).ApplyTemplate(); |
||
3489 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3490 | ca40e004 | ljiyeon | this.MainAngle.Visibility = Visibility.Visible; |
3491 | e66f22eb | KangIngu | //} |
3492 | 787a4489 | KangIngu | } |
3493 | } |
||
3494 | } |
||
3495 | break; |
||
3496 | case ControlType.ArrowTransTextCloudControl: |
||
3497 | { |
||
3498 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3499 | 787a4489 | KangIngu | { |
3500 | if (currentControl is ArrowTextControl) |
||
3501 | { |
||
3502 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3503 | if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3504 | e66f22eb | KangIngu | { |
3505 | return; |
||
3506 | } |
||
3507 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3508 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
3509 | 49b217ad | humkyung | currentControl.IsNew = false; |
3510 | 787a4489 | KangIngu | currentControl = null; |
3511 | 5ce56a3a | KangIngu | this.MainAngle.Visibility = Visibility.Collapsed; |
3512 | 787a4489 | KangIngu | } |
3513 | else |
||
3514 | { |
||
3515 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3516 | //{ |
||
3517 | 787a4489 | KangIngu | currentControl = new ArrowTextControl() |
3518 | { |
||
3519 | 120b8b00 | 송근호 | ArrowTextStyle = MarkupToPDF.Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud, |
3520 | ControlType = ControlType.ArrowTransTextCloudControl |
||
3521 | |||
3522 | 787a4489 | KangIngu | }; |
3523 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3524 | ca40e004 | ljiyeon | currentControl.IsNew = true; |
3525 | 787a4489 | KangIngu | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3526 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3527 | currentControl.SetValue(Canvas.ZIndexProperty, 3); |
||
3528 | |||
3529 | currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
||
3530 | ca40e004 | ljiyeon | currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
3531 | 610a4b86 | KangIngu | (currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3532 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).isFixed = true; |
3533 | (currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
||
3534 | |||
3535 | ca40e004 | ljiyeon | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3536 | (currentControl as ArrowTextControl).Angle -= rotate.Angle; |
||
3537 | 787a4489 | KangIngu | |
3538 | ca40e004 | ljiyeon | (currentControl as ArrowTextControl).ApplyTemplate(); |
3539 | 787a4489 | KangIngu | (currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3540 | ca40e004 | ljiyeon | this.MainAngle.Visibility = Visibility.Visible; |
3541 | |||
3542 | //20180911 LJY |
||
3543 | (currentControl as ArrowTextControl).isTrans = true; |
||
3544 | e66f22eb | KangIngu | //} |
3545 | 787a4489 | KangIngu | } |
3546 | } |
||
3547 | } |
||
3548 | break; |
||
3549 | //강인구 추가 |
||
3550 | case ControlType.Sign: |
||
3551 | { |
||
3552 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3553 | 787a4489 | KangIngu | { |
3554 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3555 | //{ |
||
3556 | 661b7416 | humkyung | var _sign = GetUserSign.GetSign(App.ViewInfo.UserID, App.ViewInfo.ProjectNO); |
3557 | 992a98b4 | KangIngu | |
3558 | if (_sign == null) |
||
3559 | { |
||
3560 | txtBatch.Visibility = Visibility.Collapsed; |
||
3561 | mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
3562 | controlType = ControlType.None; |
||
3563 | |||
3564 | this.ParentOfType<MainWindow>().DialogMessage_Alert("등록된 Sign이 없습니다.", "Alert"); |
||
3565 | this.ParentOfType<MainWindow>().ChildrenOfType<RadToggleButton>().Where(data => data.IsChecked == true).FirstOrDefault().IsChecked = false; |
||
3566 | return; |
||
3567 | } |
||
3568 | |||
3569 | 787a4489 | KangIngu | if (currentControl is SignControl) |
3570 | { |
||
3571 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3572 | if (IsGetoutpoint((currentControl as SignControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3573 | e66f22eb | KangIngu | { |
3574 | return; |
||
3575 | } |
||
3576 | |||
3577 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3578 | 787a4489 | KangIngu | currentControl = null; |
3579 | if (Common.ViewerDataModel.Instance.SelectedControl == "Batch") |
||
3580 | { |
||
3581 | 999c9e40 | humkyung | txtBatch.Text = "Place Date"; |
3582 | 787a4489 | KangIngu | controlType = ControlType.Date; |
3583 | } |
||
3584 | } |
||
3585 | else |
||
3586 | { |
||
3587 | currentControl = new SignControl |
||
3588 | { |
||
3589 | Background = new SolidColorBrush(Colors.Black), |
||
3590 | UserNumber = App.ViewInfo.UserID, |
||
3591 | a6272c57 | humkyung | ProjectNO = App.ViewInfo.ProjectNO, |
3592 | 787a4489 | KangIngu | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
3593 | EndPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
||
3594 | ControlType = ControlType.Sign |
||
3595 | }; |
||
3596 | |||
3597 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3598 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3599 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3600 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3601 | ca40e004 | ljiyeon | |
3602 | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
||
3603 | (currentControl as SignControl).Angle -= rotate.Angle; |
||
3604 | } |
||
3605 | e66f22eb | KangIngu | //} |
3606 | 787a4489 | KangIngu | } |
3607 | } |
||
3608 | break; |
||
3609 | case ControlType.Mark: |
||
3610 | { |
||
3611 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3612 | 787a4489 | KangIngu | { |
3613 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3614 | //{ |
||
3615 | 787a4489 | KangIngu | if (currentControl is RectangleControl) |
3616 | { |
||
3617 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3618 | if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3619 | e66f22eb | KangIngu | { |
3620 | return; |
||
3621 | } |
||
3622 | |||
3623 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3624 | 787a4489 | KangIngu | (currentControl as RectangleControl).ApplyOverViewData(); |
3625 | currentControl = null; |
||
3626 | 510cbd2a | ljiyeon | |
3627 | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
||
3628 | 787a4489 | KangIngu | |
3629 | if (Common.ViewerDataModel.Instance.SelectedControl == "Batch") |
||
3630 | { |
||
3631 | 999c9e40 | humkyung | txtBatch.Text = "Place Signature"; |
3632 | 787a4489 | KangIngu | controlType = ControlType.Sign; |
3633 | } |
||
3634 | } |
||
3635 | else |
||
3636 | { |
||
3637 | currentControl = new RectangleControl |
||
3638 | { |
||
3639 | a6272c57 | humkyung | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
3640 | 787a4489 | KangIngu | Background = new SolidColorBrush(Colors.Black), |
3641 | a6272c57 | humkyung | ControlType = ControlType.Mark , |
3642 | 787a4489 | KangIngu | Paint = PaintSet.Fill |
3643 | }; |
||
3644 | |||
3645 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3646 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3647 | 787a4489 | KangIngu | currentControl.IsNew = true; |
3648 | (currentControl as RectangleControl).DashSize = ViewerDataModel.Instance.DashSize; |
||
3649 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3650 | } |
||
3651 | e66f22eb | KangIngu | //} |
3652 | 787a4489 | KangIngu | } |
3653 | } |
||
3654 | break; |
||
3655 | case ControlType.Symbol: |
||
3656 | { |
||
3657 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3658 | 787a4489 | KangIngu | { |
3659 | a6272c57 | humkyung | if (currentControl is SymControl) |
3660 | { |
||
3661 | //20180906 LJY TEST IsRotationDrawingEnable |
||
3662 | if (IsGetoutpoint((currentControl as SymControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3663 | 787a4489 | KangIngu | { |
3664 | a6272c57 | humkyung | return; |
3665 | 787a4489 | KangIngu | } |
3666 | a6272c57 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3667 | currentControl = null; |
||
3668 | |||
3669 | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
||
3670 | } |
||
3671 | else |
||
3672 | { |
||
3673 | currentControl = new SymControl |
||
3674 | 787a4489 | KangIngu | { |
3675 | a6272c57 | humkyung | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
3676 | Background = new SolidColorBrush(Colors.Black), |
||
3677 | LineSize = ViewerDataModel.Instance.LineSize + 3, |
||
3678 | ControlType = ControlType.Symbol |
||
3679 | }; |
||
3680 | 787a4489 | KangIngu | |
3681 | a6272c57 | humkyung | currentControl.IsNew = true; |
3682 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3683 | currentControl.CommentID = Commons.shortGuid(); |
||
3684 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
||
3685 | ca40e004 | ljiyeon | |
3686 | a6272c57 | humkyung | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3687 | (currentControl as SymControl).Angle -= rotate.Angle; |
||
3688 | ca40e004 | ljiyeon | } |
3689 | e66f22eb | KangIngu | //} |
3690 | 787a4489 | KangIngu | } |
3691 | } |
||
3692 | break; |
||
3693 | case ControlType.Stamp: |
||
3694 | { |
||
3695 | e6a9ddaf | humkyung | if (e.LeftButton == MouseButtonState.Pressed) |
3696 | 787a4489 | KangIngu | { |
3697 | e66f22eb | KangIngu | //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3698 | //{ |
||
3699 | 787a4489 | KangIngu | if (currentControl is SymControlN) |
3700 | { |
||
3701 | ca40e004 | ljiyeon | //20180906 LJY TEST IsRotationDrawingEnable |
3702 | if (IsGetoutpoint((currentControl as SymControlN).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
||
3703 | e66f22eb | KangIngu | { |
3704 | return; |
||
3705 | } |
||
3706 | |||
3707 | f513c215 | humkyung | CreateCommand.Instance.Execute(currentControl); |
3708 | 787a4489 | KangIngu | currentControl = null; |
3709 | 510cbd2a | ljiyeon | |
3710 | |||
3711 | this.cursor = new Cursor(MainWindow.CursorChange().StreamSource); |
||
3712 | 787a4489 | KangIngu | } |
3713 | else |
||
3714 | { |
||
3715 | currentControl = new SymControlN |
||
3716 | { |
||
3717 | StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y), |
||
3718 | Background = new SolidColorBrush(Colors.Black), |
||
3719 | a6272c57 | humkyung | STAMP = App.SystemInfo.STAMP, |
3720 | 787a4489 | KangIngu | ControlType = ControlType.Stamp |
3721 | }; |
||
3722 | |||
3723 | currentControl.IsNew = true; |
||
3724 | currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
||
3725 | 24678e06 | humkyung | currentControl.CommentID = Commons.shortGuid(); |
3726 | 787a4489 | KangIngu | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
3727 | ca40e004 | ljiyeon | //20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
3728 | (currentControl as SymControlN).Angle -= rotate.Angle; |
||
3729 | } |
||
3730 | e66f22eb | KangIngu | //} |
3731 | 787a4489 | KangIngu | } |
3732 | } |
||
3733 | break; |
||
3734 | case ControlType.PenControl: |
||
3735 | { |
||
3736 | if (inkBoard.Tag.ToString() == "Ink") |
||
3737 | { |
||
3738 | inkBoard.IsEnabled = true; |
||
3739 | StartNewStroke(canvasDrawingMouseDownPoint); |
||
3740 | } |
||
3741 | else if (inkBoard.Tag.ToString() == "EraseByPoint") |
||
3742 | { |
||
3743 | RemovePointStroke(canvasDrawingMouseDownPoint); |
||
3744 | } |
||
3745 | else if (inkBoard.Tag.ToString() == "EraseByStroke") |
||
3746 | { |
||
3747 | RemoveLineStroke(canvasDrawingMouseDownPoint); |
||
3748 | } |
||
3749 | IsDrawing = true; |
||
3750 | return; |
||
3751 | } |
||
3752 | default: |
||
3753 | if (currentControl != null) |
||
3754 | { |
||
3755 | currentControl.CommentID = null; |
||
3756 | currentControl.IsNew = false; |
||
3757 | } |
||
3758 | break; |
||
3759 | } |
||
3760 | } |
||
3761 | e6a9ddaf | humkyung | if (mouseHandlingMode != MouseHandlingMode.None && e.LeftButton == MouseButtonState.Pressed) |
3762 | 787a4489 | KangIngu | { |
3763 | if (mouseHandlingMode == MouseHandlingMode.Adorner && SelectLayer.Children.Count > 0) |
||
3764 | { |
||
3765 | bool mouseOff = false; |
||
3766 | foreach (var item in SelectLayer.Children) |
||
3767 | { |
||
3768 | if (item is AdornerFinal) |
||
3769 | { |
||
3770 | |||
3771 | 4913851c | humkyung | var over = (item as AdornerFinal).Members.Where(data => data.DrawingData.IsMouseOver).FirstOrDefault(); |
3772 | 787a4489 | KangIngu | if (over != null) |
3773 | { |
||
3774 | mouseOff = true; |
||
3775 | } |
||
3776 | } |
||
3777 | } |
||
3778 | |||
3779 | if (!mouseOff) |
||
3780 | { |
||
3781 | 077896be | humkyung | SelectionSet.Instance.UnSelect(this); |
3782 | 787a4489 | KangIngu | } |
3783 | } |
||
3784 | zoomAndPanControl.CaptureMouse(); |
||
3785 | e.Handled = true; |
||
3786 | } |
||
3787 | } |
||
3788 | e54660e8 | KangIngu | |
3789 | a1716fa5 | KangIngu | private void zoomAndPanControl2_MouseDown(object sender, MouseButtonEventArgs e) |
3790 | { |
||
3791 | e6a9ddaf | humkyung | ///mouseButtonDown = e.ChangedButton; |
3792 | a1716fa5 | KangIngu | canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas2); |
3793 | } |
||
3794 | |||
3795 | 787a4489 | KangIngu | private void RemoveLineStroke(Point P) |
3796 | { |
||
3797 | 05009a0e | ljiyeon | var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault(); |
3798 | 787a4489 | KangIngu | if (control != null) |
3799 | { |
||
3800 | f729ef4e | humkyung | DeleteCommand.Instance.Execute(new List<CommentUserInfo>() { control }); |
3801 | 787a4489 | KangIngu | } |
3802 | } |
||
3803 | |||
3804 | private void RemovePointStroke(Point P) |
||
3805 | { |
||
3806 | foreach (Stroke hits in inkBoard.Strokes) |
||
3807 | { |
||
3808 | foreach (StylusPoint sty in hits.StylusPoints) |
||
3809 | { |
||
3810 | |||
3811 | } |
||
3812 | if (hits.HitTest(P)) |
||
3813 | { |
||
3814 | inkBoard.Strokes.Remove(hits); |
||
3815 | return; |
||
3816 | } |
||
3817 | } |
||
3818 | } |
||
3819 | |||
3820 | private void StartNewStroke(Point P) |
||
3821 | { |
||
3822 | strokePoints = new StylusPointCollection(); |
||
3823 | StylusPoint segment1Start = new StylusPoint(P.X, P.Y); |
||
3824 | strokePoints.Add(segment1Start); |
||
3825 | stroke = new Stroke(strokePoints); |
||
3826 | |||
3827 | stroke.DrawingAttributes.Color = Colors.Red; |
||
3828 | stroke.DrawingAttributes.Width = 4; |
||
3829 | stroke.DrawingAttributes.Height = 4; |
||
3830 | |||
3831 | inkBoard.Strokes.Add(stroke); |
||
3832 | } |
||
3833 | |||
3834 | private void btnConsolidate_Click(object sender, RoutedEventArgs e) |
||
3835 | { |
||
3836 | ConsolidationMethod(); |
||
3837 | } |
||
3838 | |||
3839 | 102476f6 | humkyung | /// <summary> |
3840 | /// execute TeamConsolidationCommand |
||
3841 | /// </summary> |
||
3842 | 04a7385a | djkim | public void TeamConsolidationMethod() |
3843 | { |
||
3844 | 102476f6 | humkyung | this.UpdateMyMarkupList(); |
3845 | 04a7385a | djkim | if (this.gridViewMarkup.SelectedItems.Count == 0) |
3846 | { |
||
3847 | this.ParentOfType<MainWindow>().DialogMessage_Alert("Please select at least one user", "Alert"); |
||
3848 | } |
||
3849 | else |
||
3850 | { |
||
3851 | 8129f2a5 | ljiyeon | |
3852 | ViewerDataModel.Instance.IsConsolidate = true; |
||
3853 | this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); |
||
3854 | |||
3855 | 04a7385a | djkim | foreach (MarkupInfoItem item in this.gridViewMarkup.SelectedItems) |
3856 | { |
||
3857 | if (!this.userData.DEPARTMENT.Equals(item.Depatment)) |
||
3858 | { |
||
3859 | this.ParentOfType<MainWindow>().DialogMessage_Alert("Please select at your department", "Alert"); |
||
3860 | return; |
||
3861 | } |
||
3862 | } |
||
3863 | 102476f6 | humkyung | List<MarkupInfoItem> MarkupInfoList = new List<MarkupInfoItem>(); |
3864 | 04a7385a | djkim | foreach (MarkupInfoItem item in this.gridViewMarkup.SelectedItems) |
3865 | 90e7968d | ljiyeon | { |
3866 | 102476f6 | humkyung | MarkupInfoList.Add(item); |
3867 | 04a7385a | djkim | } |
3868 | 102476f6 | humkyung | TeamConsolidateCommand.Instance.Execute(MarkupInfoList); |
3869 | 04a7385a | djkim | } |
3870 | } |
||
3871 | 102476f6 | humkyung | |
3872 | 787a4489 | KangIngu | public void ConsolidationMethod() |
3873 | { |
||
3874 | if (this.gridViewMarkup.SelectedItems.Count == 0) |
||
3875 | { |
||
3876 | this.ParentOfType<MainWindow>().DialogMessage_Alert("Please select at least one user", "Alert"); |
||
3877 | } |
||
3878 | else |
||
3879 | 90e7968d | ljiyeon | { |
3880 | 35a96e24 | humkyung | List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>(); |
3881 | foreach (var item in this.gridViewMarkup.SelectedItems) |
||
3882 | { |
||
3883 | MySelectItem.Add(item as IKCOM.MarkupInfoItem); |
||
3884 | } |
||
3885 | int iPageNo = Convert.ToInt32(this.ParentOfType<MainWindow>().dzTopMenu.tlcurrentPage.Text); |
||
3886 | 8129f2a5 | ljiyeon | |
3887 | 35a96e24 | humkyung | ConsolidateCommand.Instance.Execute(MySelectItem, iPageNo); |
3888 | 787a4489 | KangIngu | } |
3889 | } |
||
3890 | |||
3891 | private void btnConsolidate_Loaded(object sender, RoutedEventArgs e) |
||
3892 | { |
||
3893 | if (App.ViewInfo != null) |
||
3894 | { |
||
3895 | btnConsolidate = (sender as RadRibbonButton); |
||
3896 | if (!App.ViewInfo.NewCommentPermission) |
||
3897 | { |
||
3898 | (sender as RadRibbonButton).Visibility = System.Windows.Visibility.Collapsed; |
||
3899 | } |
||
3900 | } |
||
3901 | } |
||
3902 | |||
3903 | private void btnTeamConsolidate_Click(object sender, RoutedEventArgs e) |
||
3904 | { |
||
3905 | 04a7385a | djkim | TeamConsolidationMethod(); |
3906 | 787a4489 | KangIngu | } |
3907 | |||
3908 | private void btnTeamConsolidate_Loaded(object sender, RoutedEventArgs e) |
||
3909 | { |
||
3910 | btnTeamConsolidate = sender as RadRibbonButton; |
||
3911 | if (App.ViewInfo != null) |
||
3912 | { |
||
3913 | if (!App.ViewInfo.CreateFinalPDFPermission) //파이널이 True가 아니면 |
||
3914 | { |
||
3915 | if (btnConsolidate != null) |
||
3916 | { |
||
3917 | btnConsolidate.Visibility = Visibility.Collapsed; |
||
3918 | } |
||
3919 | |||
3920 | if (!App.ViewInfo.NewCommentPermission) |
||
3921 | { |
||
3922 | btnTeamConsolidate.Visibility = Visibility.Collapsed; |
||
3923 | } |
||
3924 | } |
||
3925 | else |
||
3926 | { |
||
3927 | btnTeamConsolidate.Visibility = Visibility.Collapsed; |
||
3928 | } |
||
3929 | } |
||
3930 | } |
||
3931 | |||
3932 | private void FinalPDFEvent(object sender, RoutedEventArgs e) |
||
3933 | { |
||
3934 | var item = gridViewMarkup.Items.Cast<MarkupInfoItem>().Where(d => d.Consolidate == 1 && d.AvoidConsolidate == 0).FirstOrDefault(); |
||
3935 | if (item != null) |
||
3936 | { |
||
3937 | 90e7968d | ljiyeon | Logger.sendReqLog("SetFinalPDFAsync", _ViewInfo.ProjectNO + "," + _DocInfo.ID + "," + item.MarkupInfoID + "," + _ViewInfo.UserID, 1); |
3938 | 0f065e57 | ljiyeon | |
3939 | 787a4489 | KangIngu | BaseClient.SetFinalPDFAsync(_ViewInfo.ProjectNO, _DocInfo.ID, item.MarkupInfoID, _ViewInfo.UserID); |
3940 | } |
||
3941 | else |
||
3942 | { |
||
3943 | DialogMessage_Alert("Consolidation 된 코멘트가 존재하지 않습니다", "안내"); |
||
3944 | } |
||
3945 | } |
||
3946 | |||
3947 | private void btnFinalPDF_Loaded(object sender, RoutedEventArgs e) |
||
3948 | { |
||
3949 | btnFinalPDF = sender as RadRibbonButton; |
||
3950 | if (App.ViewInfo != null) |
||
3951 | { |
||
3952 | if (!App.ViewInfo.CreateFinalPDFPermission) //파이널이 True가 아니면 |
||
3953 | { |
||
3954 | btnFinalPDF.Visibility = System.Windows.Visibility.Collapsed; |
||
3955 | if (btnConsolidate != null) |
||
3956 | { |
||
3957 | btnConsolidate.Visibility = Visibility.Collapsed; |
||
3958 | } |
||
3959 | } |
||
3960 | } |
||
3961 | } |
||
3962 | |||
3963 | 80458c15 | ljiyeon | private void ConsolidateFinalPDFEvent(object sender, RoutedEventArgs e) |
3964 | { |
||
3965 | d62c0439 | humkyung | UpdateMyMarkupList(); |
3966 | 80458c15 | ljiyeon | |
3967 | if (this.gridViewMarkup.SelectedItems.Count == 0) |
||
3968 | { |
||
3969 | this.ParentOfType<MainWindow>().DialogMessage_Alert("Please select at least one user", "Alert"); |
||
3970 | } |
||
3971 | else |
||
3972 | { |
||
3973 | ViewerDataModel.Instance.IsConsolidate = true; |
||
3974 | this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); |
||
3975 | List<KCOMDataModel.DataModel.MARKUP_DATA> instanceDataSet = new List<KCOMDataModel.DataModel.MARKUP_DATA>(); |
||
3976 | |||
3977 | string project_no = App.ViewInfo.ProjectNO; |
||
3978 | string doc_id = _DocInfo.ID; |
||
3979 | string user_id = App.ViewInfo.UserID; |
||
3980 | List<MarkupInfoItem> markupInfoItems = new List<MarkupInfoItem>(); |
||
3981 | foreach (MarkupInfoItem item in this.gridViewMarkup.SelectedItems) |
||
3982 | { |
||
3983 | markupInfoItems.Add(item); |
||
3984 | } |
||
3985 | Logger.sendReqLog("Consolidate", project_no + "," + user_id + "," + doc_id + "," + markupInfoItems, 1); |
||
3986 | Logger.sendResLog("Consolidate", this.BaseClient.Consolidate(project_no, user_id, doc_id, markupInfoItems).ToString(), 1); |
||
3987 | Logger.sendReqLog("GetMarkupInfoItemsAsync", App.ViewInfo.ProjectNO + "," + _DocInfo.ID, 1); |
||
3988 | 1126281e | djkim | var items = this.BaseClient.GetMarkupInfoItems(App.ViewInfo.ProjectNO, _DocInfo.ID); |
3989 | 80458c15 | ljiyeon | |
3990 | 1126281e | djkim | var item2 = items.Where(d => d.Consolidate == 1 && d.AvoidConsolidate == 0).FirstOrDefault(); |
3991 | 80458c15 | ljiyeon | if (item2 != null) |
3992 | { |
||
3993 | Logger.sendReqLog("SetFinalPDFAsync", _ViewInfo.ProjectNO + "," + _DocInfo.ID + "," + item2.MarkupInfoID + "," + _ViewInfo.UserID, 1); |
||
3994 | |||
3995 | BaseClient.SetFinalPDFAsync(_ViewInfo.ProjectNO, _DocInfo.ID, item2.MarkupInfoID, _ViewInfo.UserID); |
||
3996 | 1126281e | djkim | BaseClient.GetMarkupInfoItemsAsync(App.ViewInfo.ProjectNO, _DocInfo.ID); |
3997 | 80458c15 | ljiyeon | } |
3998 | else |
||
3999 | { |
||
4000 | DialogMessage_Alert("Consolidation 된 코멘트가 존재하지 않습니다", "안내"); |
||
4001 | } |
||
4002 | 90e7968d | ljiyeon | } |
4003 | 80458c15 | ljiyeon | } |
4004 | |||
4005 | private void btnConsolidateFinalPDF_Loaded(object sender, RoutedEventArgs e) |
||
4006 | 90e7968d | ljiyeon | { |
4007 | 80458c15 | ljiyeon | btnConsolidateFinalPDF = (sender as RadRibbonButton); |
4008 | |||
4009 | if (App.ViewInfo != null) |
||
4010 | { |
||
4011 | if (!App.ViewInfo.NewCommentPermission || !App.ViewInfo.CreateFinalPDFPermission) |
||
4012 | { |
||
4013 | 90e7968d | ljiyeon | btnConsolidateFinalPDF.Visibility = System.Windows.Visibility.Collapsed; |
4014 | 80458c15 | ljiyeon | } |
4015 | 90e7968d | ljiyeon | } |
4016 | 80458c15 | ljiyeon | } |
4017 | |||
4018 | 787a4489 | KangIngu | private void SyncCompare_Click(object sender, RoutedEventArgs e) |
4019 | { |
||
4020 | if (CompareMode.IsChecked) |
||
4021 | { |
||
4022 | if (ViewerDataModel.Instance.PageBalanceMode && ViewerDataModel.Instance.PageBalanceNumber == 0) |
||
4023 | { |
||
4024 | ViewerDataModel.Instance.PageBalanceNumber = 1; |
||
4025 | } |
||
4026 | if (ViewerDataModel.Instance.PageNumber == 0) |
||
4027 | { |
||
4028 | ViewerDataModel.Instance.PageNumber = 1; |
||
4029 | } |
||
4030 | |||
4031 | 90e7968d | ljiyeon | Logger.sendReqLog("GetCompareRectAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID + "," + CurrentRev.DOCUMENT_ID + |
4032 | 0f065e57 | ljiyeon | "," + pageNavigator.CurrentPage.PageNumber.ToString() + "," + ViewerDataModel.Instance.PageNumber.ToString() + "," + |
4033 | 90e7968d | ljiyeon | userData.COMPANY != "EXT" ? "true" : "false", 1); |
4034 | 0f065e57 | ljiyeon | |
4035 | d9cf7d6e | djkim | BaseClient.GetCompareRectAsync(_ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber.ToString(), ViewerDataModel.Instance.PageNumber.ToString(), userData.COMPANY != "EXT" ? "true" : "false"); |
4036 | 787a4489 | KangIngu | } |
4037 | else |
||
4038 | { |
||
4039 | da.From = 1; |
||
4040 | da.To = 1; |
||
4041 | da.Duration = new Duration(TimeSpan.FromSeconds(9999)); |
||
4042 | da.AutoReverse = false; |
||
4043 | canvas_compareBorder.Children.Clear(); |
||
4044 | canvas_compareBorder.BeginAnimation(OpacityProperty, da); |
||
4045 | } |
||
4046 | } |
||
4047 | |||
4048 | 9cd2865b | KangIngu | private void Sync_Click(object sender, RoutedEventArgs e) |
4049 | { |
||
4050 | a1716fa5 | KangIngu | if (Sync.IsChecked) |
4051 | 9cd2865b | KangIngu | { |
4052 | ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX; |
||
4053 | ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY; |
||
4054 | ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale; |
||
4055 | } |
||
4056 | } |
||
4057 | |||
4058 | 787a4489 | KangIngu | private void SyncUserListExpender_Click(object sender, RoutedEventArgs e) |
4059 | { |
||
4060 | if (UserList.IsChecked) |
||
4061 | { |
||
4062 | this.gridViewRevMarkup.Visibility = Visibility.Visible; |
||
4063 | } |
||
4064 | else |
||
4065 | { |
||
4066 | this.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
||
4067 | } |
||
4068 | } |
||
4069 | |||
4070 | private void SyncPageBalance_Click(object sender, RoutedEventArgs e) |
||
4071 | { |
||
4072 | |||
4073 | if (BalanceMode.IsChecked) |
||
4074 | { |
||
4075 | ViewerDataModel.Instance.PageBalanceMode = true; |
||
4076 | } |
||
4077 | else |
||
4078 | { |
||
4079 | ViewerDataModel.Instance.PageBalanceMode = false; |
||
4080 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
4081 | } |
||
4082 | } |
||
4083 | |||
4084 | private void SyncExit_Click(object sender, RoutedEventArgs e) |
||
4085 | { |
||
4086 | //초기화 |
||
4087 | testPanel2.IsHidden = true; |
||
4088 | ViewerDataModel.Instance.PageBalanceMode = false; |
||
4089 | ViewerDataModel.Instance.PageBalanceNumber = 0; |
||
4090 | ViewerDataModel.Instance.PageNumber = 0; |
||
4091 | ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
||
4092 | this.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
||
4093 | UserList.IsChecked = false; |
||
4094 | BalanceMode.IsChecked = false; |
||
4095 | } |
||
4096 | |||
4097 | private void SyncPageChange_Click(object sender, RoutedEventArgs e) |
||
4098 | { |
||
4099 | if ((sender as System.Windows.Controls.Control).Tag != null) |
||
4100 | { |
||
4101 | //Compare 초기화 |
||
4102 | CompareMode.IsChecked = false; |
||
4103 | var balancePoint = Convert.ToInt32((sender as System.Windows.Controls.Control).Tag); |
||
4104 | |||
4105 | if (ViewerDataModel.Instance.PageNumber == 0) |
||
4106 | { |
||
4107 | ViewerDataModel.Instance.PageNumber = 1; |
||
4108 | } |
||
4109 | |||
4110 | if (ViewerDataModel.Instance.PageBalanceNumber == pageNavigator.PageCount) |
||
4111 | { |
||
4112 | } |
||
4113 | else |
||
4114 | { |
||
4115 | ViewerDataModel.Instance.PageBalanceNumber += balancePoint; |
||
4116 | } |
||
4117 | |||
4118 | if (ViewerDataModel.Instance.PageNumber == pageNavigator.PageCount && balancePoint > 0) |
||
4119 | { |
||
4120 | |||
4121 | } |
||
4122 | else if ((ViewerDataModel.Instance.PageNumber + balancePoint) >= 1) |
||
4123 | { |
||
4124 | ViewerDataModel.Instance.PageNumber += balancePoint; |
||
4125 | } |
||
4126 | |||
4127 | if (!testPanel2.IsHidden) |
||
4128 | { |
||
4129 | if (IsSyncPDFMode) |
||
4130 | { |
||
4131 | Get_FinalImage.Get_PdfImage get_PdfImage = new Get_FinalImage.Get_PdfImage(); |
||
4132 | var pdfpath = new BitmapImage(new Uri(get_PdfImage.Run(CurrentRev.TO_VENDOR, App.ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber))); |
||
4133 | |||
4134 | if (pdfpath.IsDownloading) |
||
4135 | { |
||
4136 | pdfpath.DownloadCompleted += (ex, arg) => |
||
4137 | { |
||
4138 | ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
||
4139 | ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
||
4140 | ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
||
4141 | zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
||
4142 | zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
||
4143 | }; |
||
4144 | } |
||
4145 | else |
||
4146 | { |
||
4147 | ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
||
4148 | ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
||
4149 | ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
||
4150 | |||
4151 | zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
||
4152 | zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
||
4153 | } |
||
4154 | |||
4155 | } |
||
4156 | else |
||
4157 | { |
||
4158 | a874198d | humkyung | string uri = ""; |
4159 | |||
4160 | if (userData.COMPANY != "EXT") |
||
4161 | { |
||
4162 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber); |
4163 | a874198d | humkyung | } |
4164 | else |
||
4165 | { |
||
4166 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber); |
4167 | a874198d | humkyung | } |
4168 | 787a4489 | KangIngu | |
4169 | var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri)); |
||
4170 | |||
4171 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4172 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4173 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4174 | |||
4175 | zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth; |
||
4176 | zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight; |
||
4177 | |||
4178 | if (defaultBitmapImage_Compare.IsDownloading) |
||
4179 | { |
||
4180 | defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) => |
||
4181 | { |
||
4182 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4183 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4184 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4185 | |||
4186 | zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth; |
||
4187 | zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight; |
||
4188 | }; |
||
4189 | } |
||
4190 | } |
||
4191 | |||
4192 | //강인구 추가(페이지 이동시 코멘트 재 호출) |
||
4193 | ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
||
4194 | List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); |
||
4195 | |||
4196 | foreach (var item in gridSelectionRevItem) |
||
4197 | { |
||
4198 | item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
||
4199 | { |
||
4200 | 661b7416 | humkyung | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
4201 | 787a4489 | KangIngu | }); |
4202 | } |
||
4203 | e54660e8 | KangIngu | |
4204 | 787a4489 | KangIngu | //강인구 추가 |
4205 | zoomAndPanControl2.ZoomTo(new Rect |
||
4206 | { |
||
4207 | X = 0, |
||
4208 | Y = 0, |
||
4209 | Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width), |
||
4210 | Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height), |
||
4211 | }); |
||
4212 | ae56d52d | KangIngu | |
4213 | 787a4489 | KangIngu | tlSyncPageNum.Text = String.Format("Current Page : {0}", ViewerDataModel.Instance.PageNumber); |
4214 | |||
4215 | } |
||
4216 | } |
||
4217 | } |
||
4218 | |||
4219 | private void SyncChange_Click(object sender, RoutedEventArgs e) |
||
4220 | { |
||
4221 | if (MarkupMode.IsChecked) |
||
4222 | { |
||
4223 | IsSyncPDFMode = true; |
||
4224 | |||
4225 | var uri = CurrentRev.TO_VENDOR; |
||
4226 | ae56d52d | KangIngu | |
4227 | 787a4489 | KangIngu | if (ViewerDataModel.Instance.PageNumber == 0) |
4228 | { |
||
4229 | ViewerDataModel.Instance.PageNumber = 1; |
||
4230 | } |
||
4231 | |||
4232 | //PDF모드 잠시 대기(강인구) |
||
4233 | Get_FinalImage.Get_PdfImage get_PdfImage = new Get_FinalImage.Get_PdfImage(); |
||
4234 | var pdfpath = new BitmapImage(new Uri(get_PdfImage.Run(CurrentRev.TO_VENDOR, App.ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber))); |
||
4235 | |||
4236 | if (pdfpath.IsDownloading) |
||
4237 | { |
||
4238 | pdfpath.DownloadCompleted += (ex, arg) => |
||
4239 | { |
||
4240 | ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
||
4241 | ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
||
4242 | ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
||
4243 | zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
||
4244 | zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
||
4245 | }; |
||
4246 | } |
||
4247 | else |
||
4248 | { |
||
4249 | ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
||
4250 | ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
||
4251 | ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
||
4252 | |||
4253 | zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
||
4254 | zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
||
4255 | } |
||
4256 | } |
||
4257 | else |
||
4258 | { |
||
4259 | IsSyncPDFMode = false; |
||
4260 | a874198d | humkyung | string uri = ""; |
4261 | if (userData.COMPANY != "EXT") |
||
4262 | { |
||
4263 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber); |
4264 | a874198d | humkyung | } |
4265 | else |
||
4266 | { |
||
4267 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber); |
4268 | a874198d | humkyung | } |
4269 | 787a4489 | KangIngu | |
4270 | var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri)); |
||
4271 | |||
4272 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4273 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4274 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4275 | |||
4276 | if (defaultBitmapImage_Compare.IsDownloading) |
||
4277 | { |
||
4278 | defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) => |
||
4279 | { |
||
4280 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4281 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4282 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4283 | }; |
||
4284 | } |
||
4285 | zoomAndPanControl2.ApplyTemplate(); |
||
4286 | zoomAndPanControl2.UpdateLayout(); |
||
4287 | zoomAndPanCanvas2.Width = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentWidth); |
||
4288 | zoomAndPanCanvas2.Height = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentHeight); |
||
4289 | } |
||
4290 | } |
||
4291 | |||
4292 | private void RadButton_Click(object sender, RoutedEventArgs e) |
||
4293 | { |
||
4294 | gridViewHistory_Busy.IsBusy = true; |
||
4295 | |||
4296 | RadButton instance = sender as RadButton; |
||
4297 | if (instance.CommandParameter != null) |
||
4298 | { |
||
4299 | CurrentRev = instance.CommandParameter as VPRevision; |
||
4300 | BaseClient.GetSyncMarkupInfoItemsCompleted += (sen, ea) => |
||
4301 | { |
||
4302 | if (ea.Error == null && ea.Result != null) |
||
4303 | { |
||
4304 | testPanel2.IsHidden = false; |
||
4305 | |||
4306 | d128ceb2 | humkyung | ViewerDataModel.Instance._markupInfoRevList.Clear(); |
4307 | foreach(var info in ea.Result) |
||
4308 | { |
||
4309 | if(info.UserID == App.ViewInfo.UserID) |
||
4310 | { |
||
4311 | info.userDelete = true; |
||
4312 | info.DisplayColor = "FFFF0000"; |
||
4313 | } |
||
4314 | else |
||
4315 | { |
||
4316 | info.userDelete = false; |
||
4317 | } |
||
4318 | ViewerDataModel.Instance._markupInfoRevList.Add(info); |
||
4319 | } |
||
4320 | 787a4489 | KangIngu | gridViewRevMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoRevList; |
4321 | |||
4322 | a874198d | humkyung | string uri = ""; |
4323 | if (userData.COMPANY != "EXT") |
||
4324 | { |
||
4325 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber); |
4326 | a874198d | humkyung | } |
4327 | else |
||
4328 | { |
||
4329 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber); |
4330 | a874198d | humkyung | } |
4331 | 787a4489 | KangIngu | |
4332 | Sync_Offset_Point = new Point(zoomAndPanControl.ContentOffsetX, zoomAndPanControl.ContentOffsetY); |
||
4333 | |||
4334 | var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri)); |
||
4335 | |||
4336 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4337 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4338 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4339 | |||
4340 | if (defaultBitmapImage_Compare.IsDownloading) |
||
4341 | { |
||
4342 | defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) => |
||
4343 | { |
||
4344 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4345 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4346 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4347 | }; |
||
4348 | } |
||
4349 | |||
4350 | zoomAndPanCanvas2.Width = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentWidth); |
||
4351 | zoomAndPanCanvas2.Height = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentHeight); |
||
4352 | zoomAndPanControl2.RotationAngle = zoomAndPanControl.RotationAngle; |
||
4353 | zoomAndPanControl2.ApplyTemplate(); |
||
4354 | zoomAndPanControl2.UpdateLayout(); |
||
4355 | |||
4356 | if (Sync_Offset_Point != new Point(zoomAndPanControl.ContentOffsetX, zoomAndPanControl.ContentOffsetY)) |
||
4357 | { |
||
4358 | zoomAndPanControl.ContentOffsetX = Sync_Offset_Point.X; |
||
4359 | zoomAndPanControl.ContentOffsetY = Sync_Offset_Point.Y; |
||
4360 | } |
||
4361 | |||
4362 | 9cd2865b | KangIngu | ViewerDataModel.Instance.Sync_ContentOffsetX = Sync_Offset_Point.X; |
4363 | ViewerDataModel.Instance.Sync_ContentOffsetY = Sync_Offset_Point.Y; |
||
4364 | ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale; |
||
4365 | |||
4366 | 787a4489 | KangIngu | tlSyncRev.Text = String.Format("Rev. {0}", CurrentRev.RevNo); |
4367 | tlSyncPageNum.Text = String.Format("Current Page : {0}", pageNavigator.CurrentPage.PageNumber); |
||
4368 | gridViewHistory_Busy.IsBusy = false; |
||
4369 | } |
||
4370 | 0f065e57 | ljiyeon | |
4371 | Logger.sendResLog("GetSyncMarkupInfoItemsCompleted", "UserState : " + ea.UserState + "\r Result :" + ea.Result + "\r Cancelled :" + ea.Cancelled + "\r Error :" + ea.Error, 1); |
||
4372 | 90e7968d | ljiyeon | }; |
4373 | 787a4489 | KangIngu | BaseClient.GetSyncMarkupInfoItemsAsync(_ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, _ViewInfo.UserID); |
4374 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetSyncMarkupInfoItemsAsync", _ViewInfo.ProjectNO + "," + CurrentRev.DOCUMENT_ID + "," + _ViewInfo.UserID, 1); |
4375 | 787a4489 | KangIngu | } |
4376 | } |
||
4377 | |||
4378 | public void Sync_Event(VPRevision Currnet_Rev) |
||
4379 | { |
||
4380 | CurrentRev = Currnet_Rev; |
||
4381 | |||
4382 | BaseClient.GetSyncMarkupInfoItemsCompleted += (sen, ea) => |
||
4383 | { |
||
4384 | if (ea.Error == null && ea.Result != null) |
||
4385 | { |
||
4386 | testPanel2.IsHidden = false; |
||
4387 | |||
4388 | d128ceb2 | humkyung | ViewerDataModel.Instance._markupInfoRevList.Clear(); |
4389 | foreach(var info in ea.Result) |
||
4390 | { |
||
4391 | if(info.UserID == App.ViewInfo.UserID) |
||
4392 | { |
||
4393 | info.userDelete = true; |
||
4394 | info.DisplayColor = "FFFF0000"; |
||
4395 | } |
||
4396 | else |
||
4397 | { |
||
4398 | info.userDelete = false; |
||
4399 | } |
||
4400 | ViewerDataModel.Instance._markupInfoRevList.Add(info); |
||
4401 | } |
||
4402 | 787a4489 | KangIngu | gridViewRevMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoRevList; |
4403 | |||
4404 | a874198d | humkyung | string uri = ""; |
4405 | a1716fa5 | KangIngu | if (userData.COMPANY != "EXT") |
4406 | a874198d | humkyung | { |
4407 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber); |
4408 | a874198d | humkyung | } |
4409 | else |
||
4410 | { |
||
4411 | 84c48033 | djkim | uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber); |
4412 | a874198d | humkyung | } |
4413 | 787a4489 | KangIngu | |
4414 | Sync_Offset_Point = new Point(zoomAndPanControl.ContentOffsetX, zoomAndPanControl.ContentOffsetY); |
||
4415 | |||
4416 | var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri)); |
||
4417 | |||
4418 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4419 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4420 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4421 | |||
4422 | if (defaultBitmapImage_Compare.IsDownloading) |
||
4423 | { |
||
4424 | defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) => |
||
4425 | { |
||
4426 | ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
||
4427 | ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
||
4428 | ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
||
4429 | }; |
||
4430 | } |
||
4431 | 90e7968d | ljiyeon | |
4432 | |||
4433 | 787a4489 | KangIngu | zoomAndPanCanvas2.Width = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentWidth); |
4434 | zoomAndPanCanvas2.Height = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentHeight); |
||
4435 | zoomAndPanControl2.ApplyTemplate(); |
||
4436 | zoomAndPanControl2.UpdateLayout(); |
||
4437 | |||
4438 | if (Sync_Offset_Point != new Point(zoomAndPanControl.ContentOffsetX, zoomAndPanControl.ContentOffsetY)) |
||
4439 | { |
||
4440 | zoomAndPanControl.ContentOffsetX = Sync_Offset_Point.X; |
||
4441 | zoomAndPanControl.ContentOffsetY = Sync_Offset_Point.Y; |
||
4442 | } |
||
4443 | //} |
||
4444 | |||
4445 | tlSyncRev.Text = String.Format("Rev. {0}", CurrentRev.RevNo); |
||
4446 | tlSyncPageNum.Text = String.Format("Current Page : {0}", pageNavigator.CurrentPage.PageNumber); |
||
4447 | 90e7968d | ljiyeon | gridViewHistory_Busy.IsBusy = false; |
4448 | 787a4489 | KangIngu | } |
4449 | 0f065e57 | ljiyeon | Logger.sendResLog("GetSyncMarkupInfoItemsCompleted", "UserState : " + ea.UserState + "\r Result :" + ea.Result + "\r Cancelled :" + ea.Cancelled + "\r Error :" + ea.Error, 1); |
4450 | 90e7968d | ljiyeon | |
4451 | 787a4489 | KangIngu | }; |
4452 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetSyncMarkupInfoItemsAsync", _ViewInfo.ProjectNO + "," + CurrentRev.DOCUMENT_ID + "," + _ViewInfo.UserID, 1); |
4453 | 90e7968d | ljiyeon | BaseClient.GetSyncMarkupInfoItemsAsync(_ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, _ViewInfo.UserID); |
4454 | 787a4489 | KangIngu | } |
4455 | |||
4456 | private void PdfLink_ButtonDown(object sender, MouseButtonEventArgs e) |
||
4457 | { |
||
4458 | if (sender is Image) |
||
4459 | { |
||
4460 | if ((sender as Image).Tag != null) |
||
4461 | { |
||
4462 | var pdfUrl = (sender as Image).Tag.ToString(); |
||
4463 | System.Diagnostics.Process.Start(pdfUrl); |
||
4464 | } |
||
4465 | else |
||
4466 | { |
||
4467 | this.ParentOfType<MainWindow>().DialogMessage_Alert("문서 정보가 잘못 되었습니다", "안내"); |
||
4468 | } |
||
4469 | } |
||
4470 | } |
||
4471 | |||
4472 | private void Create_Symbol(object sender, RoutedEventArgs e) |
||
4473 | { |
||
4474 | 5529d2a2 | humkyung | MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.MarkupParser.MarkupReturn(); |
4475 | 787a4489 | KangIngu | |
4476 | if (SelectLayer.Children.Count < 1) //선택된 것이 없으면 |
||
4477 | { |
||
4478 | DialogMessage_Alert("Please Select Controls", "Alert"); |
||
4479 | } |
||
4480 | else //선택된 것이 있으면 |
||
4481 | { |
||
4482 | string MarkupData = ""; |
||
4483 | adorner_ = new AdornerFinal(); |
||
4484 | |||
4485 | foreach (var item in SelectLayer.Children) |
||
4486 | { |
||
4487 | if (item.GetType().Name == "AdornerFinal") |
||
4488 | { |
||
4489 | adorner_ = (item as Controls.AdornerFinal); |
||
4490 | 4913851c | humkyung | foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
4491 | 787a4489 | KangIngu | { |
4492 | if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
||
4493 | { |
||
4494 | 5529d2a2 | humkyung | markupReturn = MarkupParser.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID); |
4495 | 787a4489 | KangIngu | MarkupData += markupReturn.ConvertData; |
4496 | } |
||
4497 | } |
||
4498 | } |
||
4499 | } |
||
4500 | DialogParameters parameters = new DialogParameters() |
||
4501 | { |
||
4502 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
4503 | 787a4489 | KangIngu | Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args), |
4504 | DefaultPromptResultValue = "Custom State", |
||
4505 | Content = "Name :", |
||
4506 | Header = "Insert Custom Symbol Name", |
||
4507 | Theme = new VisualStudio2013Theme(), |
||
4508 | ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 }, |
||
4509 | }; |
||
4510 | RadWindow.Prompt(parameters); |
||
4511 | } |
||
4512 | |||
4513 | } |
||
4514 | 53880c83 | ljiyeon | public int symbolselectindex = 0; |
4515 | private void SymbolMarkupNamePromptClose(byte[] Img_byte, string data, WindowClosedEventArgs args) |
||
4516 | { |
||
4517 | //Save save = new Save(); |
||
4518 | try |
||
4519 | { |
||
4520 | string svgfilename = null; |
||
4521 | if (symbolname != null) |
||
4522 | { |
||
4523 | if (symbolpng == true || symbolsvg == true) |
||
4524 | { |
||
4525 | kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
||
4526 | 24678e06 | humkyung | string guid = Commons.shortGuid(); |
4527 | 53880c83 | ljiyeon | |
4528 | fileUploader.RunAsync(App.ViewInfo.ProjectNO, _DocItem.DOCUMENT_NO, App.ViewInfo.UserID, guid + ".png", Img_byte); |
||
4529 | c73426a9 | ljiyeon | //Check_Uri.UriCheck(); |
4530 | 53880c83 | ljiyeon | fileUploader.RunCompleted += (ex, arg) => |
4531 | { |
||
4532 | filename = arg.Result; |
||
4533 | if (symbolpng == true) |
||
4534 | { |
||
4535 | if (filename != null) |
||
4536 | { |
||
4537 | if (symbolselectindex == 0) |
||
4538 | { |
||
4539 | SymbolSave(symbolname, filename, data); |
||
4540 | } |
||
4541 | else |
||
4542 | { |
||
4543 | SymbolSave_Public(symbolname, filename, data, ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT); |
||
4544 | } |
||
4545 | DataBind(); |
||
4546 | } |
||
4547 | } |
||
4548 | |||
4549 | if (symbolsvg == true) |
||
4550 | { |
||
4551 | c73426a9 | ljiyeon | try |
4552 | 53880c83 | ljiyeon | { |
4553 | c73426a9 | ljiyeon | var defaultBitmapImage = new BitmapImage(); |
4554 | defaultBitmapImage.BeginInit(); |
||
4555 | defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache; |
||
4556 | defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad; |
||
4557 | Check_Uri.UriCheck(filename); |
||
4558 | defaultBitmapImage.UriSource = new Uri(filename); |
||
4559 | defaultBitmapImage.EndInit(); |
||
4560 | 53880c83 | ljiyeon | |
4561 | c73426a9 | ljiyeon | System.Drawing.Bitmap image; |
4562 | 53880c83 | ljiyeon | |
4563 | c73426a9 | ljiyeon | if (defaultBitmapImage.IsDownloading) |
4564 | { |
||
4565 | defaultBitmapImage.DownloadCompleted += (ex2, arg2) => |
||
4566 | 53880c83 | ljiyeon | { |
4567 | c73426a9 | ljiyeon | defaultBitmapImage.Freeze(); |
4568 | image = GetBitmap(defaultBitmapImage); |
||
4569 | image.Save(@AppDomain.CurrentDomain.BaseDirectory + "potrace.bmp", System.Drawing.Imaging.ImageFormat.Bmp); |
||
4570 | Process potrace = new Process |
||
4571 | 53880c83 | ljiyeon | { |
4572 | c73426a9 | ljiyeon | StartInfo = new ProcessStartInfo |
4573 | { |
||
4574 | FileName = @AppDomain.CurrentDomain.BaseDirectory + "potrace.exe", |
||
4575 | Arguments = "-b svg " + @AppDomain.CurrentDomain.BaseDirectory + "potrace.bmp", |
||
4576 | RedirectStandardInput = true, |
||
4577 | RedirectStandardOutput = true, |
||
4578 | RedirectStandardError = true, |
||
4579 | UseShellExecute = false, |
||
4580 | CreateNoWindow = true, |
||
4581 | WindowStyle = ProcessWindowStyle.Hidden |
||
4582 | }, |
||
4583 | }; |
||
4584 | 53880c83 | ljiyeon | |
4585 | c73426a9 | ljiyeon | StringBuilder svgBuilder = new StringBuilder(); |
4586 | potrace.OutputDataReceived += (object sender2, DataReceivedEventArgs e2) => |
||
4587 | 53880c83 | ljiyeon | { |
4588 | c73426a9 | ljiyeon | svgBuilder.AppendLine(e2.Data); |
4589 | }; |
||
4590 | |||
4591 | potrace.EnableRaisingEvents = true; |
||
4592 | potrace.Start(); |
||
4593 | potrace.Exited += (sender, e) => |
||
4594 | 53880c83 | ljiyeon | { |
4595 | c73426a9 | ljiyeon | byte[] bytes = System.IO.File.ReadAllBytes(@AppDomain.CurrentDomain.BaseDirectory + "potrace.svg"); |
4596 | svgfilename = fileUploader.Run(App.ViewInfo.ProjectNO, _DocItem.DOCUMENT_NO, App.ViewInfo.UserID, guid + ".svg", bytes); |
||
4597 | Check_Uri.UriCheck(svgfilename); |
||
4598 | if (symbolselectindex == 0) |
||
4599 | { |
||
4600 | SymbolSave(symbolname, svgfilename, data); |
||
4601 | } |
||
4602 | else |
||
4603 | { |
||
4604 | SymbolSave_Public(symbolname, svgfilename, data, ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT); |
||
4605 | } |
||
4606 | 53880c83 | ljiyeon | |
4607 | c73426a9 | ljiyeon | DataBind(); |
4608 | }; |
||
4609 | potrace.WaitForExit(); |
||
4610 | 53880c83 | ljiyeon | }; |
4611 | c73426a9 | ljiyeon | } |
4612 | else |
||
4613 | { |
||
4614 | //GC.Collect(); |
||
4615 | } |
||
4616 | 53880c83 | ljiyeon | } |
4617 | c73426a9 | ljiyeon | catch(Exception ee) |
4618 | 90e7968d | ljiyeon | { |
4619 | c73426a9 | ljiyeon | DialogMessage_Alert("" + ee, "Alert"); |
4620 | 90e7968d | ljiyeon | } |
4621 | 53880c83 | ljiyeon | } |
4622 | }; |
||
4623 | } |
||
4624 | } |
||
4625 | } |
||
4626 | catch (Exception e) |
||
4627 | { |
||
4628 | //DialogMessage_Alert(e + "", "Alert"); |
||
4629 | } |
||
4630 | } |
||
4631 | |||
4632 | public void SymbolSave(string Name, string Url, string Data) |
||
4633 | { |
||
4634 | try |
||
4635 | { |
||
4636 | SYMBOL_PRIVATE symbol_private = new SYMBOL_PRIVATE |
||
4637 | { |
||
4638 | 24678e06 | humkyung | ID = Commons.shortGuid(), |
4639 | 53880c83 | ljiyeon | MEMBER_USER_ID = App.ViewInfo.UserID, |
4640 | NAME = Name, |
||
4641 | IMAGE_URL = Url, |
||
4642 | DATA = Data |
||
4643 | }; |
||
4644 | |||
4645 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolCompleted += BaseClient_SaveSymbolCompleted; |
||
4646 | Logger.sendReqLog("SaveSymbolAsync: ", symbol_private.ID + "," + symbol_private.MEMBER_USER_ID + "," + symbol_private.NAME + "," + symbol_private.IMAGE_URL + "," + symbol_private.DATA, 1); |
||
4647 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolAsync(symbol_private); |
||
4648 | } |
||
4649 | catch (Exception) |
||
4650 | { |
||
4651 | throw; |
||
4652 | } |
||
4653 | } |
||
4654 | |||
4655 | public void SymbolSave_Public(string Name, string Url, string Data, string Department) |
||
4656 | { |
||
4657 | try |
||
4658 | { |
||
4659 | SYMBOL_PUBLIC symbol_public = new SYMBOL_PUBLIC |
||
4660 | { |
||
4661 | 24678e06 | humkyung | ID = Commons.shortGuid(), |
4662 | 53880c83 | ljiyeon | DEPARTMENT = Department, |
4663 | NAME = Name, |
||
4664 | IMAGE_URL = Url, |
||
4665 | DATA = Data |
||
4666 | }; |
||
4667 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbolCompleted += BaseClient_AddPublicSymbolCompleted; |
||
4668 | Logger.sendReqLog("AddPublicSymbol: ", symbol_public.ID + "," + symbol_public.DEPARTMENT + "," + symbol_public.NAME + "," + symbol_public.IMAGE_URL + "," + symbol_public.DATA, 1); |
||
4669 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbol(symbol_public); |
||
4670 | } |
||
4671 | catch (Exception) |
||
4672 | { |
||
4673 | throw; |
||
4674 | } |
||
4675 | } |
||
4676 | |||
4677 | private void BaseClient_AddPublicSymbolCompleted(object sender, ServiceDeepView.AddPublicSymbolCompletedEventArgs e) |
||
4678 | { |
||
4679 | Logger.sendResLog("AddPublicSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
||
4680 | DataBind(); |
||
4681 | } |
||
4682 | |||
4683 | private void BaseClient_SaveSymbolCompleted(object sender, ServiceDeepView.SaveSymbolCompletedEventArgs e) |
||
4684 | { |
||
4685 | Logger.sendResLog("RenameSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
||
4686 | DataBind(); |
||
4687 | } |
||
4688 | private void DataBind() |
||
4689 | { |
||
4690 | try |
||
4691 | { |
||
4692 | Symbol_Custom Custom = new Symbol_Custom(); |
||
4693 | List<Symbol_Custom> Custom_List = new List<Symbol_Custom>(); |
||
4694 | 5928384e | djkim | |
4695 | bb3a236d | ljiyeon | var symbol_Private = BaseClient.GetSymbolList(App.ViewInfo.UserID); |
4696 | 53880c83 | ljiyeon | foreach (var item in symbol_Private) |
4697 | { |
||
4698 | Custom.Name = item.NAME; |
||
4699 | Custom.ImageUri = item.IMAGE_URL; |
||
4700 | Custom.ID = item.ID; |
||
4701 | Custom_List.Add(Custom); |
||
4702 | Custom = new Symbol_Custom(); |
||
4703 | } |
||
4704 | symbolPanel_Instance.lstSymbolPrivate.ItemsSource = Custom_List; |
||
4705 | |||
4706 | Custom = new Symbol_Custom(); |
||
4707 | Custom_List = new List<Symbol_Custom>(); |
||
4708 | |||
4709 | bb3a236d | ljiyeon | symbolPanel_Instance.deptlist.ItemsSource = BaseClient.GetPublicSymbolDeptList(); |
4710 | 53880c83 | ljiyeon | |
4711 | List<SYMBOL_PUBLIC> symbol_Public; |
||
4712 | 787a4489 | KangIngu | |
4713 | 53880c83 | ljiyeon | if (symbolPanel_Instance.deptlist.SelectedValue != null) |
4714 | { |
||
4715 | bb3a236d | ljiyeon | symbol_Public = BaseClient.GetPublicSymbolList(symbolPanel_Instance.deptlist.SelectedValue.ToString()); |
4716 | 53880c83 | ljiyeon | } |
4717 | else |
||
4718 | { |
||
4719 | bb3a236d | ljiyeon | symbol_Public = BaseClient.GetPublicSymbolList(null); |
4720 | 53880c83 | ljiyeon | } |
4721 | foreach (var item in symbol_Public) |
||
4722 | { |
||
4723 | Custom.Name = item.NAME; |
||
4724 | Custom.ImageUri = item.IMAGE_URL; |
||
4725 | Custom.ID = item.ID; |
||
4726 | Custom_List.Add(Custom); |
||
4727 | Custom = new Symbol_Custom(); |
||
4728 | } |
||
4729 | symbolPanel_Instance.lstSymbolPublic.ItemsSource = Custom_List; |
||
4730 | bb3a236d | ljiyeon | BaseClient.Close(); |
4731 | 53880c83 | ljiyeon | } |
4732 | catch(Exception e) |
||
4733 | { |
||
4734 | //DialogMessage_Alert("DataBind", "Alert"); |
||
4735 | } |
||
4736 | |||
4737 | } |
||
4738 | 787a4489 | KangIngu | private void MarkupNamePromptClose(string data, WindowClosedEventArgs args) |
4739 | { |
||
4740 | c73426a9 | ljiyeon | try |
4741 | 787a4489 | KangIngu | { |
4742 | c73426a9 | ljiyeon | if (args.PromptResult != null) |
4743 | 53880c83 | ljiyeon | { |
4744 | c73426a9 | ljiyeon | if (args.DialogResult.Value) |
4745 | { |
||
4746 | PngBitmapEncoder _Encoder = symImage(data); |
||
4747 | 787a4489 | KangIngu | |
4748 | c73426a9 | ljiyeon | System.IO.MemoryStream fs = new System.IO.MemoryStream(); |
4749 | _Encoder.Save(fs); |
||
4750 | System.Drawing.Image ImgOut = System.Drawing.Image.FromStream(fs); |
||
4751 | 787a4489 | KangIngu | |
4752 | c73426a9 | ljiyeon | byte[] Img_byte = fs.ToArray(); |
4753 | 787a4489 | KangIngu | |
4754 | c73426a9 | ljiyeon | kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
4755 | 24678e06 | humkyung | filename = fileUploader.Run(App.ViewInfo.ProjectNO, _DocItem.DOCUMENT_NO, App.ViewInfo.UserID, Commons.shortGuid() + ".png", Img_byte); |
4756 | c73426a9 | ljiyeon | Check_Uri.UriCheck(filename); |
4757 | if (symbolPanel_Instance.RadTab.SelectedIndex == 0) |
||
4758 | { |
||
4759 | de6499db | humkyung | SaveCommand.Instance.SymbolSave(args.PromptResult, filename, data); |
4760 | c73426a9 | ljiyeon | } |
4761 | else |
||
4762 | { |
||
4763 | de6499db | humkyung | SaveCommand.Instance.SymbolSave_Public(args.PromptResult, filename, data, ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT); |
4764 | c73426a9 | ljiyeon | } |
4765 | DataBind(); |
||
4766 | 53880c83 | ljiyeon | } |
4767 | } |
||
4768 | 787a4489 | KangIngu | } |
4769 | c73426a9 | ljiyeon | catch(Exception ex) |
4770 | { |
||
4771 | DialogMessage_Alert("" + ex, "Alert"); |
||
4772 | } |
||
4773 | 787a4489 | KangIngu | } |
4774 | |||
4775 | public PngBitmapEncoder symImage(string data) |
||
4776 | { |
||
4777 | |||
4778 | Canvas _canvas = new Canvas(); |
||
4779 | _canvas.Background = Brushes.White; |
||
4780 | _canvas.Width = adorner_.BorderSize.Width; |
||
4781 | _canvas.Height = adorner_.BorderSize.Height; |
||
4782 | 5529d2a2 | humkyung | MarkupParser.Parse(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", ""); |
4783 | 787a4489 | KangIngu | |
4784 | BitmapEncoder encoder = new PngBitmapEncoder(); |
||
4785 | |||
4786 | |||
4787 | RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)_canvas.Width + 50, (int)_canvas.Height + 50, 96d, 96d, PixelFormats.Pbgra32); |
||
4788 | |||
4789 | DrawingVisual dv = new DrawingVisual(); |
||
4790 | |||
4791 | _canvas.Measure(new System.Windows.Size(adorner_.BorderSize.Width + 50, adorner_.BorderSize.Height + 50)); |
||
4792 | _canvas.Arrange(new Rect(new System.Windows.Point { X = -adorner_.BorderSize.X - 20, Y = -adorner_.BorderSize.Y - 20 }, new Point(adorner_.BorderSize.Width + 20, adorner_.BorderSize.Height + 20))); |
||
4793 | |||
4794 | using (DrawingContext ctx = dv.RenderOpen()) |
||
4795 | { |
||
4796 | VisualBrush vb = new VisualBrush(_canvas); |
||
4797 | ctx.DrawRectangle(vb, null, new Rect(new System.Windows.Point { X = -adorner_.BorderSize.X, Y = -adorner_.BorderSize.Y }, new Point(adorner_.BorderSize.Width + 20, adorner_.BorderSize.Height + 20))); |
||
4798 | } |
||
4799 | |||
4800 | try |
||
4801 | { |
||
4802 | renderBitmap.Render(dv); |
||
4803 | |||
4804 | 90e7968d | ljiyeon | //GC.Collect(); |
4805 | 787a4489 | KangIngu | GC.WaitForPendingFinalizers(); |
4806 | 90e7968d | ljiyeon | //GC.Collect(); |
4807 | 787a4489 | KangIngu | // encode png data |
4808 | PngBitmapEncoder pngEncoder = new PngBitmapEncoder(); |
||
4809 | // puch rendered bitmap into it |
||
4810 | pngEncoder.Interlace = PngInterlaceOption.Off; |
||
4811 | pngEncoder.Frames.Add(BitmapFrame.Create(renderBitmap)); |
||
4812 | return pngEncoder; |
||
4813 | |||
4814 | } |
||
4815 | 53880c83 | ljiyeon | catch //(Exception ex) |
4816 | 787a4489 | KangIngu | { |
4817 | return null; |
||
4818 | } |
||
4819 | |||
4820 | } |
||
4821 | |||
4822 | public void DialogMessage_Alert(string content, string header) |
||
4823 | { |
||
4824 | var box = new TextBlock(); |
||
4825 | box.MinWidth = 400; |
||
4826 | box.FontSize = 11; |
||
4827 | //box.FontSize = 12; |
||
4828 | box.Text = content; |
||
4829 | box.TextWrapping = System.Windows.TextWrapping.Wrap; |
||
4830 | |||
4831 | DialogParameters parameters = new DialogParameters() |
||
4832 | { |
||
4833 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
4834 | 787a4489 | KangIngu | Content = box, |
4835 | Header = header, |
||
4836 | Theme = new VisualStudio2013Theme(), |
||
4837 | ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 }, |
||
4838 | 90e7968d | ljiyeon | }; |
4839 | 787a4489 | KangIngu | RadWindow.Alert(parameters); |
4840 | } |
||
4841 | |||
4842 | #region 캡쳐 기능 |
||
4843 | |||
4844 | public BitmapSource CutAreaToImage(int x, int y, int width, int height) |
||
4845 | { |
||
4846 | if (x < 0) |
||
4847 | { |
||
4848 | width += x; |
||
4849 | x = 0; |
||
4850 | } |
||
4851 | if (y < 0) |
||
4852 | { |
||
4853 | height += y; |
||
4854 | y = 0; |
||
4855 | |||
4856 | width = (int)zoomAndPanCanvas.ActualWidth - x; |
||
4857 | } |
||
4858 | if (x + width > zoomAndPanCanvas.ActualWidth) |
||
4859 | { |
||
4860 | width = (int)zoomAndPanCanvas.ActualWidth - x; |
||
4861 | } |
||
4862 | if (y + height > zoomAndPanCanvas.ActualHeight) |
||
4863 | { |
||
4864 | height = (int)zoomAndPanCanvas.ActualHeight - y; |
||
4865 | } |
||
4866 | |||
4867 | byte[] pixels = CopyPixels(x, y, width, height); |
||
4868 | |||
4869 | int stride = (width * canvasImage.Format.BitsPerPixel + 7) / 8; |
||
4870 | |||
4871 | return BitmapSource.Create(width, height, 96, 96, PixelFormats.Pbgra32, null, pixels, stride); |
||
4872 | } |
||
4873 | |||
4874 | public byte[] CopyPixels(int x, int y, int width, int height) |
||
4875 | { |
||
4876 | byte[] pixels = new byte[width * height * 4]; |
||
4877 | int stride = (width * canvasImage.Format.BitsPerPixel + 7) / 8; |
||
4878 | |||
4879 | // Canvas 이미지에서 객체 역역만큼 픽셀로 복사 |
||
4880 | canvasImage.CopyPixels(new Int32Rect(x, y, width, height), pixels, stride, 0); |
||
4881 | |||
4882 | return pixels; |
||
4883 | } |
||
4884 | |||
4885 | public RenderTargetBitmap ConverterBitmapImage(FrameworkElement element) |
||
4886 | { |
||
4887 | DrawingVisual drawingVisual = new DrawingVisual(); |
||
4888 | DrawingContext drawingContext = drawingVisual.RenderOpen(); |
||
4889 | |||
4890 | // 해당 객체의 그래픽요소로 사각형의 그림을 그립니다. |
||
4891 | drawingContext.DrawRectangle(new VisualBrush(element), null, |
||
4892 | new Rect(new Point(0, 0), new Point(element.ActualWidth, element.ActualHeight))); |
||
4893 | drawingContext.Close(); |
||
4894 | |||
4895 | // 비트맵으로 변환합니다. |
||
4896 | RenderTargetBitmap target = |
||
4897 | new RenderTargetBitmap((int)element.ActualWidth, (int)element.ActualHeight, |
||
4898 | 96, 96, System.Windows.Media.PixelFormats.Pbgra32); |
||
4899 | |||
4900 | target.Render(drawingVisual); |
||
4901 | return target; |
||
4902 | } |
||
4903 | |||
4904 | 53880c83 | ljiyeon | System.Drawing.Bitmap GetBitmap(BitmapSource source) |
4905 | { |
||
4906 | System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(source.PixelWidth, source.PixelHeight, System.Drawing.Imaging.PixelFormat.Format32bppPArgb); |
||
4907 | System.Drawing.Imaging.BitmapData data = bmp.LockBits(new System.Drawing.Rectangle(System.Drawing.Point.Empty, bmp.Size), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppPArgb); |
||
4908 | source.CopyPixels(Int32Rect.Empty, data.Scan0, data.Height * data.Stride, data.Stride); |
||
4909 | bmp.UnlockBits(data); |
||
4910 | return bmp; |
||
4911 | } |
||
4912 | public string symbolname = null; |
||
4913 | public bool symbolsvg = true; |
||
4914 | public bool symbolpng = true; |
||
4915 | |||
4916 | public void Save_Symbol_Capture(BitmapSource source, int x, int y, int width, int height) |
||
4917 | { |
||
4918 | System.Drawing.Bitmap image = GetBitmap(source); |
||
4919 | //흰색 제거 |
||
4920 | //image.MakeTransparent(System.Drawing.Color.White); |
||
4921 | |||
4922 | var imageStream = new System.IO.MemoryStream(); |
||
4923 | byte[] imageBytes = null; |
||
4924 | using (imageStream) |
||
4925 | { |
||
4926 | image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png); |
||
4927 | // test.Save(@"E:\test.png", System.Drawing.Imaging.ImageFormat.Png); |
||
4928 | imageStream.Position = 0; |
||
4929 | imageBytes = imageStream.ToArray(); |
||
4930 | } |
||
4931 | |||
4932 | SymbolPrompt symbolPrompt = new SymbolPrompt(); |
||
4933 | |||
4934 | RadWindow CheckPop = new RadWindow(); |
||
4935 | //Alert check = new Alert(Msg); |
||
4936 | |||
4937 | CheckPop = new RadWindow |
||
4938 | { |
||
4939 | MinWidth = 400, |
||
4940 | MinHeight = 100, |
||
4941 | // Closed = (obj, args) => this.SymbolMarkupNamePromptClose(imageBytes, "", args), |
||
4942 | Header = "Alert", |
||
4943 | Content = symbolPrompt, |
||
4944 | //DialogResult = |
||
4945 | ResizeMode = System.Windows.ResizeMode.NoResize, |
||
4946 | WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen, |
||
4947 | IsTopmost = true, |
||
4948 | }; |
||
4949 | CheckPop.Closed += (obj, args) => this.SymbolMarkupNamePromptClose(imageBytes, "", args); |
||
4950 | StyleManager.SetTheme(CheckPop, new Office2013Theme()); |
||
4951 | CheckPop.ShowDialog(); |
||
4952 | |||
4953 | /* |
||
4954 | DialogParameters parameters = new DialogParameters() |
||
4955 | { |
||
4956 | Owner = Application.Current.MainWindow, |
||
4957 | Closed = (obj, args) => this.SymbolMarkupNamePromptClose(imageBytes, "", args), |
||
4958 | DefaultPromptResultValue = "Custom State", |
||
4959 | Content = "Name :", |
||
4960 | Header = "Insert Custom Symbol Name", |
||
4961 | Theme = new VisualStudio2013Theme(), |
||
4962 | ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 }, |
||
4963 | }; |
||
4964 | RadWindow.Prompt(parameters); |
||
4965 | */ |
||
4966 | } |
||
4967 | |||
4968 | 787a4489 | KangIngu | public void Save_Capture(BitmapSource source, int x, int y, int width, int height) |
4969 | { |
||
4970 | KCOM.Common.Converter.FileStreamToBase64 streamToBase64 = new Common.Converter.FileStreamToBase64(); |
||
4971 | KCOMDataModel.DataModel.CHECK_LIST check_; |
||
4972 | string Result = streamToBase64.ImageToBase64(source); |
||
4973 | KCOMDataModel.DataModel.CHECK_LIST Item = new KCOMDataModel.DataModel.CHECK_LIST(); |
||
4974 | 6c781c0c | djkim | string projectno = App.ViewInfo.ProjectNO; |
4975 | string checklist_id = ViewerDataModel.Instance.CheckList_ID; |
||
4976 | 0f065e57 | ljiyeon | |
4977 | Logger.sendReqLog("GetCheckList", projectno + "," + checklist_id, 1); |
||
4978 | 6c781c0c | djkim | Item = this.BaseClient.GetCheckList(projectno, checklist_id); |
4979 | 90e7968d | ljiyeon | if (Item != null) |
4980 | 0f065e57 | ljiyeon | { |
4981 | Logger.sendResLog("GetCheckList", "TRUE", 1); |
||
4982 | } |
||
4983 | else |
||
4984 | { |
||
4985 | Logger.sendResLog("GetCheckList", "FALSE", 1); |
||
4986 | } |
||
4987 | 90e7968d | ljiyeon | |
4988 | 6c781c0c | djkim | if (Item == null) |
4989 | 787a4489 | KangIngu | { |
4990 | 6c781c0c | djkim | check_ = new KCOMDataModel.DataModel.CHECK_LIST |
4991 | 787a4489 | KangIngu | { |
4992 | 24678e06 | humkyung | ID = Commons.shortGuid(), |
4993 | 6c781c0c | djkim | USER_ID = App.ViewInfo.UserID, |
4994 | IMAGE_URL = Result, |
||
4995 | IMAGE_ANCHOR = x + "," + y + "," + width + "," + height, |
||
4996 | PAGENUMBER = this.pageNavigator.CurrentPage.PageNumber, |
||
4997 | REVISION = ViewerDataModel.Instance.SystemMain.dzMainMenu.CurrentDoc.Revision, |
||
4998 | DOCUMENT_ID = App.ViewInfo.DocumentItemID, |
||
4999 | PROJECT_NO = App.ViewInfo.ProjectNO, |
||
5000 | STATUS = "False", |
||
5001 | CREATE_TIME = DateTime.Now, |
||
5002 | UPDATE_TIME = DateTime.Now, |
||
5003 | DOCUMENT_NO = _DocItem.DOCUMENT_NO, |
||
5004 | STATUS_DESC_OPEN = "Vendor 반영 필요", |
||
5005 | }; |
||
5006 | 0f065e57 | ljiyeon | Logger.sendReqLog("AddCheckList", projectno + "," + check_, 1); |
5007 | Logger.sendResLog("AddCheckList", this.BaseClient.AddCheckList(projectno, check_).ToString(), 1); |
||
5008 | //this.BaseClient.AddCheckList(projectno, check_); |
||
5009 | 787a4489 | KangIngu | } |
5010 | 6c781c0c | djkim | else |
5011 | { |
||
5012 | Item.IMAGE_URL = Result; |
||
5013 | Item.IMAGE_ANCHOR = x + "," + y + "," + width + "," + height; |
||
5014 | 90e7968d | ljiyeon | Item.PAGENUMBER = this.pageNavigator.CurrentPage.PageNumber; |
5015 | 0f065e57 | ljiyeon | Logger.sendReqLog("SaveCheckList", projectno + "," + checklist_id + "," + Item, 1); |
5016 | Logger.sendResLog("SaveCheckList", this.BaseClient.SaveCheckList(projectno, checklist_id, Item).ToString(), 1); |
||
5017 | //this.BaseClient.SaveCheckList(projectno, checklist_id, Item); |
||
5018 | 6c781c0c | djkim | } |
5019 | 90e7968d | ljiyeon | |
5020 | 787a4489 | KangIngu | } |
5021 | |||
5022 | public void Set_Capture() |
||
5023 | 90e7968d | ljiyeon | { |
5024 | 787a4489 | KangIngu | double x = canvasDrawingMouseDownPoint.X; |
5025 | double y = canvasDrawingMouseDownPoint.Y; |
||
5026 | double width = dragCaptureBorder.Width; |
||
5027 | double height = dragCaptureBorder.Height; |
||
5028 | |||
5029 | if (width > 5 || height > 5) |
||
5030 | { |
||
5031 | canvasImage = ConverterBitmapImage(zoomAndPanCanvas); |
||
5032 | BitmapSource source = CutAreaToImage((int)x, (int)y, (int)width, (int)height); |
||
5033 | Save_Capture(source, (int)x, (int)y, (int)width, (int)height); |
||
5034 | } |
||
5035 | } |
||
5036 | #endregion |
||
5037 | |||
5038 | public Multi_Undo_data Control_Style(CommentUserInfo control) |
||
5039 | { |
||
5040 | multi_Undo_Data = new Multi_Undo_data(); |
||
5041 | |||
5042 | multi_Undo_Data.Markup = control; |
||
5043 | |||
5044 | if ((control as IShapeControl) != null) |
||
5045 | { |
||
5046 | multi_Undo_Data.paint = (control as IShapeControl).Paint; |
||
5047 | } |
||
5048 | if ((control as IDashControl) != null) |
||
5049 | { |
||
5050 | multi_Undo_Data.DashSize = (control as IDashControl).DashSize; |
||
5051 | } |
||
5052 | if ((control as IPath) != null) |
||
5053 | { |
||
5054 | multi_Undo_Data.LineSize = (control as IPath).LineSize; |
||
5055 | } |
||
5056 | if ((control as UIElement) != null) |
||
5057 | { |
||
5058 | multi_Undo_Data.Opacity = (control as UIElement).Opacity; |
||
5059 | } |
||
5060 | |||
5061 | return multi_Undo_Data; |
||
5062 | } |
||
5063 | |||
5064 | private void Comment_Move(object sender, MouseButtonEventArgs e) |
||
5065 | { |
||
5066 | string Select_ID = (((e.Source as Telerik.Windows.Controls.RadButton).DataContext) as IKCOM.MarkupInfoItem).UserID; |
||
5067 | foreach (var items in ViewerDataModel.Instance._markupInfoRevList) |
||
5068 | { |
||
5069 | if (items.UserID == Select_ID) |
||
5070 | { |
||
5071 | foreach (var item in items.MarkupList) |
||
5072 | { |
||
5073 | if (item.PageNumber == pageNavigator.CurrentPage.PageNumber) |
||
5074 | { |
||
5075 | 661b7416 | humkyung | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, item.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", |
5076 | 24678e06 | humkyung | items.MarkupInfoID, Commons.shortGuid()); |
5077 | 787a4489 | KangIngu | } |
5078 | } |
||
5079 | } |
||
5080 | } |
||
5081 | } |
||
5082 | d62c0439 | humkyung | |
5083 | f959ea6f | humkyung | /// <summary> |
5084 | /// convert inkcontrol to polygoncontrol |
||
5085 | /// </summary> |
||
5086 | public void ConvertInkControlToPolygon() |
||
5087 | 787a4489 | KangIngu | { |
5088 | if (inkBoard.Strokes.Count > 0) |
||
5089 | { |
||
5090 | inkBoard.Strokes.ToList().ForEach(stroke => |
||
5091 | { |
||
5092 | InkToPath ip = new InkToPath(); |
||
5093 | f959ea6f | humkyung | |
5094 | 787a4489 | KangIngu | List<Point> inkPointSet = new List<Point>(); |
5095 | f959ea6f | humkyung | inkPointSet.AddRange(ip.GetPointsFrom(stroke)); |
5096 | |||
5097 | PolygonControl pc = new PolygonControl() |
||
5098 | 787a4489 | KangIngu | { |
5099 | Angle = 0, |
||
5100 | f959ea6f | humkyung | PointSet = inkPointSet, |
5101 | 787a4489 | KangIngu | ControlType = ControlType.Ink |
5102 | }; |
||
5103 | f959ea6f | humkyung | pc.StartPoint = inkPointSet[0]; |
5104 | pc.EndPoint = inkPointSet[inkPointSet.Count - 1]; |
||
5105 | pc.LineSize = 3; |
||
5106 | pc.CommentID = Commons.shortGuid(); |
||
5107 | pc.StrokeColor = new SolidColorBrush(Colors.Red); |
||
5108 | 787a4489 | KangIngu | |
5109 | f959ea6f | humkyung | if (pc.PointSet.Count > 0) |
5110 | { |
||
5111 | CreateCommand.Instance.Execute(pc); |
||
5112 | 787a4489 | KangIngu | ViewerDataModel.Instance.MarkupControls_USER.Add(pc); |
5113 | } |
||
5114 | }); |
||
5115 | f959ea6f | humkyung | inkBoard.Strokes.Clear(); |
5116 | 787a4489 | KangIngu | } |
5117 | } |
||
5118 | 17a22987 | KangIngu | |
5119 | 4318fdeb | KangIngu | /// <summary> |
5120 | e66f22eb | KangIngu | /// 캔버스에 그릴때 모든 포인트가 캔버스를 벗어 났는지 체크하여 넘겨줌 |
5121 | /// </summary> |
||
5122 | /// <author>ingu</author> |
||
5123 | /// <date>2018.06.05</date> |
||
5124 | /// <param name="getPoint"></param> |
||
5125 | /// <returns></returns> |
||
5126 | private bool IsGetoutpoint(Point getPoint) |
||
5127 | 670a4be2 | humkyung | { |
5128 | e66f22eb | KangIngu | if (getPoint == new Point()) |
5129 | 670a4be2 | humkyung | { |
5130 | e66f22eb | KangIngu | ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl); |
5131 | currentControl = null; |
||
5132 | return true; |
||
5133 | 670a4be2 | humkyung | } |
5134 | |||
5135 | e66f22eb | KangIngu | return false; |
5136 | 670a4be2 | humkyung | } |
5137 | e66f22eb | KangIngu | |
5138 | 5b46312f | djkim | private void zoomAndPanControl_DragOver(object sender, DragEventArgs e) |
5139 | { |
||
5140 | e.Effects = DragDropEffects.Copy; |
||
5141 | } |
||
5142 | |||
5143 | private void zoomAndPanControl_DragEnter(object sender, DragEventArgs e) |
||
5144 | { |
||
5145 | e.Effects = DragDropEffects.Copy; |
||
5146 | } |
||
5147 | |||
5148 | private void zoomAndPanControl_DragLeave(object sender, DragEventArgs e) |
||
5149 | { |
||
5150 | e.Effects = DragDropEffects.None; |
||
5151 | } |
||
5152 | |||
5153 | e6a9ddaf | humkyung | /* |
5154 | 5b46312f | djkim | private void zoomAndPanControl_Drop(object sender, DragEventArgs e) |
5155 | { |
||
5156 | 90e7968d | ljiyeon | try |
5157 | 5b46312f | djkim | { |
5158 | 90e7968d | ljiyeon | if (e.Data.GetDataPresent(typeof(string))) |
5159 | { |
||
5160 | this.getCurrentPoint = e.GetPosition(drawingRotateCanvas); |
||
5161 | string dragData = e.Data.GetData(typeof(string)) as string; |
||
5162 | Move_Symbol(sender, dragData); |
||
5163 | } |
||
5164 | 5b46312f | djkim | } |
5165 | 90e7968d | ljiyeon | catch (Exception ex) |
5166 | { |
||
5167 | Logger.sendResLog("zoomAndPanControl_Drop", ex.ToString(), 0); |
||
5168 | } |
||
5169 | 5b46312f | djkim | } |
5170 | e6a9ddaf | humkyung | */ |
5171 | 787a4489 | KangIngu | } |
5172 | 5a6a5dd1 | humkyung | } |