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