source: trunk/CrypPlugins/CostFunction/CostFunctionSettings.cs @ 693

Last change on this file since 693 was 693, checked in by kopal, 12 years ago

removed context menu

File size: 2.6 KB
Line 
1/*                             
2   Copyright 2009 Team CrypTool (Sven Rech,Dennis Nolte,Raoul Falk,Nils Kopal), 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.CostFunction
26{
27    class CostFunctionSettings : ISettings
28    {
29        #region private variables
30        private bool hasChanges = false;
31        private int functionType=0;
32        private String blocksize = "256";
33        #endregion
34       
35        [TaskPane("FunctionType", "Select the type of function", null, 1, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "Index of coincidence", "Entropy" })]
36        public int FunctionType
37        {
38            get { return this.functionType; }
39            set
40            {
41                functionType = value;
42                OnPropertyChanged("FunctionType");
43            }
44        }
45
46        [TaskPane("Blocksize", "Which blocksize should be used for calculating?", null, 4, false, DisplayLevel.Beginner, ControlType.TextBox)]
47        public String Blocksize
48        {
49            get
50            {
51                return blocksize;
52            }
53            set
54            {
55                blocksize = value;
56                OnPropertyChanged("Blocksize");
57            }
58        }
59
60        #region ISettings Members
61
62        public bool HasChanges
63        {
64            get
65            {
66                return hasChanges;
67            }
68            set
69            {
70                hasChanges = value;
71            }
72        }
73
74        #endregion
75
76        #region INotifyPropertyChanged Members
77
78        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
79
80        private void OnPropertyChanged(string p)
81        {
82            if (PropertyChanged != null)
83            {
84                PropertyChanged(this, new PropertyChangedEventArgs(p));
85            }
86        }
87
88        #endregion
89    }
90   
91   
92}
Note: See TracBrowser for help on using the repository browser.