프로젝트

일반

사용자정보

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

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

이력 | 보기 | 이력해설 | 다운로드 (2.75 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
        private BindingList<Layer> _ExceptLayerBindings { get; } = new BindingList<Layer>();
35
        private BindingList<Layer> _LineLayerBindings { get; } = new BindingList<Layer>();
36

    
37
        public ExceptLayer()
38
        {
39
            InitializeComponent();
40

    
41
            ExceptLayers.ForEach(x => _ExceptLayerBindings.Add(x));
42
            LineLayers.ForEach(x => _LineLayerBindings.Add(x));
43

    
44
            this.radGridViewExceptLayer.DataBindingComplete += RadGridViewExceptLayer_DataBindingComplete;
45
            this.radGridViewExceptLayer.DataSource = _ExceptLayerBindings;
46

    
47
            this.radGridViewLineLayer.DataBindingComplete += RadGridViewLineLayer_DataBindingComplete;
48
            this.radGridViewLineLayer.DataSource = _LineLayerBindings;
49

    
50
            this.radSpinEditorLengthToleranceRatio.Value = Convert.ToDecimal(LengthToleranceRatio);
51

    
52
            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
        private void RadGridViewLineLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
62
        {
63
            radGridViewLineLayer.BestFitColumns();
64
        }
65

    
66
        private void RadButtonOK_Click(object sender, EventArgs e)
67
        {
68
            ExceptLayers.Clear();
69
            ExceptLayers.AddRange(_ExceptLayerBindings);
70

    
71
            LineLayers.Clear();
72
            LineLayers.AddRange(_LineLayerBindings);
73

    
74
            LengthToleranceRatio = Convert.ToDouble(this.radSpinEditorLengthToleranceRatio.Value);
75

    
76
            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)