source: trunk/CrypPlugins/Splitter/SplitterSettings.cs @ 2214

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

shortened license text to boilerplate notice in all source files

File size: 2.5 KB
Line 
1/*
2   Copyright 2008 Thomas Schmid, 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 Cryptool.PluginBase;
22using System.ComponentModel;
23using Cryptool.PluginBase.Miscellaneous;
24
25namespace Splitter
26{
27  public class SplitterSettings : ISettings
28  {
29
30    private int fireOnValue;
31    [ContextMenu("Fire on true/false", "Fire next word on true/flase input", 0, DisplayLevel.Beginner, ContextMenuControlType.ComboBox, null, "True", "False")]
32    [TaskPane("Fire on true/false", "Fire next word on true/flase input", null, 0, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "True", "False" })]
33    public int FireOnValue
34    {
35      get { return this.fireOnValue; }
36      set
37      {
38        if (value != fireOnValue)
39        {
40          fireOnValue = value;
41          HasChanges = true;
42          OnPropertyChanged("FireOnValue");
43        }
44      }
45    }
46
47    private string delimiterDictionary = " ";
48    [TaskPaneAttribute("Delimiter Dictionary", "The delimiter for the dictionary to split up the words.", null, 1, false, DisplayLevel.Beginner, ControlType.TextBox, ValidationType.RegEx, "^(.){0,1}$")]
49    public string DelimiterDictionary
50    {
51      get { return this.delimiterDictionary; }
52      set
53      {
54        if (value != delimiterDictionary)
55        {
56          delimiterDictionary = value;
57          HasChanges = true;
58        }
59        OnPropertyChanged("DelimiterDictionary");
60      }
61    }
62
63    #region ISettings Members
64
65    private bool hasChanges;
66
67    public bool HasChanges
68    {
69      get { return hasChanges; }
70      set { hasChanges = value; }
71    }
72
73
74    #endregion
75
76    #region INotifyPropertyChanged Members
77
78    public event PropertyChangedEventHandler PropertyChanged;
79
80    protected void OnPropertyChanged(string name)
81    {
82      EventsHelper.PropertyChanged(PropertyChanged, this, new PropertyChangedEventArgs(name));
83    }
84
85    #endregion
86  }
87}
Note: See TracBrowser for help on using the repository browser.