source: trunk/CrypPlugins/DiscreteLogarithm/DiscreteLogarithmSettings.cs @ 2334

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

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

File size: 2.9 KB
Line 
1/*                             
2   Copyright 2010 Team CrypTool (Sven Rech), Uni 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 System.ComponentModel;
22using Cryptool.PluginBase;
23using System.Collections.ObjectModel;
24
25namespace Cryptool.Plugins.DiscreteLogarithm
26{
27    /// <summary>
28    /// Settings class for the Discrete Logarithm plugin
29    /// </summary>
30    class DiscreteLogarithmSettings : ISettings
31    {
32        #region private members
33
34        private bool hasChanges = false;
35        private int algorithm;
36
37        #endregion
38
39        #region events
40
41        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
42
43        #endregion
44
45        #region public
46
47        /// <summary>
48        /// Constructs a new DiscreteLogarithmSettings
49        /// </summary>
50        public DiscreteLogarithmSettings()
51        {
52        }       
53
54        /// <summary>
55        /// Getter/Setter for the algorithm
56        /// </summary>
57        [ContextMenu("Algorithm", "Which algorithm do you want to use?", 1, ContextMenuControlType.ComboBox, new int[] { 1, 2 }, "Enumeration", "Index-Calculus")]
58        [TaskPane("Algorithm", "Which algorithm do you want to use?", null, 1, false, ControlType.ComboBox, new string[] { "Enumeration", "Index-Calculus" })]
59        public int Algorithm
60        {
61            get { return this.algorithm; }
62            set
63            {
64                algorithm = value;
65                OnPropertyChanged("Algorithm");
66            }
67        }
68
69        /// <summary>
70        /// Did anything change on the settigns?
71        /// </summary>
72        public bool HasChanges
73        {
74            get
75            {
76                return hasChanges;
77            }
78            set
79            {
80                hasChanges = value;
81            }
82        }
83
84        #endregion
85
86        #region private
87
88        /// <summary>
89        /// The property p has changes
90        /// </summary>
91        /// <param name="p">p</param>
92        private void OnPropertyChanged(string p)
93        {
94            if (PropertyChanged != null)
95            {
96                PropertyChanged(this, new PropertyChangedEventArgs(p));
97            }
98        }
99
100        #endregion
101
102    }//end DiscreteLogarithmSettings
103
104}//end Cryptool.Plugins.DiscreteLogarithm
Note: See TracBrowser for help on using the repository browser.