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