hytos / ID2.Manager / ID2.Manager.Compare / Forms / ExceptLayer.cs @ 2ade1e61
이력 | 보기 | 이력해설 | 다운로드 (2.98 KB)
1 | 13a36357 | humkyung | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.ComponentModel; |
||
4 | using System.Data; |
||
5 | using System.Drawing; |
||
6 | using System.Linq; |
||
7 | using System.Text; |
||
8 | using System.Threading.Tasks; |
||
9 | using System.Windows.Forms; |
||
10 | |||
11 | using Telerik.WinControls; |
||
12 | using Telerik.WinControls.UI; |
||
13 | using System.Configuration; |
||
14 | |||
15 | namespace ID2.Manager.Forms |
||
16 | { |
||
17 | public partial class ExceptLayer : RadForm |
||
18 | { |
||
19 | public class Layer |
||
20 | { |
||
21 | public Layer() { } |
||
22 | public Layer(string layer) |
||
23 | { |
||
24 | Name = layer; |
||
25 | } |
||
26 | |||
27 | public string Name { get; set; } = string.Empty; |
||
28 | public bool Visible { get; set; } = false; |
||
29 | } |
||
30 | |||
31 | public static List<Layer> ExceptLayers { get; } = new List<Layer>(); |
||
32 | 288ed615 | humkyung | public static List<Layer> LineLayers { get; } = new List<Layer>(); |
33 | c4ba621d | humkyung | public static double LengthToleranceRatio = 0.1; |
34 | 51b9a24a | humkyung | public static double ArrowMaxLength { get; set; } = 2; |
35 | 288ed615 | humkyung | private BindingList<Layer> _ExceptLayerBindings { get; } = new BindingList<Layer>(); |
36 | private BindingList<Layer> _LineLayerBindings { get; } = new BindingList<Layer>(); |
||
37 | 13a36357 | humkyung | |
38 | public ExceptLayer() |
||
39 | { |
||
40 | InitializeComponent(); |
||
41 | |||
42 | 288ed615 | humkyung | ExceptLayers.ForEach(x => _ExceptLayerBindings.Add(x)); |
43 | LineLayers.ForEach(x => _LineLayerBindings.Add(x)); |
||
44 | |||
45 | 13a36357 | humkyung | this.radGridViewExceptLayer.DataBindingComplete += RadGridViewExceptLayer_DataBindingComplete; |
46 | 288ed615 | humkyung | this.radGridViewExceptLayer.DataSource = _ExceptLayerBindings; |
47 | |||
48 | this.radGridViewLineLayer.DataBindingComplete += RadGridViewLineLayer_DataBindingComplete; |
||
49 | this.radGridViewLineLayer.DataSource = _LineLayerBindings; |
||
50 | 13a36357 | humkyung | |
51 | c4ba621d | humkyung | this.radSpinEditorLengthToleranceRatio.Value = Convert.ToDecimal(LengthToleranceRatio); |
52 | 51b9a24a | humkyung | this.radSpinEditorArrowMaxLength.Value = Convert.ToDecimal(ArrowMaxLength); |
53 | c4ba621d | humkyung | |
54 | 13a36357 | humkyung | this.radButtonOK.Click += RadButtonOK_Click; |
55 | this.radButtonCancel.Click += RadButtonCancel_Click; |
||
56 | } |
||
57 | |||
58 | private void RadGridViewExceptLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) |
||
59 | { |
||
60 | radGridViewExceptLayer.BestFitColumns(); |
||
61 | } |
||
62 | |||
63 | 288ed615 | humkyung | private void RadGridViewLineLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) |
64 | { |
||
65 | radGridViewLineLayer.BestFitColumns(); |
||
66 | } |
||
67 | |||
68 | 13a36357 | humkyung | private void RadButtonOK_Click(object sender, EventArgs e) |
69 | { |
||
70 | ExceptLayers.Clear(); |
||
71 | 288ed615 | humkyung | ExceptLayers.AddRange(_ExceptLayerBindings); |
72 | |||
73 | LineLayers.Clear(); |
||
74 | LineLayers.AddRange(_LineLayerBindings); |
||
75 | 13a36357 | humkyung | |
76 | c4ba621d | humkyung | LengthToleranceRatio = Convert.ToDouble(this.radSpinEditorLengthToleranceRatio.Value); |
77 | 51b9a24a | humkyung | ArrowMaxLength = Convert.ToDouble(this.radSpinEditorArrowMaxLength.Value); |
78 | c4ba621d | humkyung | |
79 | 13a36357 | humkyung | this.DialogResult = DialogResult.OK; |
80 | } |
||
81 | |||
82 | private void RadButtonCancel_Click(object sender, EventArgs e) |
||
83 | { |
||
84 | this.DialogResult = DialogResult.Cancel; |
||
85 | } |
||
86 | } |
||
87 | } |