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