source: trunk/CrypPlugins/SHA/SHASettings.cs @ 1778

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

shortened license text to boilerplate notice in all source files

File size: 2.2 KB
Line 
1/*
2   Copyright 2008 Sebastian Przybylski, University of Siegen
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;
21
22using Cryptool.PluginBase;
23using System.ComponentModel;
24
25namespace SHA
26{
27    public class SHASettings : ISettings
28    {
29        private bool hasChanges = false;
30        public enum ShaFunction { SHA1, SHA256, SHA384, SHA512 };
31
32        private ShaFunction selectedShaFunction = ShaFunction.SHA1;
33
34        [ContextMenu("SHA Function", "Select the SHA hash function (SHA1 or one out of the SHA2 family)", 1, DisplayLevel.Beginner, ContextMenuControlType.ComboBox, null, new string[] { "SHA1", "SHA256", "SHA384", "SHA512" })]
35        [TaskPane("SHA Function", "Select the SHA hash function (SHA1 or one out of the SHA2 family)", "", 1, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "SHA1", "SHA256", "SHA384", "SHA512"})]
36        public int SHAFunction
37        {
38            get { return (int)this.selectedShaFunction; }
39            set
40            {
41                this.selectedShaFunction = (ShaFunction)value;
42                OnPropertyChanged("SHAFunction");
43            }
44        }
45
46        #region INotifyPropertyChanged Members
47
48        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
49        protected void OnPropertyChanged(string name)
50        {
51            if (PropertyChanged != null)
52            {
53                PropertyChanged(this, new PropertyChangedEventArgs(name));
54            }
55        }
56
57        public bool HasChanges
58        {
59          get { return hasChanges; }
60          set { hasChanges = value; }
61        }
62
63        #endregion
64
65    }
66}
Note: See TracBrowser for help on using the repository browser.