프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

hytos / ID2.Manager / ID2.Manager.Compare / Forms / ExceptLayer.cs @ 4142eefa

이력 | 보기 | 이력해설 | 다운로드 (2.75 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 288ed615 humkyung
        private BindingList<Layer> _ExceptLayerBindings { get; } = new BindingList<Layer>();
35
        private BindingList<Layer> _LineLayerBindings { get; } = new BindingList<Layer>();
36 13a36357 humkyung
37
        public ExceptLayer()
38
        {
39
            InitializeComponent();
40
41 288ed615 humkyung
            ExceptLayers.ForEach(x => _ExceptLayerBindings.Add(x));
42
            LineLayers.ForEach(x => _LineLayerBindings.Add(x));
43
44 13a36357 humkyung
            this.radGridViewExceptLayer.DataBindingComplete += RadGridViewExceptLayer_DataBindingComplete;
45 288ed615 humkyung
            this.radGridViewExceptLayer.DataSource = _ExceptLayerBindings;
46
47
            this.radGridViewLineLayer.DataBindingComplete += RadGridViewLineLayer_DataBindingComplete;
48
            this.radGridViewLineLayer.DataSource = _LineLayerBindings;
49 13a36357 humkyung
50 c4ba621d humkyung
            this.radSpinEditorLengthToleranceRatio.Value = Convert.ToDecimal(LengthToleranceRatio);
51
52 13a36357 humkyung
            this.radButtonOK.Click += RadButtonOK_Click;
53
            this.radButtonCancel.Click += RadButtonCancel_Click;
54
        }
55
56
        private void RadGridViewExceptLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
57
        {
58
            radGridViewExceptLayer.BestFitColumns();
59
        }
60
61 288ed615 humkyung
        private void RadGridViewLineLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
62
        {
63
            radGridViewLineLayer.BestFitColumns();
64
        }
65
66 13a36357 humkyung
        private void RadButtonOK_Click(object sender, EventArgs e)
67
        {
68
            ExceptLayers.Clear();
69 288ed615 humkyung
            ExceptLayers.AddRange(_ExceptLayerBindings);
70
71
            LineLayers.Clear();
72
            LineLayers.AddRange(_LineLayerBindings);
73 13a36357 humkyung
74 c4ba621d humkyung
            LengthToleranceRatio = Convert.ToDouble(this.radSpinEditorLengthToleranceRatio.Value);
75
76 13a36357 humkyung
            this.DialogResult = DialogResult.OK;
77
        }
78
79
        private void RadButtonCancel_Click(object sender, EventArgs e)
80
        {
81
            this.DialogResult = DialogResult.Cancel;
82
        }
83
    }
84
}
클립보드 이미지 추가 (최대 크기: 500 MB)