source: trunk/CrypPlugins/CrypPluginTemplate/ExamplePluginCT2Settings.cs @ 2417

Last change on this file since 2417 was 2334, checked in by Matthäus Wander, 11 years ago

removed 1006 occurences of DisplayLevel in 218 files (see #122)

File size: 2.7 KB
Line 
1/* HOWTO: Change year, author name and organization.
2   Copyright 2010 Your Name, University of Duckburg
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16using System;
17using System.Collections.Generic;
18using System.Linq;
19using System.Text;
20using Cryptool.PluginBase;
21using System.ComponentModel;
22
23namespace Cryptool.Plugins.ExamplePluginCT2
24{
25    // HOWTO: rename class (click name, press F2)
26    public class ExamplePluginCT2Settings : ISettings
27    {
28        #region Private Variables
29
30        private bool hasChanges = false;
31        private int subtrahend = 0;
32
33        #endregion
34
35        #region TaskPane Settings
36
37        /// <summary>
38        /// HOWTO: This is an example for a setting entity shown in the settings pane on the right of the CT2 main window.
39        /// This example setting uses a number field input, but there are many more input types available, see ControlType enumeration.
40        /// </summary>
41        [TaskPane("Subtrahend", "Amount to subtract from input number", null, 1, false, ControlType.NumericUpDown, ValidationType.RangeInteger, 0, Int32.MaxValue)]
42        public int Subtrahend
43        {
44            get
45            {
46                return subtrahend;
47            }
48            set
49            {
50                // HOWTO: If a setting changes, you must set hasChanges manually to true.
51                if (subtrahend != value)
52                {
53                    subtrahend = value;
54                    hasChanges = true;
55                }
56            }
57        }
58
59        #endregion
60
61        #region ISettings Members
62
63        /// <summary>
64        /// HOWTO: This flags indicates whether some setting has been changed since the last save.
65        /// If a property was changed, this becomes true, hence CrypTool will ask automatically if you want to save your changes.
66        /// </summary>
67        public bool HasChanges
68        {
69            get
70            {
71                return hasChanges;
72            }
73            set
74            {
75                hasChanges = value;
76            }
77        }
78
79        #endregion
80
81        #region INotifyPropertyChanged Members
82
83        public event PropertyChangedEventHandler PropertyChanged;
84
85        #endregion
86    }
87}
Note: See TracBrowser for help on using the repository browser.