source: trunk/CrypPlugins/VigenereAnalyser/VigenereAnalyserSettings.cs @ 2380

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

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

File size: 5.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Cryptool.PluginBase;
6using Cryptool.PluginBase.IO;
7using System.ComponentModel;
8
9
10namespace Cryptool.VigenereAnalyser
11{
12    class VigenereAnalyserSettings : ISettings
13    {
14        #region ISettings Members
15        private int max_keylength=15;
16        private int elf = 0;
17        private int eic = 0; 
18        public int internalKeyLengthAnalysis = 0;
19        public int columnAnalysis = 0;
20        private bool hasChanges = false;
21        [ContextMenu("Expected Letter Frequency of a language", "Select the Null hypothesis for the Chi-square statistic", 2, ContextMenuControlType.ComboBox, null, new String[] { "English", "German", "French", "Spanish", "Italian", "Portugeese" })]
22        [TaskPane("Expected Letter Frequency of a language", "Select the Null hypothesis for the Chi-square statistic", null, 2, false, ControlType.ComboBox, new String[] { "English", "German", "French", "Spanish", "Italian", "Portugeese" })]
23        public int ELF // Expected Letter Frequencies
24        {
25            get { return this.elf; }
26            set
27            {
28                if (((int)value) != elf) hasChanges = true;
29                this.elf = (int)value;
30                OnPropertyChanged("ELF");
31            }
32        }
33        [ContextMenu("Expected Index of coincidence", "Adjust the expected index of coincidence", 2, ContextMenuControlType.ComboBox, null, new String[] { "English", "German", "French", "Spanish", "Italian", "Portugeese" })]
34        [TaskPane("Expected Index of coincidence", "Adjust the expected index of coincidence", null, 2, false, ControlType.ComboBox, new String[] { "English", "German", "French", "Spanish", "Italian", "Portugeese" })]
35        public int EIC // Expected Letter Frequencies
36        {
37            get { return this.eic; }
38            set
39            {
40                if (((int)value) != eic) hasChanges = true;
41                this.eic = (int)value;
42                OnPropertyChanged("EIC");
43            }
44        }
45
46        [TaskPane("Maximum Keylength", "Enter maximum keylength to be analysed by the 'Sampled Index of coincidence' method. default = 15", "", 1, false, ControlType.NumericUpDown, ValidationType.RangeInteger, 0, 100)]
47        public int Max_Keylength
48        {
49            get { return this.max_keylength; }
50            set
51            {
52                if (value != max_keylength)
53                {
54                    HasChanges = true;
55                    max_keylength = value;
56                }
57            }
58        }
59        [ContextMenu("Method of keylength analysis", "Select the internal or external method for analysis of the keylength", 2, ContextMenuControlType.ComboBox, null, new String[] { "Kasiski and Friedman tests (external)","Sampled index of coincidence(internal)" })]
60        [TaskPane("Method of keylength analysis", "Select the internal or external method for analysis of the keylength", null, 2, false, ControlType.ComboBox, new String[] { "Kasiski and Friedman tests (external)", "Sampled index of coincidence (internal)" })]
61        public int InternalKeyLengthAnalysis
62        {
63            get { return this.internalKeyLengthAnalysis; }
64            set
65            {
66                if (((int)value) != internalKeyLengthAnalysis) hasChanges = true;
67                this.internalKeyLengthAnalysis = (int)value;
68                OnPropertyChanged("InternalKeyLengthAnalysis");
69            }
70        }
71        [ContextMenu("Method of column analysis", "Select the method of analysis of the ciphertext columns", 2, ContextMenuControlType.ComboBox, null, new String[] { "Use most frequent letter", "Use sum of squares" })]
72        [TaskPane("Method of column analysis", "Select the method of analysis of the ciphertext columns", null, 2, false, ControlType.ComboBox, new String[] { "Use most frequent letter", "Use sum of squares" })]
73        public int ColumnAnalysis
74        {
75            get { return this.columnAnalysis; }
76            set
77            {
78                if (((int)value) != columnAnalysis) hasChanges = true;
79                this.columnAnalysis = (int)value;
80                OnPropertyChanged("ColumnAnalysis");
81            }
82        }
83        public bool HasChanges
84        {
85            get { return hasChanges; }
86            set { hasChanges = value; OnPropertyChanged("HasChanges"); }
87        }
88        private string text;
89        public string Text
90        {
91            get { return text; }
92            set
93            {
94                if (value != text) hasChanges = true;
95                text = value;
96            }
97        }
98        #endregion
99
100        #region INotifyPropertyChanged Members
101
102        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
103
104        protected void OnPropertyChanged(string name)
105        {
106            if (PropertyChanged != null)
107            {
108                PropertyChanged(this, new PropertyChangedEventArgs(name));
109            }
110        }
111
112        #endregion
113    }
114}
Note: See TracBrowser for help on using the repository browser.