Ignore:
Timestamp:
May 26, 2010, 7:54:12 PM (12 years ago)
Author:
Matthäus Wander
Message:

Updated plugin template. The template shall become the default way to create a new CT2 plugin.

Location:
trunk/CrypPlugins/CrypPluginTemplate
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/CrypPluginTemplate/ExamplePluginCT2.cs

    r740 r1507  
    1 /*
    2    Copyright 2009 Matthäus Wander, Universität Duisburg-Essen
     1/* HOWTO: Change year, author name and organization.
     2   Copyright 2010 Your Name, University of Duckburg
    33
    44   Licensed under the Apache License, Version 2.0 (the "License");
     
    2424using System.Windows.Controls;
    2525
    26 namespace Cryptool.Plugin.ExamplePluginCT2
     26namespace Cryptool.Plugin
    2727{
     28    // HOWTO: Change author name, email address, organization and URL.
    2829    [Author("Matthäus Wander", "wander@cryptool.org", "Universität Duisburg-Essen, Fachgebiet Verteilte Systeme", "http://www.vs.uni-due.de")]
     30    // HOWTO: Change plugin caption (title to appear in CT2) and tooltip. You can (and should) provide a description XAML and an own icon as well.
    2931    [PluginInfo(false, "Example Plugin", "Subtract one number from another", null, "CrypWin/images/default.png")]
     32    // HOWTO: Change interface to one that fits to your plugin (see CrypPluginBase).
    3033    public class ExamplePluginCT2 : IIOMisc
    3134    {
    3235        #region Private Variables
    3336
    34         private ExamplePluginCT2Settings settings = new ExamplePluginCT2Settings();
     37        // HOWTO: You need to adapt the settings class as well, see the corresponding file.
     38        private readonly ExamplePluginCT2Settings settings = new ExamplePluginCT2Settings();
    3539
    3640        #endregion
     
    3943
    4044        /// <summary>
    41         /// Input interface to read the input data.
     45        /// HOWTO: Input interface to read the input data.
    4246        /// You can add more input properties of other type if needed.
    4347        /// </summary>
     
    5054
    5155        /// <summary>
    52         /// Output interface to write the output data.
     56        /// HOWTO: Output interface to write the output data.
    5357        /// You can add more output properties ot other type if needed.
    5458        /// </summary>
     
    7074
    7175        /// <summary>
    72         /// Optional: provide custom (tabbed) presentation to visualize your algorithm
     76        /// HOWTO: You can provide a custom (tabbed) presentation to visualize your algorithm.
     77        /// Return null if you don't provide one.
    7378        /// </summary>
    7479        public UserControl Presentation
     
    7883
    7984        /// <summary>
    80         /// Optional: provide custom (quickwatch) presentation to visualize your algorithm
     85        /// HOWTO: You can provide custom (quickwatch) presentation to visualize your algorithm.
     86        /// Return null if you don't provide one.
    8187        /// </summary>
    8288        public UserControl QuickWatchPresentation
     
    9096
    9197        /// <summary>
    92         /// The algorithm you'd like to implement
     98        /// HOWTO: Enter the algorithm you'd like to implement in this method.
    9399        /// </summary>
    94100        public void Execute()
    95101        {
     102            // HOWTO: Use this to show the progress of a plugin algorithm execution in the editor.
    96103            ProgressChanged(0, 1);
    97104
     105            // HOWTO: After you have changed an output property, make sure you announce the name of the changed property to the CT2 core.
    98106            Difference = Minuend - settings.Subtrahend;
    99107            OnPropertyChanged("Difference");
    100108
     109            // HOWTO: You can pass error, warning, info or debug messages to the CT2 main window.
    101110            if (settings.Subtrahend < 0)
    102111                GuiLogMessage("Subtrahend is negative", NotificationLevel.Debug);
    103112
     113            // HOWTO: Make sure the progress bar is at maximum when your Execute() finished successfully.
    104114            ProgressChanged(1, 1);
    105115        }
Note: See TracChangeset for help on using the changeset viewer.