source: trunk/CrypPlugins/Shifter/Shifter.cs @ 2417

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

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

File size: 4.9 KB
Line 
1/*
2   Copyright 2008 Dr. Arno Wacker, University of 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.Linq;
20using System.Text;
21using Cryptool.PluginBase;
22using Cryptool.PluginBase.IO;
23using System.ComponentModel;
24using Cryptool.PluginBase.Miscellaneous;
25using System.Runtime.CompilerServices;
26
27namespace Cryptool.Plugins.Shifter
28{
29    class Shifter : IThroughput
30    {
31        [Author("Raoul Falk", "falk@cryptool.org", "Uni Duisburg-Essen", "http://www.uni-due.de")]
32        [PluginInfo(false, "Shifter", "Shift operator with adjustable block size.", "", "Shifter/icons/left.png", "Shifter/icons/right.png")]
33
34        #region private variables
35
36        private object inputOne;
37        private object inputTwo;
38        private object output;
39        private ShifterSettings settings = new ShifterSettings();
40
41        #region public interfaces
42
43        public Shifter()
44        {
45            this.settings = new ShifterSettings();
46            this.settings.OnPluginStatusChanged += settings_OnPluginStatusChanged;
47        }
48
49
50
51        #region IPlugin Members
52
53        public event StatusChangedEventHandler OnPluginStatusChanged;
54
55    public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
56
57    public event PluginProgressChangedEventHandler OnPluginProgressChanged;
58
59    public ISettings Settings
60    {
61        get { return this.settings; }
62        set { this.settings = (ShifterSettings)value; }
63    }
64
65    public System.Windows.Controls.UserControl Presentation
66    {
67        get { return null; }
68    }
69
70    public System.Windows.Controls.UserControl QuickWatchPresentation
71    {
72        get { return null; }
73    }
74
75    [PropertyInfo(Direction.InputData, "Input one", "Input one.", "", true, true, QuickWatchFormat.Text, null)]
76    public object InputOne
77    {
78        [MethodImpl(MethodImplOptions.Synchronized)]
79        get { return inputOne; }
80        [MethodImpl(MethodImplOptions.Synchronized)]
81        set
82        {
83            if (value != inputOne)
84            {
85                inputOne = value;
86                OnPropertyChanged("InputOne");
87            }
88        }
89    }
90    [PropertyInfo(Direction.InputData, "Input two", "Input two.", "", true, true, QuickWatchFormat.Text, null)]
91    public object InputTwo
92    {
93        [MethodImpl(MethodImplOptions.Synchronized)]
94        get { return inputTwo; }
95        [MethodImpl(MethodImplOptions.Synchronized)]
96        set
97        {
98            if (value != inputTwo)
99            {
100                inputTwo = value;
101                OnPropertyChanged("InputTwo");
102            }
103        }
104    }
105
106    [PropertyInfo(Direction.OutputData, "Output", "Output.", "", true, false, QuickWatchFormat.Text, null)]
107    public object Output
108    {
109        [MethodImpl(MethodImplOptions.Synchronized)]
110        get
111        {
112            return output;
113        }
114
115        [MethodImpl(MethodImplOptions.Synchronized)]
116        set
117        {
118            this.output = value;
119            OnPropertyChanged("Output");
120        }
121    }
122
123    public void PreExecution()
124    {
125        throw new NotImplementedException();
126    }
127
128    public void Execute()
129    {
130        switch (settings.Operand)
131        {
132            case 0: //left
133                {
134
135                    break;
136                }
137            case 1: //right
138                {
139                    break;
140                }
141        }
142    }
143
144    public void PostExecution()
145    {
146        throw new NotImplementedException();
147    }
148
149    public void Pause()
150    {
151        throw new NotImplementedException();
152    }
153
154    public void Stop()
155    {
156        throw new NotImplementedException();
157    }
158
159    public void Initialize()
160    {
161        throw new NotImplementedException();
162    }
163
164    public void Dispose()
165    {
166        throw new NotImplementedException();
167    }
168
169    protected void OnPropertyChanged(string name)
170    {
171        EventsHelper.PropertyChanged(PropertyChanged, this, new PropertyChangedEventArgs(name));
172    }
173    void settings_OnPluginStatusChanged(IPlugin sender, StatusEventArgs args)
174    {
175        if (OnPluginStatusChanged != null) OnPluginStatusChanged(this, args);
176    }
177
178        #endregion
179
180    #region INotifyPropertyChanged Members
181
182    public event PropertyChangedEventHandler PropertyChanged;
183
184    #endregion
185    }
186}
Note: See TracBrowser for help on using the repository browser.