개정판 40b3ce25
issue #754 Arc Arrow Line Control 추가
KCOM/Common/Converter/CommentTypeImgConverter.cs | ||
---|---|---|
42 | 42 |
resourcePath += "arc.png"; |
43 | 43 |
break; |
44 | 44 |
case MarkupToPDF.Controls.Common.ControlType.ArcArrow: |
45 |
//등록되지 않았습니다
|
|
45 |
resourcePath += "arrowarc.png";
|
|
46 | 46 |
break; |
47 | 47 |
case MarkupToPDF.Controls.Common.ControlType.ArrowMultiLine: |
48 | 48 |
resourcePath += "arrowTrans.png"; |
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
191 | 191 |
case "ArcControl": |
192 | 192 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArcLine, ThumbList = new List<Thumb>() }); |
193 | 193 |
break; |
194 |
case "ArrowArcControl": |
|
195 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArcArrow, ThumbList = new List<Thumb>() }); |
|
196 |
break; |
|
194 | 197 |
case "ArrowControl_Multi": |
195 | 198 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArrowMultiLine, ThumbList = new List<Thumb>() }); |
196 | 199 |
break; |
... | ... | |
337 | 340 |
case "ArcControl": |
338 | 341 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArcLine, ThumbList = new List<Thumb>() }); |
339 | 342 |
break; |
343 |
case "ArrowArcControl": |
|
344 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArcArrow, ThumbList = new List<Thumb>() }); |
|
345 |
break; |
|
340 | 346 |
case "DateControl": |
341 | 347 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Date, ThumbList = new List<Thumb>() }); |
342 | 348 |
break; |
... | ... | |
622 | 628 |
|
623 | 629 |
MemberSet.Last().ThumbList.Add(tm); |
624 | 630 |
|
625 |
if (markT == ControlType.ArcLine && list[i] == (member as ArcControl).MidPoint)
|
|
631 |
if ((markT == ControlType.ArcLine && list[i] == (member as ArcControl).MidPoint) || (markT == ControlType.ArcArrow && list[i] == (member as ArrowArcControl).MidPoint))
|
|
626 | 632 |
{ |
627 | 633 |
tm.Style = (Style)this.LayoutRoot.Resources["ThumbArcControlStyle"]; |
628 | 634 |
} |
... | ... | |
832 | 838 |
#region Arc + Line |
833 | 839 |
case ControlType.ArrowMultiLine: |
834 | 840 |
case ControlType.ArcLine: |
841 |
case ControlType.ArcArrow: |
|
835 | 842 |
case ControlType.SingleLine: |
836 | 843 |
case ControlType.Triangle: |
837 | 844 |
if (nearPoint.Equals(AllControl.PointSet[i])) |
... | ... | |
1211 | 1218 |
foreach (var item in MemberSet) |
1212 | 1219 |
{ |
1213 | 1220 |
#region 라인 & 아크 |
1214 |
if (item.Drawingtype == ControlType.SingleLine || item.Drawingtype == ControlType.ArcLine || item.Drawingtype == ControlType.ArrowMultiLine) |
|
1221 |
if (item.Drawingtype == ControlType.SingleLine || item.Drawingtype == ControlType.ArcLine || item.Drawingtype == ControlType.ArrowMultiLine || item.Drawingtype == ControlType.ArcArrow)
|
|
1215 | 1222 |
{ |
1216 | 1223 |
DynamicThumbUpdate(e, item); |
1217 | 1224 |
} |
... | ... | |
1564 | 1571 |
break; |
1565 | 1572 |
case ControlType.ArrowMultiLine: |
1566 | 1573 |
case ControlType.ArcLine: |
1574 |
case ControlType.ArcArrow: |
|
1567 | 1575 |
case ControlType.SingleLine: |
1568 | 1576 |
case ControlType.Triangle: |
1569 | 1577 |
(item.DrawingData as IPath).updateControl(); |
... | ... | |
1772 | 1780 |
break; |
1773 | 1781 |
case ControlType.ArrowMultiLine: |
1774 | 1782 |
case ControlType.ArcLine: |
1783 |
case ControlType.ArcArrow: |
|
1775 | 1784 |
case ControlType.SingleLine: |
1776 | 1785 |
case ControlType.Triangle: |
1777 | 1786 |
(item.DrawingData as IPath).updateControl(); |
... | ... | |
2113 | 2122 |
instance.SetArcPath(); |
2114 | 2123 |
BorderUpdate(); |
2115 | 2124 |
} |
2116 |
|
|
2125 |
else if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "ArrowArcControl") |
|
2126 |
{ |
|
2127 |
ArrowArcControl instance = ((MemberSet.First() as AdornerMember).DrawingData as ArrowArcControl); |
|
2128 |
if (instance.isTransOn) |
|
2129 |
{ |
|
2130 |
instance.isTransOn = false; |
|
2131 |
} |
|
2132 |
else |
|
2133 |
{ |
|
2134 |
instance.isTransOn = true; |
|
2135 |
} |
|
2136 |
instance.SetArcPath(); |
|
2137 |
BorderUpdate(); |
|
2138 |
} |
|
2117 | 2139 |
|
2118 | 2140 |
} |
2119 | 2141 |
|
KCOM/Events/Implementation/TopMenuEvent.cs | ||
---|---|---|
706 | 706 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
707 | 707 |
} |
708 | 708 |
break; |
709 |
case ("ArrowArcControl"): |
|
710 |
{ |
|
711 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
712 |
} |
|
713 |
break; |
|
709 | 714 |
case ("ArrowControl_Multi"): |
710 | 715 |
{ |
711 | 716 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize; |
... | ... | |
901 | 906 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
902 | 907 |
} |
903 | 908 |
break; |
909 |
case ("ArrowArcControl"): |
|
910 |
{ |
|
911 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
912 |
} |
|
913 |
break; |
|
904 | 914 |
case ("ArrowControl_Multi"): |
905 | 915 |
{ |
906 | 916 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
... | ... | |
1920 | 1930 |
TaskMessage("Arc 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
1921 | 1931 |
break; |
1922 | 1932 |
#endregion |
1933 |
#region ArrowArc |
|
1934 |
case "ArrowArc": |
|
1935 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowArc"; |
|
1936 |
instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ArcArrow; |
|
1937 |
//HiddenAxisLock.Visibility = Visibility.Visible; |
|
1938 |
TaskMessage("ArcArrow 코멘트 도구는 오른쪽 마우스를 사용해 좌우 반전을 사용하실 수 있습니다", TaskMessageType.Normal); |
|
1939 |
break; |
|
1940 |
#endregion |
|
1923 | 1941 |
#region ArrowMulti |
1924 | 1942 |
case "ArrowMulti": |
1925 | 1943 |
Common.ViewerDataModel.Instance.SelectedControl = "ArrowMulti"; |
KCOM/Events/Move.cs | ||
---|---|---|
232 | 232 |
break; |
233 | 233 |
case (ControlType.ArcArrow): |
234 | 234 |
{ |
235 |
s_point.X = Math.Min((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X);
|
|
236 |
s_point.X = Math.Min((control as ArcControl).MidPoint.X, s_point.X); |
|
237 |
s_point.Y = Math.Min((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y);
|
|
238 |
s_point.Y = Math.Min((control as ArcControl).MidPoint.Y, s_point.Y); |
|
239 |
e_point.X = Math.Max((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X);
|
|
240 |
e_point.X = Math.Max((control as ArcControl).MidPoint.X, e_point.X); |
|
241 |
e_point.Y = Math.Max((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y);
|
|
242 |
e_point.Y = Math.Max((control as ArcControl).MidPoint.Y, e_point.Y); |
|
235 |
s_point.X = Math.Min((control as ArrowArcControl).StartPoint.X, (control as ArrowArcControl).EndPoint.X);
|
|
236 |
s_point.X = Math.Min((control as ArrowArcControl).MidPoint.X, s_point.X);
|
|
237 |
s_point.Y = Math.Min((control as ArrowArcControl).StartPoint.Y, (control as ArrowArcControl).EndPoint.Y);
|
|
238 |
s_point.Y = Math.Min((control as ArrowArcControl).MidPoint.Y, s_point.Y);
|
|
239 |
e_point.X = Math.Max((control as ArrowArcControl).StartPoint.X, (control as ArrowArcControl).EndPoint.X);
|
|
240 |
e_point.X = Math.Max((control as ArrowArcControl).MidPoint.X, e_point.X);
|
|
241 |
e_point.Y = Math.Max((control as ArrowArcControl).StartPoint.Y, (control as ArrowArcControl).EndPoint.Y);
|
|
242 |
e_point.Y = Math.Max((control as ArrowArcControl).MidPoint.Y, e_point.Y);
|
|
243 | 243 |
rectSize = e_point - s_point; |
244 | 244 |
} |
245 | 245 |
break; |
KCOM/KCOM.csproj | ||
---|---|---|
1094 | 1094 |
<ItemGroup> |
1095 | 1095 |
<Resource Include="Resources\Cursor\customCursor2.cur" /> |
1096 | 1096 |
</ItemGroup> |
1097 |
<ItemGroup> |
|
1098 |
<Resource Include="Resources\Images\MenuImage_New\arrowarc.png" /> |
|
1099 |
</ItemGroup> |
|
1097 | 1100 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
1098 | 1101 |
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" /> |
1099 | 1102 |
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
1279 | 1279 |
(control as ArcControl).StrokeColor = Brushes.Red; |
1280 | 1280 |
} |
1281 | 1281 |
break; |
1282 |
case "ArrowArcControl": |
|
1283 |
{ |
|
1284 |
(control as ArrowArcControl).StrokeColor = Brushes.Red; |
|
1285 |
} |
|
1286 |
break; |
|
1282 | 1287 |
case "LineControl": |
1283 | 1288 |
{ |
1284 | 1289 |
(control as LineControl).StrokeColor = Brushes.Red; |
... | ... | |
1861 | 1866 |
}; |
1862 | 1867 |
control.DashSize = ViewerDataModel.Instance.DashSize; |
1863 | 1868 |
} |
1864 |
|
|
1865 |
|
|
1866 | 1869 |
} |
1867 | 1870 |
break; |
1868 | 1871 |
|
1869 | 1872 |
case ControlType.ArcArrow: |
1870 | 1873 |
{ |
1871 |
var control = currentControl as ArcControl; |
|
1874 |
var control = currentControl as ArrowArcControl;
|
|
1872 | 1875 |
if (control != null) |
1873 | 1876 |
{ |
1874 |
control.isTransOn = true;
|
|
1877 |
control.isTransOn = false;
|
|
1875 | 1878 |
control.ControlType = controlType; |
1876 |
if (move.mousemode == MouseMode.Drawing) |
|
1879 |
control.StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y); |
|
1880 |
control.MidPoint = new Point(0, 0); |
|
1881 |
control.EndPoint = new Point(currentCanvasDrawingMouseMovePoint.X, currentCanvasDrawingMouseMovePoint.Y); |
|
1882 |
Point tempPoint = control.EndPoint; |
|
1883 |
|
|
1884 |
if (ViewerDataModel.Instance.checkAxis || ViewerDataModel.Instance.IsPressShift) |
|
1877 | 1885 |
{ |
1878 |
//move.control_Move(ControlList, true, moveX, moveY); |
|
1886 |
ViewerDataModel.Instance.AngleValue = MathSet.returnAngleString(control.StartPoint, ref tempPoint, true); |
|
1887 |
control.EndPoint = tempPoint; |
|
1879 | 1888 |
} |
1880 | 1889 |
else |
1881 | 1890 |
{ |
1882 |
control.StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y); |
|
1883 |
control.MidPoint = new Point(0, 0); |
|
1884 |
control.EndPoint = new Point(currentCanvasDrawingMouseMovePoint.X, currentCanvasDrawingMouseMovePoint.Y); |
|
1891 |
ViewerDataModel.Instance.AngleValue = MathSet.returnAngleString(control.StartPoint, ref tempPoint, false); |
|
1885 | 1892 |
} |
1886 | 1893 |
|
1894 |
|
|
1887 | 1895 |
control.PointSet = new List<Point> |
1888 | 1896 |
{ |
1889 | 1897 |
control.StartPoint, |
... | ... | |
3801 | 3809 |
{ |
3802 | 3810 |
//if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3803 | 3811 |
//{ |
3804 |
if (currentControl is ArcControl) |
|
3812 |
if (currentControl is ArrowArcControl) |
|
3813 |
{ |
|
3814 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3815 |
if (IsGetoutpoint((currentControl as ArrowArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3805 | 3816 |
{ |
3806 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3807 |
if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3808 |
{ |
|
3809 |
return; |
|
3810 |
} |
|
3817 |
return; |
|
3818 |
} |
|
3811 | 3819 |
|
3812 |
CreateControl();
|
|
3820 |
CreateControl(); |
|
3813 | 3821 |
|
3814 |
(currentControl as ArcControl).ApplyOverViewData(); |
|
3815 |
currentControl = null; |
|
3816 |
this.MainAngle.Visibility = Visibility.Collapsed; |
|
3817 |
} |
|
3818 |
else |
|
3822 |
(currentControl as ArrowArcControl).ApplyOverViewData(); |
|
3823 |
currentControl = null; |
|
3824 |
this.MainAngle.Visibility = Visibility.Collapsed; |
|
3825 |
} |
|
3826 |
else |
|
3827 |
{ |
|
3828 |
currentControl = new ArrowArcControl |
|
3819 | 3829 |
{ |
3820 |
currentControl = new ArcControl |
|
3821 |
{ |
|
3822 |
Background = new SolidColorBrush(Colors.Red), |
|
3823 |
}; |
|
3824 |
currentControl.CommentID = Save.shortGuid(); |
|
3825 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
|
3826 |
currentControl.IsNew = true; |
|
3827 |
(currentControl as IMarkupCommonData).ControlType = ControlType.ArcArrow; |
|
3828 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
|
3829 |
this.MainAngle.Visibility = Visibility.Visible; |
|
3830 |
} |
|
3830 |
Background = new SolidColorBrush(Colors.Black) |
|
3831 |
}; |
|
3832 |
currentControl.CommentID = Save.shortGuid(); |
|
3833 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
|
3834 |
currentControl.IsNew = true; |
|
3835 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
|
3836 |
this.MainAngle.Visibility = Visibility.Visible; |
|
3837 |
} |
|
3831 | 3838 |
//} |
3832 | 3839 |
} |
3833 | 3840 |
else if (mouseButtonDown == MouseButton.Right) |
3834 | 3841 |
{ |
3835 |
(currentControl as ArcControl).setClock(); |
|
3842 |
if (currentControl != null) |
|
3843 |
{ |
|
3844 |
(currentControl as ArrowArcControl).setClock(); |
|
3845 |
(currentControl as ArrowArcControl).MidPoint = new Point(0, 0); |
|
3846 |
//(currentControl as ArcControl).ApplyTemplate(); |
|
3847 |
} |
|
3836 | 3848 |
} |
3837 | 3849 |
} |
3838 | 3850 |
break; |
KCOM/Views/TopMenu.xaml | ||
---|---|---|
293 | 293 |
<telerik:RadToggleButton CommandParameter="Arc" Grid.Column="0" Grid.Row="2" Tag="Arc" Width="30" Height="30" Click="ControlEvent"> |
294 | 294 |
<Image Source="/KCOM;component/Resources/Images/MenuImage_New/arc.png" /> |
295 | 295 |
</telerik:RadToggleButton> |
296 |
<telerik:RadToggleButton CommandParameter="ChainLine" Grid.Column="1" Grid.Row="2" Tag="Chain" Width="30" Height="30" Click="ControlEvent"> |
|
296 |
<telerik:RadToggleButton CommandParameter="ArrowArc" Grid.Column="1" Grid.Row="2" Tag="ArrowArc" Width="30" Height="30" Click="ControlEvent"> |
|
297 |
<Image Source="/KCOM;component/Resources/Images/MenuImage_New/arrowarc.png" /> |
|
298 |
</telerik:RadToggleButton> |
|
299 |
<telerik:RadToggleButton CommandParameter="ChainLine" Grid.Column="2" Grid.Row="2" Tag="Chain" Width="30" Height="30" Click="ControlEvent"> |
|
297 | 300 |
<Image Source="/KCOM;component/Resources/Images/MenuImage_New/lineChain.png" /> |
298 | 301 |
</telerik:RadToggleButton> |
299 | 302 |
<!--<CheckBox Margin="10,5,2,0" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="2" Grid.Row="0" Content="Fill" Checked="FillShapeEvent" Unchecked="FillShapeEvent" x:Name="cbFillShape" IsChecked="{Binding checkFillShape, Source={x:Static common:ViewerDataModel.Instance}}" />--> |
MarkupToPDF/Controls/Line/ArrowArcControl.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Net; |
|
3 |
using System.Windows; |
|
4 |
using System.Windows.Controls; |
|
5 |
using System.Windows.Documents; |
|
6 |
using System.Windows.Ink; |
|
7 |
using System.Windows.Input; |
|
8 |
using System.Windows.Media; |
|
9 |
using System.Windows.Media.Animation; |
|
10 |
using System.Windows.Shapes; |
|
11 |
using System.ComponentModel; |
|
12 |
using System.Collections.Generic; |
|
13 |
using MarkupToPDF.Controls.Common; |
|
14 |
using MarkupToPDF.Common; |
|
15 |
|
|
16 |
namespace MarkupToPDF.Controls.Line |
|
17 |
{ |
|
18 |
|
|
19 |
public class ArrowArcControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, IMarkupCommonData, IDashControl |
|
20 |
{ |
|
21 |
#region 초기선언 |
|
22 |
public event PropertyChangedEventHandler PropertyChanged; |
|
23 |
private const string PART_ArcPath = "PART_ArcPath"; |
|
24 |
public Path Base_ArcPath = null; |
|
25 |
#endregion |
|
26 |
static ArrowArcControl() |
|
27 |
{ |
|
28 |
DefaultStyleKeyProperty.OverrideMetadata(typeof(ArrowArcControl), new FrameworkPropertyMetadata(typeof(ArrowArcControl))); |
|
29 |
//Application.Current.Resources.MergedDictionaries.Add(Application.LoadComponent(new Uri("/MarkupToPDF;Component/Themes/generic.xaml")) as ResourceDictionary); |
|
30 |
ResourceDictionary dictionary = new ResourceDictionary(); |
|
31 |
dictionary.Source = new Uri("/MarkupToPDF;component/themes/generic.xaml", UriKind.RelativeOrAbsolute); |
|
32 |
Application.Current.Resources.MergedDictionaries.Add(dictionary); |
|
33 |
//System.Diagnostics.Debug.WriteLine("resource Count :" + Application.Current.Resources.MergedDictionaries.Count); |
|
34 |
} |
|
35 |
|
|
36 |
public ArrowArcControl() |
|
37 |
{ |
|
38 |
this.DefaultStyleKey = typeof(ArrowArcControl); |
|
39 |
} |
|
40 |
|
|
41 |
public void Dispose() |
|
42 |
{ |
|
43 |
GC.Collect(); |
|
44 |
GC.SuppressFinalize(this); |
|
45 |
Control control = new Control(); |
|
46 |
} |
|
47 |
protected void OnPropertyChanged(string propName) |
|
48 |
{ |
|
49 |
if (PropertyChanged != null) |
|
50 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
|
51 |
} |
|
52 |
|
|
53 |
#region Dependency Properties |
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
public static readonly DependencyProperty IsSelectedProperty = |
|
58 |
DependencyProperty.Register("IsSelected", typeof(bool), typeof(ArrowArcControl), new FrameworkPropertyMetadata(false, IsSelectedChanged)); |
|
59 |
|
|
60 |
public static readonly DependencyProperty ControlTypeProperty = |
|
61 |
DependencyProperty.Register("ControlType", typeof(ControlType), typeof(ArrowArcControl), new FrameworkPropertyMetadata(ControlType.ArcArrow)); |
|
62 |
|
|
63 |
public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register( |
|
64 |
"OverViewPathData", typeof(Geometry), typeof(ArrowArcControl), new PropertyMetadata(null)); |
|
65 |
|
|
66 |
public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register( |
|
67 |
"UserID", typeof(string), typeof(ArrowArcControl), new PropertyMetadata(null)); |
|
68 |
|
|
69 |
public static readonly DependencyProperty LineSizeProperty = DependencyProperty.Register( |
|
70 |
"LineSize", typeof(double), typeof(ArrowArcControl), new PropertyMetadata((Double)3, PointValueChanged)); |
|
71 |
|
|
72 |
public static readonly DependencyProperty DashSizeProperty = DependencyProperty.Register( |
|
73 |
"DashSize", typeof(DoubleCollection), typeof(ArrowArcControl), new PropertyMetadata(new DoubleCollection { 99999999 }, PointValueChanged)); |
|
74 |
|
|
75 |
public static readonly DependencyProperty StrokeColorProperty = DependencyProperty.Register( |
|
76 |
"StrokeColor", typeof(SolidColorBrush), typeof(ArrowArcControl), new PropertyMetadata(new SolidColorBrush(Colors.Red))); |
|
77 |
|
|
78 |
public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register( |
|
79 |
"PathData", typeof(Geometry), typeof(ArrowArcControl), null); |
|
80 |
|
|
81 |
//public static readonly DependencyProperty ClockProperty = DependencyProperty.Register( |
|
82 |
// "Clock", typeof(SweepDirection), typeof(ArrowArcControl), new PropertyMetadata(SweepDirection.Clockwise)); |
|
83 |
public static readonly DependencyProperty ClockProperty = DependencyProperty.Register( |
|
84 |
"Clock", typeof(bool), typeof(ArrowArcControl), new PropertyMetadata(false)); |
|
85 |
|
|
86 |
public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register( |
|
87 |
"StartPoint", typeof(Point), typeof(ArrowArcControl), new PropertyMetadata(new Point(0, 0), PointValueChanged)); |
|
88 |
public static readonly DependencyProperty MidPointProperty = DependencyProperty.Register( |
|
89 |
"MidPoint", typeof(Point), typeof(ArrowArcControl), new PropertyMetadata(new Point(0, 0), PointValueChanged)); |
|
90 |
|
|
91 |
public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register( |
|
92 |
"EndPoint", typeof(Point), typeof(ArrowArcControl), new PropertyMetadata(new Point(0, 0), PointValueChanged)); |
|
93 |
|
|
94 |
public static readonly DependencyProperty PointSetProperty = DependencyProperty.Register( |
|
95 |
"PointSet", typeof(List<Point>), typeof(ArrowArcControl), new PropertyMetadata(new List<Point>(), PointValueChanged)); |
|
96 |
|
|
97 |
public static readonly DependencyProperty isTransOnProperty = DependencyProperty.Register( |
|
98 |
"isTransOn", typeof(bool), typeof(ArrowArcControl), new PropertyMetadata(false)); |
|
99 |
|
|
100 |
public static readonly DependencyProperty AngleProperty = |
|
101 |
DependencyProperty.Register("AngleValue", typeof(double), typeof(ArrowArcControl), new PropertyMetadata((double)0.0, new PropertyChangedCallback |
|
102 |
(AngleValueChanged))); |
|
103 |
|
|
104 |
public static readonly DependencyProperty CenterXProperty = |
|
105 |
DependencyProperty.Register("CenterX", typeof(double), typeof(ArrowArcControl), new PropertyMetadata((double)0, OnCenterXYChanged)); |
|
106 |
|
|
107 |
public static readonly DependencyProperty CenterYProperty = |
|
108 |
DependencyProperty.Register("CenterY", typeof(double), typeof(ArrowArcControl), new PropertyMetadata((double)0, OnCenterXYChanged)); |
|
109 |
#endregion |
|
110 |
#region PropertyChanged Method |
|
111 |
|
|
112 |
public static void IsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
|
113 |
{ |
|
114 |
//var instance = (ArrowArcControl)sender; |
|
115 |
|
|
116 |
//if (e.OldValue != e.NewValue && instance.Base_ArcPath != null) |
|
117 |
//{ |
|
118 |
|
|
119 |
// instance.SetValue(e.Property, e.NewValue); |
|
120 |
|
|
121 |
// if (instance.IsSelected) |
|
122 |
// { |
|
123 |
// instance.Base_ArcPath.Stroke = new SolidColorBrush(Colors.Blue); |
|
124 |
// } |
|
125 |
// else |
|
126 |
// { |
|
127 |
// instance.Base_ArcPath.Stroke = new SolidColorBrush(Colors.Red); |
|
128 |
// } |
|
129 |
//} |
|
130 |
} |
|
131 |
|
|
132 |
public static void PointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
|
133 |
{ |
|
134 |
var instance = (ArrowArcControl)sender; |
|
135 |
if (e.OldValue != e.NewValue && instance.Base_ArcPath != null) |
|
136 |
{ |
|
137 |
instance.SetValue(e.Property, e.NewValue); |
|
138 |
instance.SetArcPath(); |
|
139 |
} |
|
140 |
} |
|
141 |
public static void AngleValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
|
142 |
{ |
|
143 |
var instance = (ArrowArcControl)sender; |
|
144 |
if (e.OldValue != e.NewValue && instance.Base_ArcPath != null) |
|
145 |
{ |
|
146 |
instance.SetValue(e.Property, e.NewValue); |
|
147 |
instance.SetArcPath(); |
|
148 |
} |
|
149 |
} |
|
150 |
public static void OnCenterXYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
|
151 |
{ |
|
152 |
var instance = (ArrowArcControl)sender; |
|
153 |
if (e.OldValue != e.NewValue && instance.Base_ArcPath != null) |
|
154 |
{ |
|
155 |
instance.SetValue(e.Property, e.NewValue); |
|
156 |
instance.SetArcPath(); |
|
157 |
} |
|
158 |
} |
|
159 |
|
|
160 |
|
|
161 |
|
|
162 |
#endregion |
|
163 |
#region Properties |
|
164 |
public string UserID |
|
165 |
{ |
|
166 |
get { return (string)GetValue(UserIDProperty); } |
|
167 |
set |
|
168 |
{ |
|
169 |
if (this.UserID != value) |
|
170 |
{ |
|
171 |
SetValue(UserIDProperty, value); |
|
172 |
OnPropertyChanged("UserID"); |
|
173 |
} |
|
174 |
} |
|
175 |
} |
|
176 |
public Double LineSize |
|
177 |
{ |
|
178 |
get { return (Double)GetValue(LineSizeProperty); } |
|
179 |
set |
|
180 |
{ |
|
181 |
if (this.LineSize != value) |
|
182 |
{ |
|
183 |
SetValue(LineSizeProperty, value); |
|
184 |
} |
|
185 |
} |
|
186 |
} |
|
187 |
|
|
188 |
|
|
189 |
public bool Clock |
|
190 |
{ |
|
191 |
get { return (bool)GetValue(ClockProperty); } |
|
192 |
set |
|
193 |
{ |
|
194 |
if (this.Clock != value) |
|
195 |
{ |
|
196 |
SetValue(ClockProperty, value); |
|
197 |
OnPropertyChanged("Clock"); |
|
198 |
} |
|
199 |
} |
|
200 |
} |
|
201 |
|
|
202 |
//public SweepDirection Clock |
|
203 |
//{ |
|
204 |
// get { return (SweepDirection)GetValue(ClockProperty); } |
|
205 |
// set |
|
206 |
// { |
|
207 |
// if (this.Clock != value) |
|
208 |
// { |
|
209 |
// SetValue(ClockProperty, value); |
|
210 |
// OnPropertyChanged("Clock"); |
|
211 |
// } |
|
212 |
// } |
|
213 |
//} |
|
214 |
public DoubleCollection DashSize |
|
215 |
{ |
|
216 |
get { return (DoubleCollection)GetValue(DashSizeProperty); } |
|
217 |
set |
|
218 |
{ |
|
219 |
if (this.DashSize != value) |
|
220 |
{ |
|
221 |
SetValue(DashSizeProperty, value); |
|
222 |
} |
|
223 |
} |
|
224 |
} |
|
225 |
public List<Point> PointSet |
|
226 |
{ |
|
227 |
get { return (List<Point>)GetValue(PointSetProperty); } |
|
228 |
set { SetValue(PointSetProperty, value); } |
|
229 |
} |
|
230 |
public double CenterX |
|
231 |
{ |
|
232 |
get { return (double)GetValue(CenterXProperty); } |
|
233 |
set { SetValue(CenterXProperty, value); } |
|
234 |
} |
|
235 |
public double CenterY |
|
236 |
{ |
|
237 |
get { return (double)GetValue(CenterYProperty); } |
|
238 |
set { SetValue(CenterYProperty, value); } |
|
239 |
} |
|
240 |
public SolidColorBrush StrokeColor |
|
241 |
{ |
|
242 |
get { return (SolidColorBrush)GetValue(StrokeColorProperty); } |
|
243 |
set |
|
244 |
{ |
|
245 |
if (this.StrokeColor != value) |
|
246 |
{ |
|
247 |
SetValue(StrokeColorProperty, value); |
|
248 |
} |
|
249 |
} |
|
250 |
} |
|
251 |
|
|
252 |
public Geometry OverViewPathData |
|
253 |
{ |
|
254 |
get |
|
255 |
{ |
|
256 |
return (Geometry)GetValue(OverViewPathDataProperty); |
|
257 |
} |
|
258 |
set |
|
259 |
{ |
|
260 |
SetValue(OverViewPathDataProperty, value); |
|
261 |
OnPropertyChanged("OverViewPathData"); |
|
262 |
} |
|
263 |
} |
|
264 |
|
|
265 |
public Geometry PathData |
|
266 |
{ |
|
267 |
get { return (Geometry)GetValue(PathDataProperty); } |
|
268 |
set |
|
269 |
{ |
|
270 |
SetValue(PathDataProperty, value); |
|
271 |
OnPropertyChanged("PathData"); |
|
272 |
} |
|
273 |
} |
|
274 |
public bool IsSelected |
|
275 |
{ |
|
276 |
get |
|
277 |
{ |
|
278 |
return (bool)GetValue(IsSelectedProperty); |
|
279 |
} |
|
280 |
set |
|
281 |
{ |
|
282 |
SetValue(IsSelectedProperty, value); |
|
283 |
} |
|
284 |
} |
|
285 |
|
|
286 |
public ControlType ControlType |
|
287 |
{ |
|
288 |
get |
|
289 |
{ |
|
290 |
return (ControlType)GetValue(ControlTypeProperty); |
|
291 |
} |
|
292 |
set |
|
293 |
{ |
|
294 |
SetValue(ControlTypeProperty, value); |
|
295 |
OnPropertyChanged("ControlType"); |
|
296 |
} |
|
297 |
} |
|
298 |
public double AngleValue |
|
299 |
{ |
|
300 |
get { return (double)GetValue(AngleProperty); } |
|
301 |
set { SetValue(AngleProperty, value); } |
|
302 |
} |
|
303 |
public double Angle |
|
304 |
{ |
|
305 |
get { return (double)GetValue(AngleProperty); } |
|
306 |
set |
|
307 |
{ |
|
308 |
if (this.Angle != value) |
|
309 |
{ |
|
310 |
SetValue(AngleProperty, value); |
|
311 |
} |
|
312 |
} |
|
313 |
} |
|
314 |
public Point EndPoint |
|
315 |
{ |
|
316 |
get { return (Point)GetValue(EndPointProperty); } |
|
317 |
set |
|
318 |
{ |
|
319 |
SetValue(EndPointProperty, value); |
|
320 |
OnPropertyChanged("EndPoint"); |
|
321 |
} |
|
322 |
} |
|
323 |
public Point StartPoint |
|
324 |
{ |
|
325 |
get { return (Point)GetValue(StartPointProperty); } |
|
326 |
set |
|
327 |
{ |
|
328 |
SetValue(StartPointProperty, value); |
|
329 |
OnPropertyChanged("StartPoint"); |
|
330 |
} |
|
331 |
} |
|
332 |
public Point MidPoint |
|
333 |
{ |
|
334 |
get { return (Point)GetValue(MidPointProperty); } |
|
335 |
set |
|
336 |
{ |
|
337 |
SetValue(MidPointProperty, value); |
|
338 |
OnPropertyChanged("MidPoint"); |
|
339 |
} |
|
340 |
} |
|
341 |
public bool isTransOn |
|
342 |
{ |
|
343 |
get { return (bool)GetValue(isTransOnProperty); } |
|
344 |
set |
|
345 |
{ |
|
346 |
SetValue(isTransOnProperty, value); |
|
347 |
OnPropertyChanged("isTransOn"); |
|
348 |
} |
|
349 |
} |
|
350 |
|
|
351 |
#endregion |
|
352 |
#region Object & Variable |
|
353 |
PathGeometry pathGeometry = new PathGeometry(); |
|
354 |
GeometryGroup instanceGroup = new GeometryGroup(); |
|
355 |
#endregion |
|
356 |
public override void OnApplyTemplate() |
|
357 |
{ |
|
358 |
base.OnApplyTemplate(); |
|
359 |
Base_ArcPath = GetTemplateChild(PART_ArcPath) as Path; |
|
360 |
SetArcPath(); |
|
361 |
} |
|
362 |
public void updateControl() |
|
363 |
{ |
|
364 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
|
365 |
this.MidPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
|
366 |
this.EndPoint = new Point(this.PointSet[2].X, this.PointSet[2].Y); |
|
367 |
} |
|
368 |
|
|
369 |
public void setClock() |
|
370 |
{ |
|
371 |
if (Clock) |
|
372 |
{ |
|
373 |
this.Clock = false; |
|
374 |
} |
|
375 |
else |
|
376 |
{ |
|
377 |
this.Clock = true; |
|
378 |
} |
|
379 |
} |
|
380 |
|
|
381 |
//public void setClock() |
|
382 |
//{ |
|
383 |
// if(this.Clock == SweepDirection.Clockwise) |
|
384 |
// { |
|
385 |
// this.Clock = SweepDirection.Counterclockwise; |
|
386 |
// } |
|
387 |
// else |
|
388 |
// { |
|
389 |
// this.Clock =SweepDirection.Clockwise; |
|
390 |
// } |
|
391 |
//} |
|
392 |
public void SetArcPath() |
|
393 |
{ |
|
394 |
this.ApplyTemplate(); |
|
395 |
|
|
396 |
|
|
397 |
//강인구 추가 |
|
398 |
Base_ArcPath.StrokeDashArray.Clear(); |
|
399 |
if (this.DashSize != null) |
|
400 |
{ |
|
401 |
foreach (var item in this.DashSize) |
|
402 |
{ |
|
403 |
Base_ArcPath.StrokeDashArray.Add(item); |
|
404 |
} |
|
405 |
Base_ArcPath.StrokeDashCap = PenLineCap.Square; |
|
406 |
instanceGroup.Children.Clear(); |
|
407 |
} |
|
408 |
PathFigure pathFigure = new PathFigure(); |
|
409 |
|
|
410 |
pathFigure.StartPoint = this.StartPoint; |
|
411 |
QuadraticBezierSegment qb = new QuadraticBezierSegment(); |
|
412 |
|
|
413 |
if (MidPoint != null) |
|
414 |
{ |
|
415 |
if (MidPoint == new Point(0,0)) |
|
416 |
{ |
|
417 |
double xSharp = 0; |
|
418 |
double ySharp = 0; |
|
419 |
|
|
420 |
//Point t_start = new Point(0, 0); |
|
421 |
//Point t_end = new Point(30, 10); |
|
422 |
|
|
423 |
var midP = MathSet.getMiddlePoint(StartPoint, EndPoint); |
|
424 |
Point normalV = MathSet.GetNormVectorBetween(StartPoint, EndPoint); |
|
425 |
var dis = MathSet.DistanceTo(StartPoint, EndPoint); |
|
426 |
|
|
427 |
if (!this.Clock) |
|
428 |
{ |
|
429 |
xSharp = -normalV.Y; |
|
430 |
ySharp = normalV.X; |
|
431 |
} |
|
432 |
else |
|
433 |
{ |
|
434 |
xSharp = normalV.Y; |
|
435 |
ySharp = -normalV.X; |
|
436 |
} |
|
437 |
|
|
438 |
var pointN = new Point(xSharp * dis, ySharp * dis); |
|
439 |
MidPoint = new Point(pointN.X + midP.X, pointN.Y + midP.Y); |
|
440 |
} |
|
441 |
qb.Point1 = this.MidPoint; |
|
442 |
} |
|
443 |
|
|
444 |
qb.Point2 = this.EndPoint; |
|
445 |
pathFigure.Segments.Add(qb); |
|
446 |
pathGeometry.Figures = new PathFigureCollection(); |
|
447 |
pathGeometry.Figures.Add(pathFigure); |
|
448 |
pathFigure.IsFilled = false; |
|
449 |
pathFigure.IsClosed = false; |
|
450 |
instanceGroup.Children.Add(pathGeometry); |
|
451 |
|
|
452 |
//화살표하나추가 |
|
453 |
instanceGroup.Children.Add(SingleAllow(this.MidPoint, this.StartPoint, this.LineSize)); |
|
454 |
//화살표 두개 추가시에는 밑에 꺼 쓰면 됨 |
|
455 |
//instanceGroup.Children.Add(ConverseAllow(this.EndPoint, this.MidPoint, this.LineSize)); |
|
456 |
this.Base_ArcPath.Fill = this.StrokeColor; |
|
457 |
//Base_ArcPath.StrokeThickness = 3; |
|
458 |
|
|
459 |
instanceGroup.FillRule = FillRule.Nonzero; |
|
460 |
this.PathData = instanceGroup; |
|
461 |
this.OverViewPathData = PathData; |
|
462 |
|
|
463 |
} |
|
464 |
|
|
465 |
|
|
466 |
public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize) |
|
467 |
{ |
|
468 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
469 |
PathGeometry pathGeometry = new PathGeometry(); |
|
470 |
PathFigure pathFigure = new PathFigure(); |
|
471 |
pathFigure.StartPoint = p1; |
|
472 |
|
|
473 |
Point lpoint = new Point(p1.X + lineSize * 2, p1.Y + lineSize * 4); |
|
474 |
Point rpoint = new Point(p1.X - lineSize * 2, p1.Y + lineSize * 4); |
|
475 |
|
|
476 |
LineSegment seg1 = new LineSegment(); |
|
477 |
seg1.Point = lpoint; |
|
478 |
pathFigure.Segments.Add(seg1); |
|
479 |
|
|
480 |
LineSegment seg2 = new LineSegment(); |
|
481 |
seg2.Point = rpoint; |
|
482 |
pathFigure.Segments.Add(seg2); |
|
483 |
|
|
484 |
LineSegment seg3 = new LineSegment(); |
|
485 |
seg3.Point = p1; |
|
486 |
pathFigure.Segments.Add(seg3); |
|
487 |
|
|
488 |
pathFigure.IsClosed = true; |
|
489 |
pathFigure.IsFilled = true; |
|
490 |
|
|
491 |
pathGeometry.Figures.Add(pathFigure); |
|
492 |
pathGeometry.FillRule = FillRule.Nonzero; |
|
493 |
RotateTransform transform = new RotateTransform(); |
|
494 |
transform.Angle = theta - 90; |
|
495 |
transform.CenterX = p1.X; |
|
496 |
transform.CenterY = p1.Y; |
|
497 |
pathGeometry.Transform = transform; |
|
498 |
return pathGeometry; |
|
499 |
} |
|
500 |
|
|
501 |
public static PathGeometry ConverseAllow(Point p2, Point p1, double lineSize) |
|
502 |
{ |
|
503 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
504 |
PathGeometry pathGeometry2 = new PathGeometry(); |
|
505 |
PathFigure pathFigure2 = new PathFigure(); |
|
506 |
pathFigure2.StartPoint = p2; |
|
507 |
|
|
508 |
Point lpoint2 = new Point(p2.X + lineSize * 2, p2.Y + lineSize * 4); |
|
509 |
Point rpoint2 = new Point(p2.X - lineSize * 2, p2.Y + lineSize * 4); |
|
510 |
LineSegment seg1_1 = new LineSegment(); |
|
511 |
seg1_1.Point = lpoint2; |
|
512 |
pathFigure2.Segments.Add(seg1_1); |
|
513 |
|
|
514 |
LineSegment seg2_1 = new LineSegment(); |
|
515 |
seg2_1.Point = rpoint2; |
|
516 |
pathFigure2.Segments.Add(seg2_1); |
|
517 |
|
|
518 |
LineSegment seg3_1 = new LineSegment(); |
|
519 |
seg3_1.Point = p2; |
|
520 |
pathFigure2.Segments.Add(seg3_1); |
|
521 |
|
|
522 |
LineSegment seg4_1 = new LineSegment(); |
|
523 |
|
|
524 |
seg4_1.Point = new Point(lpoint2.X, lpoint2.Y); |
|
525 |
pathFigure2.Segments.Add(seg4_1); |
|
526 |
|
|
527 |
//pathFigure2.IsFilled = true; |
|
528 |
//pathFigure2.IsClosed = true; |
|
529 |
|
|
530 |
RotateTransform transform2 = new RotateTransform(); |
|
531 |
transform2.Angle = theta + 90; |
|
532 |
transform2.CenterX = p2.X; |
|
533 |
transform2.CenterY = p2.Y; |
|
534 |
pathGeometry2.Figures.Add(pathFigure2); |
|
535 |
pathGeometry2.Transform = transform2; |
|
536 |
return pathGeometry2; |
|
537 |
} |
|
538 |
|
|
539 |
public void ApplyOverViewData() |
|
540 |
{ |
|
541 |
this.OverViewPathData = this.PathData; |
|
542 |
} |
|
543 |
} |
|
544 |
} |
MarkupToPDF/Controls/Parsing/MarkupCopy.cs | ||
---|---|---|
625 | 625 |
}; |
626 | 626 |
break; |
627 | 627 |
#endregion |
628 |
#endregion |
|
628 |
#region ArrowArc |
|
629 |
case "ArrowArcControl": |
|
630 |
using (S_ArrowArcControl STemp = new S_ArrowArcControl()) |
|
631 |
{ |
|
632 |
var instance = Control as ArrowArcControl; |
|
633 |
STemp.TransformPoint = "0|0"; |
|
634 |
STemp.PointSet = instance.PointSet; |
|
635 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
|
636 |
//STemp.StrokeColor = "#FF000FFF"; |
|
637 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
|
638 |
STemp.StartPoint = instance.StartPoint; |
|
639 |
STemp.UserID = UserId; |
|
640 |
STemp.Opac = instance.Opacity; |
|
641 |
STemp.MidPoint = instance.MidPoint; |
|
642 |
STemp.EndPoint = instance.EndPoint; |
|
643 |
STemp.IsTransOn = instance.isTransOn; |
|
644 |
STemp.DashSize = instance.DashSize; |
|
645 |
STemp.Clock = instance.Clock; |
|
646 |
//STemp.ArcStyleSet = instance.ControlType; |
|
647 |
STemp.Name = instance.GetType().Name.ToString(); |
|
648 |
|
|
649 |
///강인구 추가(2017.11.02) |
|
650 |
///Memo 추가 |
|
651 |
STemp.Memo = instance.Memo; |
|
652 |
|
|
653 |
///강인구 추가(2017.11.02) |
|
654 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
|
655 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
|
656 |
Data.DATA_TYPE = (int)(instance.ControlType); |
|
657 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
|
629 | 658 |
|
659 |
}; |
|
660 |
break; |
|
661 |
#endregion |
|
662 |
#endregion |
|
630 | 663 |
#region Shape |
631 | 664 |
#region RectCloud |
632 | 665 |
case "RectCloudControl": |
... | ... | |
1290 | 1323 |
}; |
1291 | 1324 |
break; |
1292 | 1325 |
#endregion |
1326 |
#region ArrowArc |
|
1327 |
case "ArrowArcControl": |
|
1328 |
using (S_ArrowArcControl STemp = new S_ArrowArcControl()) |
|
1329 |
{ |
|
1330 |
var instance = item as ArrowArcControl; |
|
1331 |
STemp.TransformPoint = "0|0"; |
|
1332 |
STemp.PointSet = instance.PointSet; |
|
1333 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
|
1334 |
//STemp.StrokeColor = "#FF000FFF"; |
|
1335 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
|
1336 |
STemp.StartPoint = instance.StartPoint; |
|
1337 |
STemp.UserID = UserId; |
|
1338 |
STemp.Opac = instance.Opacity; |
|
1339 |
STemp.MidPoint = instance.MidPoint; |
|
1340 |
STemp.EndPoint = instance.EndPoint; |
|
1341 |
STemp.IsTransOn = instance.isTransOn; |
|
1342 |
STemp.DashSize = instance.DashSize; |
|
1343 |
STemp.Clock = instance.Clock; |
|
1344 |
//STemp.ArcStyleSet = instance.ControlType; |
|
1345 |
STemp.Name = instance.GetType().Name.ToString(); |
|
1346 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
|
1347 |
}; |
|
1348 |
break; |
|
1349 |
#endregion |
|
1293 | 1350 |
#endregion |
1294 |
|
|
1295 | 1351 |
#region Shape |
1296 | 1352 |
#region RectCloud |
1297 | 1353 |
case "RectCloudControl": |
MarkupToPDF/Controls/Parsing/MarkupParse.cs | ||
---|---|---|
3112 | 3112 |
} |
3113 | 3113 |
break; |
3114 | 3114 |
#endregion |
3115 |
#endregion |
|
3115 |
#region ArrowArc |
|
3116 |
case "ArrowArcControl": |
|
3117 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
|
3118 |
{ |
|
3119 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
3120 |
ArrowArcControl instance = new ArrowArcControl() |
|
3121 |
{ |
|
3122 |
StartPoint = s.StartPoint, |
|
3123 |
EndPoint = s.EndPoint, |
|
3124 |
DashSize = s.DashSize, |
|
3125 |
PointSet = s.PointSet, |
|
3126 |
isTransOn = s.IsTransOn, |
|
3127 |
MidPoint = s.MidPoint, |
|
3128 |
StrokeColor = _SetColor, |
|
3129 |
Opacity = s.Opac, |
|
3130 |
Clock = s.Clock, |
|
3131 |
LineSize = Convert.ToDouble(data2.First()), |
|
3132 |
UserID = s.UserID, |
|
3133 |
}; |
|
3116 | 3134 |
|
3135 |
Layer.Children.Add(instance); |
|
3136 |
instance.ApplyTemplate(); |
|
3137 |
instance.SetArcPath(); |
|
3138 |
} |
|
3139 |
break; |
|
3140 |
#endregion |
|
3141 |
#endregion |
|
3117 | 3142 |
#region Text |
3118 | 3143 |
case "TextControl": |
3119 | 3144 |
using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
... | ... | |
3810 | 3835 |
} |
3811 | 3836 |
break; |
3812 | 3837 |
#endregion |
3838 |
#region ArrowArc |
|
3839 |
case "ArrowArcControl": |
|
3840 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
|
3841 |
{ |
|
3842 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
3843 |
ArrowArcControl instance = new ArrowArcControl() |
|
3844 |
{ |
|
3845 |
StartPoint = s.StartPoint, |
|
3846 |
EndPoint = s.EndPoint, |
|
3847 |
DashSize = s.DashSize, |
|
3848 |
PointSet = s.PointSet, |
|
3849 |
isTransOn = s.IsTransOn, |
|
3850 |
MidPoint = s.MidPoint, |
|
3851 |
StrokeColor = _SetColor, |
|
3852 |
Clock = s.Clock, |
|
3853 |
Opacity = s.Opac, |
|
3854 |
LineSize = Convert.ToDouble(data2.First()), |
|
3855 |
UserID = s.UserID, |
|
3856 |
}; |
|
3857 |
instance.Memo = s.Memo; |
|
3858 |
//Layer.Children.Add(instance); |
|
3859 |
instance.MarkupInfoID = markupInfoID; |
|
3860 |
baseLayer.Add(instance); |
|
3861 |
instance.ApplyTemplate(); |
|
3862 |
instance.SetArcPath(); |
|
3863 |
} |
|
3864 |
break; |
|
3865 |
#endregion |
|
3813 | 3866 |
#region RectCloud |
3814 | 3867 |
case "RectCloudControl": |
3815 | 3868 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
... | ... | |
4511 | 4564 |
} |
4512 | 4565 |
break; |
4513 | 4566 |
#endregion |
4567 |
#region ArrowArc |
|
4568 |
case "ArrowArcControl": |
|
4569 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
|
4570 |
{ |
|
4571 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
4572 |
ArrowArcControl instance = new ArrowArcControl() |
|
4573 |
{ |
|
4574 |
StartPoint = s.StartPoint, |
|
4575 |
EndPoint = s.EndPoint, |
|
4576 |
DashSize = s.DashSize, |
|
4577 |
PointSet = s.PointSet, |
|
4578 |
isTransOn = s.IsTransOn, |
|
4579 |
MidPoint = s.MidPoint, |
|
4580 |
StrokeColor = _SetColor, |
|
4581 |
Clock = s.Clock, |
|
4582 |
Opacity = s.Opac, |
|
4583 |
LineSize = Convert.ToDouble(data2.First()), |
|
4584 |
UserID = s.UserID, |
|
4585 |
}; |
|
4586 |
instance.Memo = s.Memo; |
|
4587 |
//Layer.Children.Add(instance); |
|
4588 |
instance.MarkupInfoID = markupInfoID; |
|
4589 |
baseLayer.Add(instance); |
|
4590 |
instance.CommentID = commentId; |
|
4591 |
instance.ApplyTemplate(); |
|
4592 |
instance.SetArcPath(); |
|
4593 |
} |
|
4594 |
break; |
|
4595 |
#endregion |
|
4596 |
|
|
4514 | 4597 |
#region RectCloud |
4515 | 4598 |
case "RectCloudControl": |
4516 | 4599 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
... | ... | |
5041 | 5124 |
} |
5042 | 5125 |
break; |
5043 | 5126 |
#endregion |
5044 |
#endregion |
|
5127 |
#region ArrowArc |
|
5128 |
case "ArrowArcControl": |
|
5129 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
|
5130 |
{ |
|
5131 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
5132 |
ArrowArcControl instance = new ArrowArcControl() |
|
5133 |
{ |
|
5134 |
StartPoint = s.StartPoint, |
|
5135 |
EndPoint = s.EndPoint, |
|
5136 |
DashSize = s.DashSize, |
|
5137 |
PointSet = s.PointSet, |
|
5138 |
isTransOn = s.IsTransOn, |
|
5139 |
MidPoint = s.MidPoint, |
|
5140 |
StrokeColor = _SetColor, |
|
5141 |
Opacity = s.Opac, |
|
5045 | 5142 |
|
5143 |
Clock = s.Clock, |
|
5144 |
LineSize = Convert.ToDouble(data2.First()), |
|
5145 |
UserID = s.UserID, |
|
5146 |
}; |
|
5147 |
baseLayer.Add(instance); |
|
5148 |
instance.ApplyTemplate(); |
|
5149 |
instance.OnApplyTemplate(); |
|
5150 |
instance.SetArcPath(); |
|
5151 |
return_control = instance; |
|
5152 |
} |
|
5153 |
break; |
|
5154 |
#endregion |
|
5155 |
#endregion |
|
5046 | 5156 |
#region Text |
5047 | 5157 |
case "TextControl": |
5048 | 5158 |
using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
... | ... | |
5795 | 5905 |
} |
5796 | 5906 |
break; |
5797 | 5907 |
#endregion |
5908 |
#region Arc |
|
5909 |
case "ArrowArcControl": |
|
5910 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
|
5911 |
{ |
|
5912 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
|
5913 |
ArrowArcControl instance = new ArrowArcControl() |
|
5914 |
{ |
|
5915 |
StartPoint = s.StartPoint, |
|
5916 |
EndPoint = s.EndPoint, |
|
5917 |
DashSize = s.DashSize, |
|
5918 |
PointSet = s.PointSet, |
|
5919 |
isTransOn = s.IsTransOn, |
|
5920 |
MidPoint = s.MidPoint, |
|
5921 |
StrokeColor = _SetColor, |
|
5922 |
Clock = s.Clock, |
|
5923 |
Opacity = s.Opac, |
|
5924 |
LineSize = Convert.ToDouble(data2.First()), |
|
5925 |
UserID = s.UserID, |
|
5926 |
}; |
|
5927 |
instance.Memo = s.Memo; |
|
5928 |
//Layer.Children.Add(instance); |
|
5929 |
instance.MarkupInfoID = markupInfoID; |
|
5930 |
baseLayer.Add(instance); |
|
5931 |
instance.CommentID = commentId; |
|
5932 |
instance.ApplyTemplate(); |
|
5933 |
instance.SetArcPath(); |
|
5934 |
return_control = instance; |
|
5935 |
} |
|
5936 |
break; |
|
5937 |
#endregion |
|
5798 | 5938 |
#region RectCloud |
5799 | 5939 |
case "RectCloudControl": |
5800 | 5940 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
MarkupToPDF/MarkupToPDF.csproj | ||
---|---|---|
124 | 124 |
<Compile Include="Controls\Etc\SignControl.cs" /> |
125 | 125 |
<Compile Include="Controls\Etc\SymControl.cs" /> |
126 | 126 |
<Compile Include="Controls\Etc\SymControlN.cs" /> |
127 |
<Compile Include="Controls\Line\ArrowArcControl.cs" /> |
|
127 | 128 |
<Compile Include="Controls\Parsing\MarkupCopy.cs" /> |
128 | 129 |
<Compile Include="Controls\Common\SelectControl.cs" /> |
129 | 130 |
<Compile Include="Controls\Common\Interfaces.cs" /> |
... | ... | |
155 | 156 |
</Compile> |
156 | 157 |
<Compile Include="Serialize\Core\JsonSerializerHelper.cs" /> |
157 | 158 |
<Compile Include="Serialize\S_Control\Base\S_BaseControl.cs" /> |
159 |
<Compile Include="Serialize\S_Control\Detail\S_ArrowArcControl.cs" /> |
|
158 | 160 |
<Compile Include="Serialize\S_Control\Detail\S_ArcControl.cs" /> |
159 | 161 |
<Compile Include="Serialize\S_Control\Detail\S_ArrowControl.cs" /> |
160 | 162 |
<Compile Include="Serialize\S_Control\Detail\S_CircleControl.cs" /> |
MarkupToPDF/Serialize/S_Control/Detail/S_ArrowArcControl.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Net; |
|
3 |
using System.Windows; |
|
4 |
using System.Windows.Controls; |
|
5 |
using System.Windows.Documents; |
|
6 |
using System.Windows.Ink; |
|
7 |
using System.Windows.Input; |
|
8 |
using System.Windows.Media; |
|
9 |
using System.Windows.Media.Animation; |
|
10 |
using System.Windows.Shapes; |
|
11 |
using System.Runtime.Serialization; |
|
12 |
using System.Collections.Generic; |
|
13 |
using MarkupToPDF.Controls.Common; |
|
14 |
|
|
15 |
namespace MarkupToPDF.Serialize.S_Control |
|
16 |
{ |
|
17 |
[DataContract] |
|
18 |
public class S_ArrowArcControl : S_BaseControl, IDisposable |
|
19 |
{ |
|
20 |
[DataMember] |
|
21 |
public Point MidPoint { get; set; } // Mid Point |
|
22 |
[DataMember] |
|
23 |
public string SizeSet { get; set; } // "LineSize|" |
|
24 |
[DataMember] |
|
25 |
public string StrokeColor { get; set; } //Hex Data |
|
26 |
[DataMember] |
|
27 |
public DoubleCollection DashSize { get; set; } |
|
28 |
[DataMember] |
|
29 |
public bool Clock { get; set; } //변형여부 |
|
30 |
[DataMember] |
|
31 |
public Boolean IsTransOn { get; set; } //변형여부 |
|
32 |
|
|
33 |
public void Dispose() |
|
34 |
{ |
|
35 |
GC.Collect(0, GCCollectionMode.Forced); |
|
36 |
GC.SuppressFinalize(this); |
|
37 |
} |
|
38 |
} |
|
39 |
} |
MarkupToPDF/Themes/generic.xaml | ||
---|---|---|
62 | 62 |
</Setter.Value> |
63 | 63 |
</Setter> |
64 | 64 |
</Style> |
65 |
|
|
65 |
<Style TargetType="{x:Type Line:ArrowArcControl}"> |
|
66 |
<Setter Property="Template"> |
|
67 |
<Setter.Value> |
|
68 |
<ControlTemplate TargetType="{x:Type Line:ArrowArcControl}"> |
|
69 |
<Path x:Name="PART_ArcPath" |
|
70 |
Stroke="{TemplateBinding StrokeColor}" |
|
71 |
StrokeThickness="{TemplateBinding LineSize}" |
|
72 |
Data="{TemplateBinding PathData}" |
|
73 |
RenderTransformOrigin="0.5,0.5" |
|
74 |
Fill="{TemplateBinding StrokeColor}"> |
|
75 |
</Path> |
|
76 |
</ControlTemplate> |
|
77 |
</Setter.Value> |
|
78 |
</Setter> |
|
79 |
</Style> |
|
66 | 80 |
<Style TargetType="{x:Type Line:ArrowControl_Multi}"> |
67 | 81 |
<Setter Property="Template"> |
68 | 82 |
<Setter.Value> |
내보내기 Unified diff