Ignore:
Timestamp:
Apr 15, 2010, 5:20:01 PM (12 years ago)
Author:
Patrick Vacek
Message:

HowTo: Small improvements; moved example download section to the beginning of Chapter 2 instead of the end.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Documentation/Developer/PluginHowTo/part2.tex

    r1243 r1325  
    11\chapter{Plugin Implementation}
    22\label{sec:PluginImplementation}
    3 In this chapter we provide step-by-step instructions for implementing your own CrypTool 2.0 plugin. The given instructions refer primarily to the usage of the Visual C\# Express and Visual Studio Professional 2008 editions, so before starting you should have a copy of \textbf{Microsoft Visual Studio 2008} (or \textbf{Microsoft Visual C\# 2008 Express Edition}) installed on your computer. We will use the \textbf{Caesar cipher} (also known as the \textbf{shift cipher}) as an example throughout this chapter.
     3In this chapter we provide step-by-step instructions for implementing your own CrypTool 2 plugin. The given instructions refer primarily to the usage of \textbf{Microsoft Visual Studio Professional 2008}, so before starting you should have a copy of the program installed on your computer.
     4
     5\section{Downloading the example and template}
     6\label{sec:DownloadingTheExampleAndTemplate}
     7
     8We will use the \textbf{Caesar cipher} (also known as the \textbf{shift cipher}) as an example throughout this chapter. If you did not to download the entire CrypTool 2 source code as described in Section \ref{CheckingOutTheSources}, you can still get a copy of the source code for the Caesar algorithm referenced throughout this guide from the following location:\\\\
     9\textit{username: anonymous\\
     10password:} (not required)\\
     11\url{https://www.cryptool.org/svn/CrypTool2/trunk/CrypPlugins/Caesar/}\\\\
     12We have also created a Visual Studio plugin \textbf{template} to help with the development of new plugins. Using this template is strongly recommended over copying and pasting code from this document! The template can be found here:\\\\
     13\url{http://cryptool2.vs.uni-due.de/downloads/template/encryptionplugin.zip}
    414
    515\section{Creating a new project}
     
    1424        \label{fig:vs_create_new_project}
    1525\end{figure}
    16 
    17 \noindent If you are using Visual Studio 2008, select \textbf{\textit{.NET-Framework 3.5}} as the target framework; the Express Edition will automatically choose the target framework. Then choose \textit{Class Library} as the default template, as this will build the project for your plugin as a DLL file. Give the project a unique and meaningful name (such as \textit{Caesar} in our case), and choose a location to save it to. (The Express Edition will ask for a save location later when you close your project or environment). Select the subdirectory \textit{CrypPlugins} from your SVN trunk as the location. Finally, confirm by pressing the \textit{OK} button. Note that creating a new project in this manner also creates a new solution into which the project is placed.
    18 
    19 \begin{figure}[h!]
    20         \centering
    21                 \includegraphics[width=0.80\textwidth]{figures/save_solution_csharp_express.JPG}
    22         \caption{The Visual Studio C\# Express Edition \textit{Save Project} dialog window.}
    23         \label{fig:save_solution_csharp_express}
    24 \end{figure}
    25 
    26 \noindent At this point, your Visual Studio solution should look like this:
     26\clearpage
     27
     28Select \textbf{\textit{.NET-Framework 3.5}} as the target framework. Then choose \textit{Class Library} as the default template, as this will build the project for your plugin as a DLL file. Give the project a unique and meaningful name (such as \textit{Caesar} in our case), and choose a location to save it to. Select the subdirectory \textit{CrypPlugins} from your SVN trunk as the location. Finally, confirm by pressing the \textit{OK} button. Note that creating a new project in this manner also creates a new solution into which the project is placed. At this point, your Visual Studio solution should look like this:
    2729
    2830\begin{figure}[h!]
     
    5557\clearpage
    5658
    57 Unless you have created your new project in the same CrypTool 2.0 solution, you probably will not be able to select the library directly as seen above in Figure \ref{fig:add_pluginbase_source}; instead you can browse for the binary DLL as seen below in Figure \ref{fig:browse_reference}. Click on the \textit{Browse} tab and navigate to the folder in which you downloaded the CrypTool 2 project. Within that folder, go to \textit{\textbackslash CrypPluginBase\textbackslash bin\textbackslash Debug} and select the file \textit{CrypPluginBase.dll}. The library reference can then be added by double clicking the file or pressing the \textit{OK} button.
     59Unless you have created your new project in the same CrypTool 2 solution, you probably will not be able to select the library directly as seen above in Figure \ref{fig:add_pluginbase_source}; instead you can browse for the binary DLL as seen below in Figure \ref{fig:browse_reference}. Click on the \textit{Browse} tab and navigate to the folder in which you downloaded the CrypTool 2 project. Within that folder, go to \textit{\textbackslash CrypPluginBase\textbackslash bin\textbackslash Debug} and select the file \textit{CrypPluginBase.dll}. The library reference can then be added by double clicking the file or pressing the \textit{OK} button.
    5860
    5961\begin{figure}[h!]
     
    14761478        \label{fig:sample}
    14771479\end{figure}
    1478 
    1479 \section{Downloading the example and template}
    1480 \label{sec:DownloadingTheExampleAndTemplate}
    1481 
    1482 If you chose not to download the entire CrypTool 2 source code as described in Section \ref{CheckingOutTheSources}, but you want a copy of the source code for the Caesar algorithm that was used as an example in this guide, you can download it as a Visual Studio solution from the following location:\\\\
    1483 \textit{username: anonymous\\
    1484 password:} (not required)\\
    1485 \url{https://www.cryptool.org/svn/CrypTool2/trunk/CrypPlugins/Caesar/}\\\\
    1486 We have also created a Visual Studio plugin \textbf{template} to help with the development of new plugins. This can be found here:\\\\
    1487 \url{http://cryptool2.vs.uni-due.de/downloads/template/encryptionplugin.zip}
Note: See TracChangeset for help on using the changeset viewer.