/*
* Copyright (c) 2004-2006, Netherlands Forensic Institute
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using EnvDTE;
namespace CustomWizard{
public partial class UserInputForm : Form
{
private string _interfaceName;
private string _namespaceName;
private string _usingStatement;
private string _displayName;
private string _assemblyPrefix;
public string InterfaceName
{
get { return _interfaceName; }
set { _interfaceName = value; }
}
public string NamespaceName
{
get { return _namespaceName; }
set { _namespaceName = value; }
}
public string UsingStatement
{
get { return _usingStatement; }
set { _usingStatement = value; }
}
public string DisplayName
{
get { return _displayName; }
set { _displayName = value; }
}
public string AssemblyPrefix
{
get { return _assemblyPrefix; }
set { _assemblyPrefix = value; }
}
public UserInputForm()
{
InitializeComponent();
setTextBox();
}
private void setTextBox()
{
if (rbtnCommunication.Checked)
{
txtBoxWizard.Text = "Communication plug-ins implement communication with the device under investigation.";
}
else if (rbtnConversion.Checked)
{
txtBoxWizard.Text = "Conversion plug-ins convert data extracted with protocol plug-ins into readable data. Conversion plug-ins can be stacked in order to get the prefered translation.";
}
else if (rbtnExport.Checked)
{
txtBoxWizard.Text = "Export plug-ins export the gathered data to a suitable viewable format. The exported format depends on the implementation of the export plug-in. The export plug-ins use selected conversion plug-in(s) to convert data.";
}
else if (rbtnProtocol.Checked)
{
txtBoxWizard.Text = "A protocol defines rules and conventions for communication between devices. A protocol plug-in uses a communication plug-in to extract data from a device under investigation.";
}
else if (rbtnTool.Checked)
{
txtBoxWizard.Text = "A tool plug-in can be used for tasks not directly related to automated data extraction from exhibits. Running a tool plug-in can be done without an open case.";
}
else
{
//should never be here!
}
}
private void btnFinish_Click(object sender, EventArgs e)
{
if (txtNamePlugin.Text.Length <= 0)
{
MessageBox.Show("Please, enter a name for the plugin.", "Plugin name not valid", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else
{
GetSelectedPluginType();
DisplayName = txtNamePlugin.Text;
this.DialogResult = DialogResult.OK;
//this.Dispose();
}
}
private void GetSelectedPluginType()
{
if (rbtnCommunication.Checked)
{
InterfaceName = "ICommunicationPlugin";
NamespaceName = "TULP2G.Input";
UsingStatement = "TULP2G.Input";
AssemblyPrefix = "TULP2G.Communication.";
}
else if (rbtnProtocol.Checked)
{
InterfaceName = "IProtocolPlugin";
NamespaceName = "TULP2G.Input";
UsingStatement = "TULP2G.Input";
AssemblyPrefix = "TULP2G.Protocol.";
}
else if (rbtnExport.Checked)
{
InterfaceName = "IExportPlugin";
NamespaceName = "TULP2G.Output";
UsingStatement = "TULP2G.Output";
AssemblyPrefix = "TULP2G.Export.";
}
else if (rbtnConversion.Checked)
{
InterfaceName = "IConversionPlugin";
NamespaceName = "TULP2G.Output";
UsingStatement = "TULP2G.Output";
AssemblyPrefix = "TULP2G.Conversion.";
}
else if (rbtnTool.Checked)
{
InterfaceName = "IToolPlugin";
NamespaceName = "TULP2G.Tool";
UsingStatement = "TULP2G.Tool";
AssemblyPrefix = "TULP2G.Tool.";
}
else
{
// We should never be here!
}
}
private void btnChanged(object sender, EventArgs e)
{
setTextBox();
}
}
}
|