프로젝트

일반

사용자정보

통계
| 개정판:

hytos / ID2.Manager / ID2.Manager.Compare / Forms / ExceptLayer.cs @ 13a36357

이력 | 보기 | 이력해설 | 다운로드 (1.79 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
        private BindingList<Layer> _Bindings { get; } = new BindingList<Layer>();
33

    
34
        public ExceptLayer()
35
        {
36
            InitializeComponent();
37

    
38
            ExceptLayers.ForEach(x => _Bindings.Add(x));
39
            this.radGridViewExceptLayer.DataBindingComplete += RadGridViewExceptLayer_DataBindingComplete;
40
            this.radGridViewExceptLayer.DataSource = _Bindings;
41

    
42
            this.radButtonOK.Click += RadButtonOK_Click;
43
            this.radButtonCancel.Click += RadButtonCancel_Click;
44
        }
45

    
46
        private void RadGridViewExceptLayer_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
47
        {
48
            radGridViewExceptLayer.BestFitColumns();
49
        }
50

    
51
        private void RadButtonOK_Click(object sender, EventArgs e)
52
        {
53
            ExceptLayers.Clear();
54
            ExceptLayers.AddRange(_Bindings);
55

    
56
            this.DialogResult = DialogResult.OK;
57
        }
58

    
59
        private void RadButtonCancel_Click(object sender, EventArgs e)
60
        {
61
            this.DialogResult = DialogResult.Cancel;
62
        }
63
    }
64
}
클립보드 이미지 추가 (최대 크기: 500 MB)