source: trunk/CrypPlugins/Comparators/ComparatorsSettings.cs @ 2061

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

Comparators:

  • icon update in Initialization (references #80)

RSA:

  • duplicate icon definitions removed (hope this doesn't break some particular workaround or whatever)
File size: 2.5 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.ComponentModel;
20using System.Linq;
21using System.Text;
22using System.Windows;
23using System.Windows.Media;
24using System.Windows.Controls;
25using Cryptool.PluginBase;
26
27namespace Cryptool.Plugins.Comparators
28{
29    public class ComparatorsSettings : ISettings
30    {
31        #region private variables
32        private int comparator = 0; // 0 ==, 1 !=, 2 <, 3 >, 4 <=, 5 >=
33        private bool hasChanges;
34        #endregion
35
36        #region taskpane
37        [TaskPane("Comparator", "Choose the Comperator", null, 1, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "==", "!=", "<", ">", "<=", ">=" })]
38        public int Comparator
39        {
40            get { return this.comparator; }
41            set
42            {
43                if (value != this.comparator)
44                {
45                    this.comparator = value;
46                    OnPropertyChanged("Comparator");
47                    HasChanges = true;
48
49                    ChangePluginIcon(comparator);
50                }
51            }
52        }
53        #endregion
54
55        #region ISettings Member
56
57        public bool HasChanges
58        {
59            get { return hasChanges; }
60            set { hasChanges = value; }
61
62        }
63
64        #endregion
65
66        #region INotifyPropertyChanged Member
67
68        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
69
70        protected void OnPropertyChanged(string name)
71        {
72
73        }
74        public event StatusChangedEventHandler OnPluginStatusChanged;
75        internal void ChangePluginIcon(int iconIndex)
76        {
77            if (OnPluginStatusChanged != null) OnPluginStatusChanged(null, new StatusEventArgs(StatusChangedMode.ImageUpdate, iconIndex));
78        }
79        #endregion
80    }
81}
Note: See TracBrowser for help on using the repository browser.