UserInputForm.cs :  » Development » TULP2G » CustomWizard » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Development » TULP2G 
TULP2G » CustomWizard » UserInputForm.cs
/*
 * 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();
        }
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.