프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Compare / Forms / ExceptLayer.cs @ 288ed615

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

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

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

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

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

    
49
            this.radButtonOK.Click += RadButtonOK_Click;
50
            this.radButtonCancel.Click += RadButtonCancel_Click;
51
        }
52

    
53
        private void RadGridViewExceptLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
54
        {
55
            radGridViewExceptLayer.BestFitColumns();
56
        }
57

    
58
        private void RadGridViewLineLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
59
        {
60
            radGridViewLineLayer.BestFitColumns();
61
        }
62

    
63
        private void RadButtonOK_Click(object sender, EventArgs e)
64
        {
65
            ExceptLayers.Clear();
66
            ExceptLayers.AddRange(_ExceptLayerBindings);
67

    
68
            LineLayers.Clear();
69
            LineLayers.AddRange(_LineLayerBindings);
70

    
71
            this.DialogResult = DialogResult.OK;
72
        }
73

    
74
        private void RadButtonCancel_Click(object sender, EventArgs e)
75
        {
76
            this.DialogResult = DialogResult.Cancel;
77
        }
78
    }
79
}
클립보드 이미지 추가 (최대 크기: 500 MB)