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