hytos / ID2.Manager / ID2.Manager.Compare / Forms / ExceptLayer.cs @ 2ade1e61
이력 | 보기 | 이력해설 | 다운로드 (2.98 KB)
1 |
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 |
public static List<Layer> LineLayers { get; } = new List<Layer>(); |
33 |
public static double LengthToleranceRatio = 0.1; |
34 |
public static double ArrowMaxLength { get; set; } = 2; |
35 |
private BindingList<Layer> _ExceptLayerBindings { get; } = new BindingList<Layer>(); |
36 |
private BindingList<Layer> _LineLayerBindings { get; } = new BindingList<Layer>(); |
37 |
|
38 |
public ExceptLayer() |
39 |
{ |
40 |
InitializeComponent(); |
41 |
|
42 |
ExceptLayers.ForEach(x => _ExceptLayerBindings.Add(x)); |
43 |
LineLayers.ForEach(x => _LineLayerBindings.Add(x)); |
44 |
|
45 |
this.radGridViewExceptLayer.DataBindingComplete += RadGridViewExceptLayer_DataBindingComplete; |
46 |
this.radGridViewExceptLayer.DataSource = _ExceptLayerBindings; |
47 |
|
48 |
this.radGridViewLineLayer.DataBindingComplete += RadGridViewLineLayer_DataBindingComplete; |
49 |
this.radGridViewLineLayer.DataSource = _LineLayerBindings; |
50 |
|
51 |
this.radSpinEditorLengthToleranceRatio.Value = Convert.ToDecimal(LengthToleranceRatio); |
52 |
this.radSpinEditorArrowMaxLength.Value = Convert.ToDecimal(ArrowMaxLength); |
53 |
|
54 |
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 |
private void RadGridViewLineLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) |
64 |
{ |
65 |
radGridViewLineLayer.BestFitColumns(); |
66 |
} |
67 |
|
68 |
private void RadButtonOK_Click(object sender, EventArgs e) |
69 |
{ |
70 |
ExceptLayers.Clear(); |
71 |
ExceptLayers.AddRange(_ExceptLayerBindings); |
72 |
|
73 |
LineLayers.Clear(); |
74 |
LineLayers.AddRange(_LineLayerBindings); |
75 |
|
76 |
LengthToleranceRatio = Convert.ToDouble(this.radSpinEditorLengthToleranceRatio.Value); |
77 |
ArrowMaxLength = Convert.ToDouble(this.radSpinEditorArrowMaxLength.Value); |
78 |
|
79 |
this.DialogResult = DialogResult.OK; |
80 |
} |
81 |
|
82 |
private void RadButtonCancel_Click(object sender, EventArgs e) |
83 |
{ |
84 |
this.DialogResult = DialogResult.Cancel; |
85 |
} |
86 |
} |
87 |
} |