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