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