-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathBooleanParameterControl.cs
More file actions
60 lines (53 loc) · 1.69 KB
/
Copy pathBooleanParameterControl.cs
File metadata and controls
60 lines (53 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// -------------------------------------------------------------------------------------------
// <copyright file="BooleanParameterControl.cs" company="MapWindow OSS Team - www.mapwindow.org">
// MapWindow OSS Team - 2015
// </copyright>
// -------------------------------------------------------------------------------------------
using System;
using System.Windows.Forms;
namespace MW5.Tools.Controls.Parameters
{
/// <summary>
/// Represents checkbox control for entering value of boolean parameter.
/// </summary>
public partial class BooleanParameterControl : ParameterControlBase
{
/// <summary>
/// Initializes a new instance of the <see cref="BooleanParameterControl"/> class.
/// </summary>
public BooleanParameterControl()
{
InitializeComponent();
checkBox1.CheckedChanged += (s, e) => FireValueChanged();
}
/// <summary>
/// Gets or sets the caption.
/// </summary>
public override string Caption
{
get { return checkBox1.Text; }
set { checkBox1.Text = value; }
}
/// <summary>
/// Gets control to display tooltip for.
/// </summary>
public override Control ToolTipControl
{
get { return checkBox1; }
}
/// <summary>
/// The get value.
/// </summary>
public override object GetValue()
{
return checkBox1.Checked;
}
/// <summary>
/// Sets the value.
/// </summary>
public override void SetValue(object value)
{
checkBox1.Checked = Convert.ToBoolean(value);
}
}
}