source: trunk/CrypPlugins/BoolComparator/BoolComparatorSettings.cs @ 2527

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

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

File size: 3.4 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;
21using System.IO;
22using Cryptool.PluginBase;
23using System.ComponentModel;
24
25namespace Cryptool.BoolComparator
26{
27    public class BoolComparatorSettings : ISettings
28    {
29        #region Public Xor specific interface
30
31        /// <summary>
32        /// We use this delegate to send log messages from the settings class to the Xor plugin
33        /// </summary>
34        /// <param name="sender"></param>
35        /// <param name="msg"></param>
36        /// <param name="logLevel"></param>
37        public delegate void XorLogMessage(string msg, NotificationLevel logLevel);
38
39        /// <summary>
40        /// Fire if a new message has to be shown in the status bar
41        /// </summary>
42        public event XorLogMessage LogMessage;
43       
44        /// <summary>
45        /// Returns true if some settigns have been changed. This value should be set
46        /// externally to false e.g. when a project was saved.
47        /// </summary>
48        [PropertySaveOrder(0)]
49        public bool HasChanges
50        {
51            get { return hasChanges; }
52            set { hasChanges = value; }
53        }
54
55        bool flagInputOne;
56        [ContextMenu("Declare Flag I1 clean", " yes / no ", 0, ContextMenuControlType.CheckBox, null, "Set Flag of Input One to clean at the beginning of the chain.")]
57        [TaskPaneAttribute("Declare Flag I1 clean", " yes / no ", "", 0, false, ControlType.CheckBox, null)]
58        public bool FlagInputOne
59        {
60            get { return this.flagInputOne; }
61            set
62            {
63                this.flagInputOne = value;
64                OnPropertyChanged("FlagInputOne");
65                HasChanges = true;
66            }
67
68        }
69
70        bool flagInputTwo;
71        [ContextMenu("Declare Flag I2 clean", " yes / no ", 0, ContextMenuControlType.CheckBox, null, "Set Flag of Input Two to clean at the beginning of the chain.")]
72        [TaskPaneAttribute("Declare Flag I2 clean", " yes / no ", "", 0, false, ControlType.CheckBox, null)]
73        public bool FlagInputTwo
74        {
75            get { return this.flagInputTwo; }
76            set
77            {
78                this.flagInputTwo = value;
79                OnPropertyChanged("FlagInputTwo");
80                HasChanges = true;
81            }
82
83        }
84
85        #endregion
86
87        #region Private variables
88
89        private bool hasChanges;
90
91        #endregion
92
93
94        #region INotifyPropertyChanged Members
95
96        public event PropertyChangedEventHandler PropertyChanged;
97
98        protected void OnPropertyChanged(string name)
99        {
100            if (PropertyChanged != null)
101            {
102                PropertyChanged(this, new PropertyChangedEventArgs(name));
103            }
104        }
105
106        #endregion
107    }
108}
Note: See TracBrowser for help on using the repository browser.