source: trunk/CrypPlugins/WordPatterns/WordPatternsSettings.cs @ 2220

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

AnotherEditor:

  • does not show a warning anymore when a missing property in save file is marked with the DontSave attribute

CrypWin:

  • changed AssemblyCompany to "CrypTool2" as this string is being used to determine AppData directory (where the user.config file is located)
  • added support for arbitrary enums as TaskPane settings (see WordPatterns how to use them)

Dictionary:

  • fixed some bugs in Dictionary file handling

WordPatterns:

  • added XAML description
  • added case sensitivity setting (enum!)
  • minor sample fix

Note: New binaries are not included as I have some more unfinished core changes on my machine.

File size: 1.6 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Cryptool.PluginBase;
6using System.ComponentModel;
7using System.Windows.Data;
8
9namespace WordPatterns
10{
11    enum Case
12    {
13        Sensitive,
14        Insensitive
15    }
16
17    class WordPatternsSettings : ISettings
18    {
19        private bool hasChanges = false;
20
21        private Case caseSelection = Case.Insensitive;
22
23        [TaskPane("Case sensitivity", "Choose whether uppercase/lowercase should be treated as different (case sensitive) or equal (case insensitive)", "", 1, false, DisplayLevel.Expert, ControlType.ComboBox)]
24        public Case CaseSelection
25        {
26            get { return caseSelection; }
27            set
28            {
29                if (caseSelection != value)
30                {
31                    caseSelection = value;
32                    hasChanges = true;
33                    OnPropertyChanged("CaseSelection");
34                }
35            }
36        }
37
38        private void OnPropertyChanged(string p)
39        {
40            if (PropertyChanged != null)
41            {
42                PropertyChanged(this, new PropertyChangedEventArgs(p));
43            }
44        }
45
46        #region ISettings Members
47
48        public bool HasChanges
49        {
50            get
51            {
52                return hasChanges;
53            }
54            set
55            {
56                hasChanges = value;
57            }
58        }
59
60        #endregion
61
62        #region INotifyPropertyChanged Members
63
64        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
65
66        #endregion
67    }
68}
Note: See TracBrowser for help on using the repository browser.