source: trunk/CrypPlugins/Gate/GateSettings.cs @ 1597

Last change on this file since 1597 was 572, checked in by Matthäus Wander, 12 years ago

Gate:

  • cleanup
File size: 2.1 KB
Line 
1/*
2   Copyright 2009 Matthäus Wander, Universität Duisburg-Essen
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*/
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21using Cryptool.PluginBase;
22
23namespace Gate
24{
25    enum Trigger
26    {
27        AlwaysOpen, AlwaysClosed, TrueValue, FalseValue, AnyEdge, PositiveEdge, NegativeEdge
28    };
29
30    class GateSettings : ISettings
31    {
32        private bool hasChanges = false;
33        private Trigger trigger = 0;
34
35        [TaskPane("Trigger", "Trigger to open gate", null, 1, true, DisplayLevel.Experienced, ControlType.RadioButton,
36            new string[] { "no trigger (always open)", "no trigger (always closed)", "true value", "false value", "edge (value swap)", "positive edge (false->true)", "negative edge (true->false)" })]
37        public Trigger Trigger
38        {
39            get
40            {
41                return trigger;
42            }
43            set
44            {
45                if (trigger != value)
46                {
47                    hasChanges = true;
48                    trigger = value;
49                }
50            }
51        }
52
53        #region ISettings Members
54
55        public bool HasChanges
56        {
57            get
58            {
59                return hasChanges;
60            }
61            set
62            {
63                hasChanges = value;
64            }
65        }
66
67        #endregion
68
69        #region INotifyPropertyChanged Members
70
71        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
72
73        #endregion
74    }
75}
Note: See TracBrowser for help on using the repository browser.