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