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