Changeset 658 for trunk/CrypPlugins/Gate


Ignore:
Timestamp:
Oct 6, 2009, 6:41:12 PM (12 years ago)
Author:
Matthäus Wander
Message:

Gate:

  • added icons (thanks, Sören!)
Location:
trunk/CrypPlugins/Gate
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/Gate/Gate.cs

    r572 r658  
    2828using System.Diagnostics;
    2929
    30 /*
    31  * TODO:
    32  * - create icons to show Gate state (open, closed)
    33  * - find solution for ticket #81
    34  */
    3530namespace Gate
    3631{
    3732    [Author("Matthäus Wander", "wander@cryptool.org", "Universität Duisburg-Essen, Fachgebiet Verteilte Systeme", "http://www.vs.uni-due.de")]
    38     [PluginInfo(false, "Gate", "Control operator", "", "CrypWin/images/default.png")]
     33    [PluginInfo(false, "Gate", "Control operator", "", "Gate/gate_closed_32.png", "Gate/gate_open_32.png")]
    3934    public class Gate : IThroughput
    4035    {
     
    129124                ProgressChanged(1, 1);
    130125                OnPropertyChanged("OutputObject");
     126
     127                iconOpen();
    131128            }
    132129            else
     
    134131                output = null;
    135132                ProgressChanged(0.5, 1);
     133
     134                iconClosed();
    136135            }
    137136        }
     
    160159        }
    161160
     161        private void iconOpen()
     162        {
     163            iconSet(1);
     164        }
     165
     166        private void iconClosed()
     167        {
     168            iconSet(0);
     169        }
     170
     171        private void iconSet(int index)
     172        {
     173            if (OnPluginStatusChanged != null)
     174                OnPluginStatusChanged(this, new StatusEventArgs(StatusChangedMode.ImageUpdate, index));
     175        }
     176
    162177        public void PostExecution()
    163178        {
  • trunk/CrypPlugins/Gate/Gate.csproj

    r573 r658  
    6565    </ProjectReference>
    6666  </ItemGroup>
     67  <ItemGroup>
     68    <Resource Include="gate_closed_32.png" />
     69    <Resource Include="gate_open_32.png" />
     70  </ItemGroup>
    6771  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    6872  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset for help on using the changeset viewer.