개정판 fd19a116
Fix: Conslidate할때 Z정렬이 유지되지 않는 오류 수정
Change-Id: I54e1878e0365f94ede14e366e6e769fe9fd4b4ec
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
14 | 14 |
using MarkupToPDF.Controls.Text; |
15 | 15 |
using System; |
16 | 16 |
using System.Collections.Generic; |
17 |
using System.Collections.ObjectModel; |
|
17 | 18 |
using System.Diagnostics; |
18 | 19 |
using System.Linq; |
19 | 20 |
using System.Reflection; |
... | ... | |
124 | 125 |
public CommentUserInfo previousControl { get; set; } |
125 | 126 |
public CommentUserInfo currentControl { get; set; } |
126 | 127 |
public ControlType controlType { get; set; } |
127 |
private Move move = new Move(); |
|
128 |
private double[] rotateValue = { 0, 90, 180, 270 }; |
|
129 |
public MouseHandlingMode mouseHandlingMode = MouseHandlingMode.None; |
|
128 |
public MouseHandlingMode mouseHandlingMode { get; set; } = MouseHandlingMode.None; |
|
130 | 129 |
private static readonly double DragThreshold = 5; |
131 | 130 |
private System.Windows.Input.Cursor cursor { get; set; } |
132 | 131 |
|
... | ... | |
143 | 142 |
private Point canvasZoommovingMouseDownPoint; |
144 | 143 |
private List<object> ControlList = new List<object>(); |
145 | 144 |
private ListBox listBox = new ListBox(); |
146 |
private Dictionary<Geometry, string> selected_item = new Dictionary<Geometry, string>(); |
|
147 | 145 |
private bool isDraggingSelectionRect = false; |
148 | 146 |
private VPRevision CurrentRev { get; set; } |
149 | 147 |
public RadRibbonButton btnConsolidate { get; set; } |
... | ... | |
152 | 150 |
public RadRibbonButton btnConsolidateFinalPDF { get; set; } |
153 | 151 |
|
154 | 152 |
public string Filename_ { get; set; } |
155 |
public double L_Size = 0; |
|
156 |
public AdornerFinal adorner_; |
|
157 | 153 |
public UndoData multi_UndoData; |
158 | 154 |
public string Symbol_ID = ""; |
159 | 155 |
|
... | ... | |
172 | 168 |
|
173 | 169 |
private Point Sync_Offset_Point; |
174 | 170 |
|
175 |
//강인구 테스트 |
|
176 |
private Path _SelectionPath { get; set; } |
|
177 |
|
|
178 |
public Path SelectionPath |
|
179 |
{ |
|
180 |
get |
|
181 |
{ |
|
182 |
return _SelectionPath; |
|
183 |
} |
|
184 |
set |
|
185 |
{ |
|
186 |
if (_SelectionPath != value) |
|
187 |
{ |
|
188 |
_SelectionPath = value; |
|
189 |
RaisePropertyChanged("SelectionPath"); |
|
190 |
} |
|
191 |
} |
|
192 |
} |
|
193 |
|
|
194 | 171 |
private System.Windows.Controls.Image _imageViewer { get; set; } |
195 | 172 |
|
196 | 173 |
public System.Windows.Controls.Image imageViewer |
... | ... | |
274 | 251 |
public int IsUpdate { get; set; } |
275 | 252 |
} |
276 | 253 |
|
277 |
private List<TempDt> tempDtList = new List<TempDt>(); |
|
278 |
|
|
279 | 254 |
public void SetCursor() |
280 | 255 |
{ |
281 | 256 |
this.Cursor = cursor; |
... | ... | |
652 | 627 |
/// add or update markup list |
653 | 628 |
foreach (var control in ViewerDataModel.Instance.MarkupControls_USER) |
654 | 629 |
{ |
630 |
#region Index를 저장한다. |
|
631 |
control.Index = ViewerDataModel.Instance.MarkupControls_USER.IndexOf(control); |
|
632 |
#endregion |
|
655 | 633 |
var markup = MarkupParser.MarkupToString(control, App.ViewInfo.UserID); |
656 | 634 |
|
657 | 635 |
var exist = ViewerDataModel.Instance.MyMarkupList.Find(data => data.ID == markup.CommentID); |
... | ... | |
725 | 703 |
|
726 | 704 |
private async Task PageChangingAsync(DOCPAGE currentPage, int changePageNumber, CancellationToken token) |
727 | 705 |
{ |
728 |
var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? changePageNumber + ViewerDataModel.Instance.PageBalanceNumber : changePageNumber;
|
|
706 |
var BalancePoint = ViewerDataModel.Instance.PageBalanceMode ? changePageNumber + ViewerDataModel.Instance.PageBalanceNumber : changePageNumber; |
|
729 | 707 |
|
730 | 708 |
#region 페이지가 벗어난 경우 |
731 | 709 |
|
... | ... | |
920 | 898 |
instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
921 | 899 |
instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
922 | 900 |
|
923 |
instanceMain.dzTopMenu.rotateOffSet = 0; |
|
924 | 901 |
var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.FirstOrDefault(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER); |
925 | 902 |
drawingPannelRotate(pageinfo.PAGE_ANGLE); |
926 | 903 |
|
... | ... | |
936 | 913 |
textControl.Base_TextBlock.Visibility = Visibility.Visible; |
937 | 914 |
} |
938 | 915 |
|
939 |
private SymControlN GetSymNControl(double PageWidth, double PageHeight, string userId, string markupInfoId, Point startPosition) |
|
940 |
{ |
|
941 |
SymControlN result = null; |
|
942 |
|
|
943 |
try |
|
944 |
{ |
|
945 |
double height = 80; |
|
946 |
double itemWidth = 180; |
|
947 |
|
|
948 |
System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y); |
|
949 |
System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y + height); |
|
950 |
System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + height); |
|
951 |
System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y); |
|
952 |
|
|
953 |
result = new SymControlN |
|
954 |
{ |
|
955 |
CommentID = Commons.ShortGuid(), |
|
956 |
MarkupInfoID = markupInfoId, |
|
957 |
UserID = userId, |
|
958 |
PointSet = new List<Point> { startPoint, leftBottomPoint, endPoint, topRightPoint }, |
|
959 |
StartPoint = startPoint, |
|
960 |
EndPoint = endPoint, |
|
961 |
CommentAngle = 0, |
|
962 |
LeftBottomPoint = leftBottomPoint, |
|
963 |
TopRightPoint = topRightPoint, |
|
964 |
Opacity = 1, |
|
965 |
PathXathData = "eJy1Ul1PwjAU/SvN9c3EdY5g1FAShyIxRgygxsemu7AbupZ0Vae/3g42/Azxxfuw9Z7Tnpx72t6lo4zdyAIFyHUBqwptSgG596tTzkuVYyHLqCDlbGnnPlK24C9k5hVP4viIV7LQfOWwROOlJ2ug36tVo1Sq5cLZJ5P1e1OrKRtYbV3qnsqcrZcC9oZNARuvpCL/KiCODoHxfo//EJmg8tIsNLKpd+hVLmBIWkPd2iU2cnGoFprlpJYGyzBOt8WuyeCVJSNgUstCM/1WHNgDZT5oJ3E4M0Ja5F7A8QmwgTTPIYlrnAfgIIm6W2hmVy3CN9M3GUzsyznOyVAdTBlG+NxvxffXx37nOlF3Fx3vppNd5P6nnL8bnWHlU23VktUrAWe3t5Px/cU5sKE1/qFRuKi8k6nV2Qae0ltIshPXncPNtX25lZF19BY2Sn2maWGK8GQEDMIXHbB7dJ7Ur1RrUcDmbXx3l76y0eN4endz+Qd/yX/663xk2v7eAQ==", |
|
966 |
Memo = null |
|
967 |
}; |
|
968 |
} |
|
969 |
catch (Exception ex) |
|
970 |
{ |
|
971 |
System.Diagnostics.Debug.WriteLine(ex.ToString()); |
|
972 |
} |
|
973 |
|
|
974 |
return result; |
|
975 |
} |
|
976 |
|
|
977 |
private RectangleControl GetRectControl(double PageWidth, double PageHeight, string userId, string markupInfoId, Point startPosition) |
|
978 |
{ |
|
979 |
RectangleControl result = null; |
|
980 |
|
|
981 |
try |
|
982 |
{ |
|
983 |
double height = 80; |
|
984 |
double itemWidth = 180; |
|
985 |
|
|
986 |
System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y); |
|
987 |
System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y + height); |
|
988 |
System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + height); |
|
989 |
System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y); |
|
990 |
|
|
991 |
result = new RectangleControl |
|
992 |
{ |
|
993 |
CommentID = Commons.ShortGuid(), |
|
994 |
MarkupInfoID = markupInfoId, |
|
995 |
LineSize = 5, |
|
996 |
Paint = MarkupToPDF.Controls.Common.PaintSet.None, |
|
997 |
StartPoint = startPoint, |
|
998 |
EndPoint = endPoint, |
|
999 |
CommentAngle = 0, |
|
1000 |
StrokeColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0x0, 0x0)), |
|
1001 |
//StrokeColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 64, 224, 208)), |
|
1002 |
FillColor = null, |
|
1003 |
DashSize = new System.Windows.Media.DoubleCollection(new[] { 999999.0 }), |
|
1004 |
Opacity = 1, |
|
1005 |
LeftBottomPoint = leftBottomPoint, |
|
1006 |
TopRightPoint = topRightPoint, |
|
1007 |
PointSet = new List<Point> { startPoint, leftBottomPoint, endPoint, topRightPoint }, |
|
1008 |
UserID = userId, |
|
1009 |
Memo = null |
|
1010 |
}; |
|
1011 |
} |
|
1012 |
catch (Exception ex) |
|
1013 |
{ |
|
1014 |
System.Diagnostics.Debug.WriteLine(ex.ToString()); |
|
1015 |
} |
|
1016 |
|
|
1017 |
return result; |
|
1018 |
} |
|
1019 |
|
|
1020 |
private TextControl GetTextControl(double PageWidth, double PageHeight, string userId, string markupInfoId, string Text, double fontSize, FontWeight fontWeight, TextAlignment textAlignment, Rect parentRect, double positionY) |
|
1021 |
{ |
|
1022 |
TextControl result = null; |
|
1023 |
|
|
1024 |
try |
|
1025 |
{ |
|
1026 |
var txtSize = ShapeMeasure(new TextBlock { Text = Text, FontSize = fontSize, FontWeight = fontWeight, FontFamily = new FontFamily("Tahoma") }); |
|
1027 |
|
|
1028 |
double startPositionX = parentRect.X; |
|
1029 |
|
|
1030 |
switch (textAlignment) |
|
1031 |
{ |
|
1032 |
case TextAlignment.Right: |
|
1033 |
startPositionX = parentRect.X + parentRect.Width - txtSize.Width; |
|
1034 |
break; |
|
1035 |
|
|
1036 |
case TextAlignment.Center: |
|
1037 |
startPositionX = parentRect.X + parentRect.Width / 2 - txtSize.Width / 2 - 3; |
|
1038 |
break; |
|
1039 |
} |
|
1040 |
|
|
1041 |
Point startPosition = new Point |
|
1042 |
{ |
|
1043 |
X = startPositionX, |
|
1044 |
Y = positionY |
|
1045 |
}; |
|
1046 |
|
|
1047 |
System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y); |
|
1048 |
System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + txtSize.Width, startPosition.Y + txtSize.Height); |
|
1049 |
System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + txtSize.Height); |
|
1050 |
System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + txtSize.Width, startPosition.Y); |
|
1051 |
|
|
1052 |
result = new TextControl |
|
1053 |
{ |
|
1054 |
CommentID = Commons.ShortGuid(), |
|
1055 |
MarkupInfoID = markupInfoId, |
|
1056 |
Text = Text, |
|
1057 |
StartPoint = startPoint, |
|
1058 |
EndPoint = endPoint, |
|
1059 |
CanvasX = startPosition.X, |
|
1060 |
CanvasY = startPosition.Y, |
|
1061 |
BoxWidth = txtSize.Width, |
|
1062 |
BoxHeight = txtSize.Height, |
|
1063 |
ControlType_No = 0, |
|
1064 |
LineSize = new Thickness(5), |
|
1065 |
TextSize = fontSize, |
|
1066 |
Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)), |
|
1067 |
FontSize = 10, |
|
1068 |
UserID = userId, |
|
1069 |
IsHighLight = false, |
|
1070 |
CommentAngle = 0, |
|
1071 |
PointSet = new List<Point>(), |
|
1072 |
Opacity = 1, |
|
1073 |
IsSelected = false, |
|
1074 |
TextFamily = new FontFamily("Tahoma"), |
|
1075 |
TextStyle = FontStyles.Normal, |
|
1076 |
TextWeight = FontWeights.Bold |
|
1077 |
}; |
|
1078 |
} |
|
1079 |
catch (Exception ex) |
|
1080 |
{ |
|
1081 |
} |
|
1082 |
|
|
1083 |
return result; |
|
1084 |
} |
|
1085 |
|
|
1086 |
public static Size ShapeMeasure(UIElement e) |
|
1087 |
{ |
|
1088 |
// Measured Size is bounded to be less than maxSize |
|
1089 |
Size maxSize = new Size( |
|
1090 |
double.PositiveInfinity, |
|
1091 |
double.PositiveInfinity); |
|
1092 |
e.Measure(maxSize); |
|
1093 |
return e.DesiredSize; |
|
1094 |
} |
|
1095 |
|
|
1096 | 916 |
/// <summary> |
1097 | 917 |
/// 주어진 pageNumber의 마크업 데이터를 읽어 화면에 표시한다. |
1098 | 918 |
/// </summary> |
... | ... | |
1146 | 966 |
} |
1147 | 967 |
#endregion |
1148 | 968 |
|
1149 |
System.Diagnostics.Debug.WriteLine("MarkupLoad - MarkupParser " + new TimeSpan(stopwatch.ElapsedTicks).ToString()); |
|
1150 |
|
|
1151 | 969 |
/// fire selection event |
1152 | 970 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
1153 | 971 |
this.gridViewMarkup.UnselectAll(); |
... | ... | |
1224 | 1042 |
//db에 업데이트 한 list 를 view 에 업데이트 |
1225 | 1043 |
string sDocID = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocInfo.ID; |
1226 | 1044 |
List<MarkupInfoItem> results = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetMarkupInfoItems(App.ViewInfo.ProjectNO, sDocID); |
1227 |
MarkupInfoItem dbinfo = results.Where(x => x.MarkupInfoID == markupinfo_id).FirstOrDefault();
|
|
1228 |
MarkupInfoItem viewinfo = Common.ViewerDataModel.Instance._markupInfoList.Where(x => x.MarkupInfoID == markupinfo_id).FirstOrDefault();
|
|
1045 |
MarkupInfoItem dbinfo = results.Find(x => x.MarkupInfoID == markupinfo_id);
|
|
1046 |
MarkupInfoItem viewinfo = Common.ViewerDataModel.Instance._markupInfoList.FirstOrDefault(x => x.MarkupInfoID == markupinfo_id);
|
|
1229 | 1047 |
if (dbinfo.MarkupList.Count > 0) |
1230 | 1048 |
{ |
1231 | 1049 |
if (viewinfo.MarkupList != null) |
... | ... | |
1489 | 1307 |
{ |
1490 | 1308 |
ControlList.Clear(); |
1491 | 1309 |
listBox.Items.Clear(); |
1492 |
selected_item.Clear(); |
|
1493 | 1310 |
|
1494 | 1311 |
(item as IMarkupCommonData).IsSelected = false; |
1495 | 1312 |
} |
1496 | 1313 |
} |
1497 | 1314 |
|
1498 |
public void ReleaseSelectPath() |
|
1499 |
{ |
|
1500 |
if (SelectionPath == null) |
|
1501 |
{ |
|
1502 |
SelectionPath = new Path(); |
|
1503 |
SelectionPath.Name = ""; |
|
1504 |
} |
|
1505 |
if (SelectionPath.Name != "") |
|
1506 |
{ |
|
1507 |
SelectionPath.Name = "None"; |
|
1508 |
} |
|
1509 |
SelectionPath.Opacity = 0.01; |
|
1510 |
SelectionPath.RenderTransform = null; |
|
1511 |
SelectionPath.RenderTransformOrigin = new Point(0, 0); |
|
1512 |
} |
|
1513 |
|
|
1514 |
#region 컨트롤 초기화 |
|
1515 |
|
|
1516 |
public void Control_Init(object control) |
|
1517 |
{ |
|
1518 |
if (L_Size != 0 && (control as IPath) != null) |
|
1519 |
{ |
|
1520 |
(control as IPath).LineSize = L_Size; |
|
1521 |
L_Size = 0; |
|
1522 |
} |
|
1523 |
|
|
1524 |
switch (control.GetType().Name) |
|
1525 |
{ |
|
1526 |
case "RectangleControl": |
|
1527 |
{ |
|
1528 |
(control as RectangleControl).StrokeColor = Brushes.Red; |
|
1529 |
} |
|
1530 |
break; |
|
1531 |
|
|
1532 |
case "CircleControl": |
|
1533 |
{ |
|
1534 |
(control as CircleControl).StrokeColor = Brushes.Red; |
|
1535 |
} |
|
1536 |
break; |
|
1537 |
|
|
1538 |
case "TriControl": |
|
1539 |
{ |
|
1540 |
(control as TriControl).StrokeColor = Brushes.Red; |
|
1541 |
} |
|
1542 |
break; |
|
1543 |
|
|
1544 |
case "RectCloudControl": |
|
1545 |
{ |
|
1546 |
(control as RectCloudControl).StrokeColor = Brushes.Red; |
|
1547 |
} |
|
1548 |
break; |
|
1549 |
|
|
1550 |
case "CloudControl": |
|
1551 |
{ |
|
1552 |
(control as CloudControl).StrokeColor = Brushes.Red; |
|
1553 |
} |
|
1554 |
break; |
|
1555 |
|
|
1556 |
case "PolygonControl": |
|
1557 |
{ |
|
1558 |
(control as PolygonControl).StrokeColor = Brushes.Red; |
|
1559 |
} |
|
1560 |
break; |
|
1561 |
|
|
1562 |
case "ArcControl": |
|
1563 |
{ |
|
1564 |
(control as ArcControl).StrokeColor = Brushes.Red; |
|
1565 |
} |
|
1566 |
break; |
|
1567 |
|
|
1568 |
case "ArrowArcControl": |
|
1569 |
{ |
|
1570 |
(control as ArrowArcControl).StrokeColor = Brushes.Red; |
|
1571 |
} |
|
1572 |
break; |
|
1573 |
|
|
1574 |
case "LineControl": |
|
1575 |
{ |
|
1576 |
(control as LineControl).StrokeColor = Brushes.Red; |
|
1577 |
} |
|
1578 |
break; |
|
1579 |
|
|
1580 |
case "ArrowControl_Multi": |
|
1581 |
{ |
|
1582 |
(control as ArrowControl_Multi).StrokeColor = Brushes.Red; |
|
1583 |
} |
|
1584 |
break; |
|
1585 |
|
|
1586 |
case "TextControl": |
|
1587 |
{ |
|
1588 |
(control as TextControl).BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
|
1589 |
} |
|
1590 |
break; |
|
1591 |
|
|
1592 |
case "ArrowTextControl": |
|
1593 |
{ |
|
1594 |
(control as ArrowTextControl).BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B)); |
|
1595 |
} |
|
1596 |
break; |
|
1597 |
|
|
1598 |
case "InsideWhiteControl": |
|
1599 |
{ |
|
1600 |
(control as InsideWhiteControl).StrokeColor = Brushes.White; |
|
1601 |
} |
|
1602 |
break; |
|
1603 |
|
|
1604 |
case "OverlapWhiteControl": |
|
1605 |
{ |
|
1606 |
(control as OverlapWhiteControl).StrokeColor = Brushes.White; |
|
1607 |
} |
|
1608 |
break; |
|
1609 |
|
|
1610 |
case "ClipWhiteControl": |
|
1611 |
{ |
|
1612 |
(control as ClipWhiteControl).StrokeColor = Brushes.White; |
|
1613 |
} |
|
1614 |
break; |
|
1615 |
|
|
1616 |
case "CoordinateControl": |
|
1617 |
{ |
|
1618 |
(control as CoordinateControl).StrokeColor = Brushes.Black; |
|
1619 |
} |
|
1620 |
break; |
|
1621 |
} |
|
1622 |
} |
|
1623 |
|
|
1624 |
#endregion 컨트롤 초기화 |
|
1625 |
|
|
1626 |
public void firstCondition_MouseLeave(object sender, MouseEventArgs e) |
|
1627 |
{ |
|
1628 |
//Control_Init(e.Source); |
|
1629 |
} |
|
1630 |
|
|
1631 | 1315 |
//private Window _dragdropWindow = null; |
1632 | 1316 |
|
1633 | 1317 |
[DllImport("user32.dll")] |
... | ... | |
1641 | 1325 |
public Int32 Y; |
1642 | 1326 |
}; |
1643 | 1327 |
|
1644 |
/* |
|
1645 |
public string symbol_id = null; |
|
1646 |
public long symbol_group_id; |
|
1647 |
public int symbol_SelectedIndex; |
|
1648 |
public ImageSource symbol_img; |
|
1649 |
public string symbol_Data = null; |
|
1650 |
public void symboldata(string id, long group_id, int SelectedIndex, string Data_, ImageSource img) |
|
1651 |
{ |
|
1652 |
PlaceImageSymbol(symbol_id, symbol_group_id, symbol_SelectedIndex, new Point(zoomAndPanCanvas.ActualWidth / 2, |
|
1653 |
zoomAndPanCanvas.ActualHeight / 2)); |
|
1654 |
|
|
1655 |
if (this._dragdropWindow != null) |
|
1656 |
{ |
|
1657 |
this._dragdropWindow.Close(); |
|
1658 |
this._dragdropWindow = null; |
|
1659 |
} |
|
1660 |
|
|
1661 |
symbol_id = id; |
|
1662 |
symbol_group_id = group_id; |
|
1663 |
symbol_SelectedIndex = SelectedIndex; |
|
1664 |
symbol_Data = Data_; |
|
1665 |
symbol_img = img; |
|
1666 |
|
|
1667 |
CreateDragDropWindow2(img); |
|
1668 |
} |
|
1669 |
|
|
1670 |
private void CreateDragDropWindow2(ImageSource image) |
|
1671 |
{ |
|
1672 |
this._dragdropWindow = new Window(); |
|
1673 |
_dragdropWindow.Cursor = new Cursor(App.DefaultArrowCursorStream); |
|
1674 |
_dragdropWindow.WindowStyle = WindowStyle.None; |
|
1675 |
_dragdropWindow.AllowsTransparency = true; |
|
1676 |
_dragdropWindow.AllowDrop = false; |
|
1677 |
_dragdropWindow.Background = null; |
|
1678 |
_dragdropWindow.IsHitTestVisible = false; |
|
1679 |
_dragdropWindow.SizeToContent = SizeToContent.WidthAndHeight; |
|
1680 |
_dragdropWindow.Topmost = true; |
|
1681 |
_dragdropWindow.ShowInTaskbar = false; |
|
1682 |
|
|
1683 |
Rectangle r = new Rectangle(); |
|
1684 |
r.Width = image.Width; |
|
1685 |
r.Height = image.Height; |
|
1686 |
r.Opacity = 0.5; |
|
1687 |
r.Fill = new ImageBrush(image); |
|
1688 |
this._dragdropWindow.Content = r; |
|
1689 |
|
|
1690 |
Win32Point w32Mouse = new Win32Point(); |
|
1691 |
GetCursorPos(ref w32Mouse); |
|
1692 |
|
|
1693 |
//w32Mouse.X = getCurrentPoint.X; |
|
1694 |
this._dragdropWindow.Left = w32Mouse.X - (image.Width / 2); |
|
1695 |
this._dragdropWindow.Top = w32Mouse.Y - (image.Height / 2); |
|
1696 |
this._dragdropWindow.Show(); |
|
1697 |
} |
|
1698 |
|
|
1699 |
*/ |
|
1700 |
|
|
1701 | 1328 |
public void MoveZoomAndPanControl(Vector dragOffset) |
1702 | 1329 |
{ |
1703 | 1330 |
zoomAndPanControl.ContentOffsetX -= dragOffset.X; |
... | ... | |
2238 | 1865 |
} |
2239 | 1866 |
} |
2240 | 1867 |
|
2241 |
private CommentUserInfo enterMouse = null; |
|
2242 |
|
|
2243 |
private object IntersectsControls(Point mousePosition, Canvas drawingRotateCanvas) |
|
2244 |
{ |
|
2245 |
object result = null; |
|
2246 |
|
|
2247 |
// 검색할 정사각형의 크기 및 반경 설정 |
|
2248 |
double squareSize = 1; |
|
2249 |
Rect searchRect = new Rect( |
|
2250 |
mousePosition.X - squareSize, |
|
2251 |
mousePosition.Y - squareSize, |
|
2252 |
squareSize * 2, |
|
2253 |
squareSize * 2 |
|
2254 |
); |
|
2255 |
|
|
2256 |
foreach (CommentUserInfo child in drawingRotateCanvas.ChildrenOfType<CommentUserInfo>()) |
|
2257 |
{ |
|
2258 |
if (child is CommentUserInfo comment) |
|
2259 |
{ |
|
2260 |
// 검색 영역과 Rectangle의 경계가 겹치는지 확인합니다. |
|
2261 |
if (searchRect.IntersectsWith(child.ItemRect)) |
|
2262 |
{ |
|
2263 |
child.IsMouseEnter = true; |
|
2264 |
result = (object)child; |
|
2265 |
// Geometry를 적용하거나 원하는 작업을 수행합니다. |
|
2266 |
// 예: rectangle.Fill = new SolidColorBrush(Colors.Red); |
|
2267 |
} |
|
2268 |
else |
|
2269 |
{ |
|
2270 |
child.IsMouseEnter = false; |
|
2271 |
} |
|
2272 |
} |
|
2273 |
} |
|
2274 |
|
|
2275 |
return result; |
|
2276 |
} |
|
2277 |
|
|
2278 | 1868 |
private void zoomAndPanControl2_MouseMove(object sender, MouseEventArgs e) |
2279 | 1869 |
{ |
2280 | 1870 |
if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed)) |
... | ... | |
2296 | 1886 |
} |
2297 | 1887 |
} |
2298 | 1888 |
|
2299 |
private List<CommentUserInfo> hitList = new List<CommentUserInfo>(); |
|
2300 |
|
|
2301 | 1889 |
private void zoomAndPanControl_MouseUp(object sender, MouseButtonEventArgs e) |
2302 | 1890 |
{ |
2303 | 1891 |
IsDrawing = false; |
... | ... | |
2603 | 2191 |
ViewerDataModel.Instance.MarkupAngle = rotate.Angle; |
2604 | 2192 |
} |
2605 | 2193 |
|
2606 |
private void syncPannelRotate(double angle) |
|
2607 |
{ |
|
2608 |
//Logger.sendCheckLog("pageNavigator_PageChanging_drawingPannelRotate Setting", 1); |
|
2609 |
rotate.Angle = angle; |
|
2610 |
var rotationNum = Math.Abs((rotate.Angle / 90)); |
|
2611 |
|
|
2612 |
if (angle == 90 || angle == 270) |
|
2613 |
{ |
|
2614 |
double emptySize = zoomAndPanCanvas2.Width; |
|
2615 |
zoomAndPanCanvas2.Width = zoomAndPanCanvas2.Height; |
|
2616 |
zoomAndPanCanvas2.Height = emptySize; |
|
2617 |
} |
|
2618 |
if (angle == 0) |
|
2619 |
{ |
|
2620 |
translate2.X = 0; |
|
2621 |
translate2.Y = 0; |
|
2622 |
} |
|
2623 |
else if (angle == 90) |
|
2624 |
{ |
|
2625 |
translate2.X = zoomAndPanCanvas2.Width; |
|
2626 |
translate2.Y = 0; |
|
2627 |
} |
|
2628 |
else if (angle == 180) |
|
2629 |
{ |
|
2630 |
translate2.X = zoomAndPanCanvas2.Width; |
|
2631 |
translate2.Y = zoomAndPanCanvas2.Height; |
|
2632 |
} |
|
2633 |
else |
|
2634 |
{ |
|
2635 |
translate2.X = 0; |
|
2636 |
translate2.Y = zoomAndPanCanvas2.Height; |
|
2637 |
} |
|
2638 |
|
|
2639 |
zoomAndPanControl2.RotationAngle = rotate.Angle; |
|
2640 |
} |
|
2641 |
|
|
2642 |
public void PlaceImageSymbol(string id, string groupID, int SelectedIndex, Point canvasZoomPanningMouseDownPoint) |
|
2643 |
{ |
|
2644 |
string Data_ = ""; |
|
2645 |
|
|
2646 |
try |
|
2647 |
{ |
|
2648 |
//Logger.sendReqLog("GetSymbolImageURL: ", id + "," + SelectedIndex, 1); |
|
2649 |
Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolImageURL(id, SelectedIndex); |
|
2650 |
if (Data_ != null || Data_ != "") |
|
2651 |
{ |
|
2652 |
//Logger.sendResLog("GetSymbolImageURL", "TRUE", 1); |
|
2653 |
} |
|
2654 |
else |
|
2655 |
{ |
|
2656 |
//Logger.sendResLog("GetSymbolImageURL", "FALSE", 1); |
|
2657 |
} |
|
2658 |
|
|
2659 |
//MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
|
2660 |
//{ |
|
2661 |
// SYMBOL_ID = id,//InnerItem.Symbol_ID |
|
2662 |
// STATE = 0, |
|
2663 |
//}; |
|
2664 |
if (Data_ != null) |
|
2665 |
{ |
|
2666 |
Image img = new Image(); |
|
2667 |
//img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Data_)); |
|
2668 |
if (Data_.Contains(".svg")) |
|
2669 |
{ |
|
2670 |
SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(Data_); |
|
2671 |
img.Source = (DrawingImage)svgImage.ProvideValue(null); |
|
2672 |
} |
|
2673 |
else |
|
2674 |
{ |
|
2675 |
img.Source = new BitmapImage(new Uri(Data_)); |
|
2676 |
} |
|
2677 |
|
|
2678 |
var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
|
2679 |
{ |
|
2680 |
PointSet = new List<Point>(), |
|
2681 |
FilePath = Data_, |
|
2682 |
ImageData = img.Source, |
|
2683 |
StartPoint = canvasZoomPanningMouseDownPoint, |
|
2684 |
EndPoint = new Point(canvasZoomPanningMouseDownPoint.X + img.Source.Width, |
|
2685 |
canvasZoomPanningMouseDownPoint.Y + img.Source.Height), |
|
2686 |
TopRightPoint = new Point(canvasZoomPanningMouseDownPoint.X + img.Source.Width, |
|
2687 |
canvasZoomPanningMouseDownPoint.Y), |
|
2688 |
LeftBottomPoint = new Point(canvasZoomPanningMouseDownPoint.X, |
|
2689 |
canvasZoomPanningMouseDownPoint.Y + img.Source.Height) |
|
2690 |
}; |
|
2691 |
|
|
2692 |
currentControl.PointSet = new List<Point> |
|
2693 |
{ |
|
2694 |
currentControl.StartPoint, |
|
2695 |
currentControl.LeftBottomPoint, |
|
2696 |
currentControl.EndPoint, |
|
2697 |
currentControl.TopRightPoint, |
|
2698 |
}; |
|
2699 |
UndoDataGroup = new UndoDataGroup() |
|
2700 |
{ |
|
2701 |
IsUndo = false, |
|
2702 |
Event = EventType.Create |
|
2703 |
}; |
|
2704 |
ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
|
2705 |
{ |
|
2706 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
2707 |
}); |
|
2708 |
|
|
2709 |
//multi_UndoData = dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
2710 |
var UndoData = new UndoData(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
2711 |
UndoDataGroup.MarkupDataColl.Add(UndoData); |
|
2712 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGroup); |
|
2713 |
|
|
2714 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
2715 |
currentControl.CommentID = Commons.ShortGuid(); |
|
2716 |
currentControl.SymbolID = id; |
|
2717 |
currentControl.GroupID = groupID; |
|
2718 |
currentControl.ApplyTemplate(); |
|
2719 |
currentControl.SetImage(); |
|
2720 |
|
|
2721 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
2722 |
Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
2723 |
SelectLayer.Children.Add(final); |
|
2724 |
} |
|
2725 |
} |
|
2726 |
catch (Exception ex) |
|
2727 |
{ |
|
2728 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error"); |
|
2729 |
} |
|
2730 |
} |
|
2731 |
|
|
2732 | 2194 |
// 저장전 textbox 입력 완료 때문에 public로 하여 savecommand에서 호출하도록 임시로 함. |
2733 | 2195 |
public async void zoomAndPanControl_MouseDown(object sender, MouseButtonEventArgs e) |
2734 | 2196 |
{ |
... | ... | |
3089 | 2551 |
} |
3090 | 2552 |
else |
3091 | 2553 |
{ |
3092 |
this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null);
|
|
2554 |
await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(null, null);
|
|
3093 | 2555 |
if (ViewerDataModel.Instance.MyMarkupList.Any(d => d.PageNumber == Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber |
3094 | 2556 |
&& d.Data_Type == Convert.ToInt32(MarkupToPDF.Controls.Common.ControlType.Coordinate))) |
3095 | 2557 |
{ |
... | ... | |
4710 | 4172 |
{ |
4711 | 4173 |
foreach (var item in SelectionSet.Instance.SelectedItems) |
4712 | 4174 |
{ |
4713 |
item.ZIndex = 99;
|
|
4175 |
item.ZIndex = CommentUserInfo.MaxZIndex;
|
|
4714 | 4176 |
item.Index = -1; |
4715 | 4177 |
Canvas.SetZIndex(item, item.ZIndex); |
4716 | 4178 |
item.UpdateControl(); |
... | ... | |
4730 | 4192 |
{ |
4731 | 4193 |
if (item.GetType().Name == "AdornerFinal") |
4732 | 4194 |
{ |
4733 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
|
|
4195 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members) |
|
4734 | 4196 |
{ |
4735 | 4197 |
AdonerList.Add(InnerItem); |
4736 | 4198 |
} |
... | ... | |
4750 | 4212 |
|
4751 | 4213 |
private void RemoveLineStroke(Point P) |
4752 | 4214 |
{ |
4753 |
var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseEnter).FirstOrDefault();
|
|
4215 |
var control = ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(data => data.IsMouseEnter);
|
|
4754 | 4216 |
if (control != null) |
4755 | 4217 |
{ |
4756 | 4218 |
UndoCommand.Instance.Push(EventType.Delete, new List<CommentUserInfo>() { control }); |
... | ... | |
4803 | 4265 |
if (result) |
4804 | 4266 |
{ |
4805 | 4267 |
var consolidateItem = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0); |
4806 |
|
|
4807 | 4268 |
if (consolidateItem?.Count() > 0) |
4808 | 4269 |
{ |
4809 | 4270 |
gridViewMarkup.Select(consolidateItem); |
... | ... | |
4835 | 4296 |
} |
4836 | 4297 |
} |
4837 | 4298 |
|
4838 |
var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(); |
|
4299 |
var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(null, null);
|
|
4839 | 4300 |
if (isSave) |
4840 | 4301 |
{ |
4841 | 4302 |
var token = ViewerDataModel.Instance.NewMarkupCancelToken(); |
... | ... | |
4870 | 4331 |
} |
4871 | 4332 |
else |
4872 | 4333 |
{ |
4873 |
var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(); |
|
4874 |
|
|
4334 |
var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(null, null); |
|
4875 | 4335 |
if (isSave) |
4876 | 4336 |
{ |
4877 | 4337 |
var token = ViewerDataModel.Instance.NewMarkupCancelToken(); |
... | ... | |
5950 | 5410 |
} |
5951 | 5411 |
} |
5952 | 5412 |
|
5953 |
public async Task<PngBitmapEncoder> symImageAsync(string data) |
|
5954 |
{ |
|
5955 |
Canvas _canvas = new Canvas(); |
|
5956 |
_canvas.Background = Brushes.White; |
|
5957 |
_canvas.Width = adorner_.BorderSize.Width; |
|
5958 |
_canvas.Height = adorner_.BorderSize.Height; |
|
5959 |
await MarkupParser.ParseAsync(App.BaseAddress, App.ViewInfo.ProjectNO, data, _canvas,ViewerDataModel.Instance.PageAngle, "#FFFF0000", "", ViewerDataModel.Instance.NewMarkupCancelToken(), |
|
5960 |
STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
|
5961 |
|
|
5962 |
BitmapEncoder encoder = new PngBitmapEncoder(); |
|
5963 |
|
|
5964 |
RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)_canvas.Width + 50, (int)_canvas.Height + 50, 96d, 96d, PixelFormats.Pbgra32); |
|
5965 |
|
|
5966 |
DrawingVisual dv = new DrawingVisual(); |
|
5967 |
|
|
5968 |
_canvas.Measure(new System.Windows.Size(adorner_.BorderSize.Width + 50, adorner_.BorderSize.Height + 50)); |
|
5969 |
_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))); |
|
5970 |
|
|
5971 |
using (DrawingContext ctx = dv.RenderOpen()) |
|
5972 |
{ |
|
5973 |
VisualBrush vb = new VisualBrush(_canvas); |
|
5974 |
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))); |
|
5975 |
} |
|
5976 |
|
|
5977 |
try |
|
5978 |
{ |
|
5979 |
renderBitmap.Render(dv); |
|
5980 |
|
|
5981 |
GC.Collect(2); |
|
5982 |
GC.WaitForPendingFinalizers(); |
|
5983 |
//GC.Collect(); |
|
5984 |
// encode png data |
|
5985 |
PngBitmapEncoder pngEncoder = new PngBitmapEncoder(); |
|
5986 |
// puch rendered bitmap into it |
|
5987 |
pngEncoder.Interlace = PngInterlaceOption.Off; |
|
5988 |
pngEncoder.Frames.Add(BitmapFrame.Create(renderBitmap)); |
|
5989 |
return pngEncoder; |
|
5990 |
} |
|
5991 |
catch //(Exception ex) |
|
5992 |
{ |
|
5993 |
return null; |
|
5994 |
} |
|
5995 |
} |
|
5996 |
|
|
5997 | 5413 |
public void DialogMessage_Alert(string content, string header) |
5998 | 5414 |
{ |
5999 | 5415 |
App.splashScreen.Close(); |
... | ... | |
6426 | 5842 |
} |
6427 | 5843 |
*/ |
6428 | 5844 |
} |
6429 |
|
|
6430 |
public class testItem |
|
6431 |
{ |
|
6432 |
public string Title { get; set; } |
|
6433 |
} |
|
6434 |
|
|
6435 |
|
|
6436 | 5845 |
} |
내보내기 Unified diff