NewMainForm.cs :  » Persistence-Frameworks » NEO » SQLToNeo » Gui » 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 » Persistence Frameworks » NEO 
NEO » SQLToNeo » Gui » NewMainForm.cs
/* $Id: NewMainForm.cs,v 1.14 2004/11/29 14:21:37 larsbm Exp $
 * Copyright (c) 2004 Engine EAR GmbH & Co. KG
 * Developed by: Lars Behrmann, lb@engine.de
 */

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using SQLToNeo.Controller;

namespace SQLToNeo.Gui{
  /// <summary>
  /// Zusammenfassung fr NewMainForm.
  /// </summary>
  public class NewMainForm : System.Windows.Forms.Form
  {    
    private System.Windows.Forms.Panel panel1;
    private System.Windows.Forms.Panel panel2;
    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.Panel panel3;
    private System.Windows.Forms.GroupBox groupBox2;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TextBox tbxDBName;
    private System.Windows.Forms.TextBox tbxUser;
    private System.Windows.Forms.TextBox tbxPassword;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.DataGrid dgTable;
    private System.Windows.Forms.DataGrid dgColumn;
    private System.Windows.Forms.DataGrid dgForeignkey;
    private System.Windows.Forms.DataGrid dgIForeignkey;
    private System.Windows.Forms.Label label5;
    private System.Windows.Forms.Label label6;
    private System.Windows.Forms.Label label7;
    private System.Windows.Forms.Label label8;
    private System.Windows.Forms.Label label9;
    private System.Windows.Forms.Label label10;
    /// <summary>
    /// Erforderliche Designervariable.
    /// </summary>
    private System.ComponentModel.IContainer components;
    private System.Windows.Forms.CheckBox cbxNTAuthentication;
    private System.Windows.Forms.ComboBox cbxCatalogs;
    private System.Windows.Forms.Button btnConnect;
    private System.Windows.Forms.Button btnGenerate;
    private System.Windows.Forms.ComboBox cbxIdMethod;
    private System.Windows.Forms.TextBox tbxpackagename;
    private System.Windows.Forms.TextBox tbxNeoDBname;
    private System.Windows.Forms.TextBox tbxNeopath;
    private System.Windows.Forms.TextBox tbxNorquepath;
    private System.Windows.Forms.TextBox tbxModelpathfile;
    private System.Windows.Forms.StatusBar stb;
    private System.Windows.Forms.MainMenu mainMenu1;
    private System.Windows.Forms.MenuItem menuItem1;
    private System.Windows.Forms.MenuItem mitmExit;
    private System.Windows.Forms.MenuItem menuItem3;
    private System.Windows.Forms.MenuItem mitmConflicts;
    private System.Windows.Forms.MenuItem mitmBuild;
    private System.Windows.Forms.MenuItem menuItem6;
    private System.Windows.Forms.MenuItem mitmAbout;

    private NewMainFormController _controller;
    private System.Windows.Forms.CheckBox cbxJavaName;
  
    public NewMainFormController Controller
    {
      get { return this._controller; }
      set { this._controller = value; }
    }

      public DataGrid Table
    {
      get { return this.dgTable; }
    }

    public DataGrid Column
    {
      get { return this.dgColumn; }
    }

    public DataGrid ForeignKey
    {
      get { return this.dgForeignkey; }
    }

    public DataGrid IForeignkey
    {
      get { return this.dgIForeignkey; }
    }

    public string Server
    {
      get { return this.tbxDBName.Text; }
    }

    public string User
    {
      get { return this.tbxUser.Text; }
    }

    public string Password
    {
      get { return this.tbxPassword.Text; }
    }

    public bool NTAuthentication
    {
      get { return this.cbxNTAuthentication.Checked; }
    }

    public bool GenerateJavaName
    {
      get
      {
        return this.cbxJavaName.Checked;
      }
    }

      public ComboBox Catalogs
    {
      get { return this.cbxCatalogs; }
    }

    public TextBox PackageName
    {
      get { return this.tbxpackagename; }
    }

    public TextBox NeoDbName
    {
      get { return this.tbxNeoDBname; }
    }

    public TextBox NeoPath
    {
      get { return this.tbxNeopath; }
    }

    public TextBox NorquePathFile
    {
      get { return this.tbxNorquepath; }
    }

    public TextBox ModelPathFile
    {
      get { return this.tbxModelpathfile; }
    }

    public TextBox TablePrefix
    {
      get { return this.tbTablePrefix; }
    }
    
    public ComboBox IDMethod
    {
      get { return this.cbxIdMethod; }
    }
    
    public ComboBox JavaNamingMethod
    {
      get { return this.cbNamingMethod; }
    }

    public StatusBar StatusBar
    {
      get { return this.stb; }
    }

    private string _commandLine;
    public string Commandline
    {
      get { return this._commandLine; }
      set { this._commandLine = value; }
    }

    public NewMainForm(string commandline)
    {  
      Commandline = commandline;
      InitializeComponent();
      AddStatusBarPanel();
      Controller = new NewMainFormController(this);
      Table.TableStyles.Add(SQLToNeo.Model.TableStyleCreator.StyleTable());
      Column.TableStyles.Add(SQLToNeo.Model.TableStyleCreator.StyleColumn());
      IForeignkey.TableStyles.Add(SQLToNeo.Model.TableStyleCreator.StyleForeignkey("iforeignkey"));
      ForeignKey.TableStyles.Add(SQLToNeo.Model.TableStyleCreator.StyleForeignkey("foreignkey"));
    }

    /// <summary>
    /// Die verwendeten Ressourcen bereinigen.
    /// </summary>
    protected override void Dispose( bool disposing )
    {
      if( disposing )
      {
        if(components != null)
        {
          components.Dispose();
        }
      }
      base.Dispose( disposing );
    }

    /// <summary>
    /// Der Haupteinstiegspunkt fr die Anwendung.
    /// </summary>
    [STAThread]
    static void Main(string[] args)
    {
      if(args.Length>0)
        Application.Run(new NewMainForm(args[0]));
      else
        Application.Run(new NewMainForm(""));
    }

    #region Vom Windows Form-Designer generierter Code
    /// <summary>
    /// Erforderliche Methode fr die Designeruntersttzung. 
    /// Der Inhalt der Methode darf nicht mit dem Code-Editor gendert werden.
    /// </summary>
    private void InitializeComponent()
    {
      this.components = new System.ComponentModel.Container();
      this.panel1 = new System.Windows.Forms.Panel();
      this.panel3 = new System.Windows.Forms.Panel();
      this.groupBox2 = new System.Windows.Forms.GroupBox();
      this.cbNamingMethod = new System.Windows.Forms.ComboBox();
      this.textBox1 = new System.Windows.Forms.TextBox();
      this.label11 = new System.Windows.Forms.Label();
      this.lblNamingMethod = new System.Windows.Forms.Label();
      this.tbTablePrefix = new System.Windows.Forms.TextBox();
      this.lblPrefix = new System.Windows.Forms.Label();
      this.cbxIdMethod = new System.Windows.Forms.ComboBox();
      this.label10 = new System.Windows.Forms.Label();
      this.tbxpackagename = new System.Windows.Forms.TextBox();
      this.label9 = new System.Windows.Forms.Label();
      this.tbxNeoDBname = new System.Windows.Forms.TextBox();
      this.label8 = new System.Windows.Forms.Label();
      this.tbxNeopath = new System.Windows.Forms.TextBox();
      this.label7 = new System.Windows.Forms.Label();
      this.tbxNorquepath = new System.Windows.Forms.TextBox();
      this.label6 = new System.Windows.Forms.Label();
      this.tbxModelpathfile = new System.Windows.Forms.TextBox();
      this.label5 = new System.Windows.Forms.Label();
      this.dgIForeignkey = new System.Windows.Forms.DataGrid();
      this.dgForeignkey = new System.Windows.Forms.DataGrid();
      this.dgColumn = new System.Windows.Forms.DataGrid();
      this.dgTable = new System.Windows.Forms.DataGrid();
      this.panel2 = new System.Windows.Forms.Panel();
      this.groupBox1 = new System.Windows.Forms.GroupBox();
      this.btnGenerate = new System.Windows.Forms.Button();
      this.cbxJavaName = new System.Windows.Forms.CheckBox();
      this.cbxCatalogs = new System.Windows.Forms.ComboBox();
      this.label4 = new System.Windows.Forms.Label();
      this.btnConnect = new System.Windows.Forms.Button();
      this.cbxNTAuthentication = new System.Windows.Forms.CheckBox();
      this.tbxPassword = new System.Windows.Forms.TextBox();
      this.label3 = new System.Windows.Forms.Label();
      this.tbxUser = new System.Windows.Forms.TextBox();
      this.label2 = new System.Windows.Forms.Label();
      this.tbxDBName = new System.Windows.Forms.TextBox();
      this.label1 = new System.Windows.Forms.Label();
      this.stb = new System.Windows.Forms.StatusBar();
      this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
      this.menuItem1 = new System.Windows.Forms.MenuItem();
      this.mitmExit = new System.Windows.Forms.MenuItem();
      this.menuItem3 = new System.Windows.Forms.MenuItem();
      this.mitmConflicts = new System.Windows.Forms.MenuItem();
      this.mitmBuild = new System.Windows.Forms.MenuItem();
      this.menuItem6 = new System.Windows.Forms.MenuItem();
      this.mitmAbout = new System.Windows.Forms.MenuItem();
      this.panel1.SuspendLayout();
      this.panel3.SuspendLayout();
      this.groupBox2.SuspendLayout();
      ((System.ComponentModel.ISupportInitialize)(this.dgIForeignkey)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.dgForeignkey)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.dgColumn)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.dgTable)).BeginInit();
      this.panel2.SuspendLayout();
      this.groupBox1.SuspendLayout();
      this.SuspendLayout();
      // 
      // panel1
      // 
      this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                  | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.panel1.Controls.Add(this.panel3);
      this.panel1.Controls.Add(this.panel2);
      this.panel1.Location = new System.Drawing.Point(0, 0);
      this.panel1.Name = "panel1";
      this.panel1.Size = new System.Drawing.Size(864, 686);
      this.panel1.TabIndex = 0;
      // 
      // panel3
      // 
      this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                  | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.panel3.Controls.Add(this.groupBox2);
      this.panel3.Location = new System.Drawing.Point(0, 77);
      this.panel3.Name = "panel3";
      this.panel3.Size = new System.Drawing.Size(864, 609);
      this.panel3.TabIndex = 1;
      // 
      // groupBox2
      // 
      this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                  | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.groupBox2.Controls.Add(this.cbNamingMethod);
      this.groupBox2.Controls.Add(this.textBox1);
      this.groupBox2.Controls.Add(this.label11);
      this.groupBox2.Controls.Add(this.lblNamingMethod);
      this.groupBox2.Controls.Add(this.tbTablePrefix);
      this.groupBox2.Controls.Add(this.lblPrefix);
      this.groupBox2.Controls.Add(this.cbxIdMethod);
      this.groupBox2.Controls.Add(this.label10);
      this.groupBox2.Controls.Add(this.tbxpackagename);
      this.groupBox2.Controls.Add(this.label9);
      this.groupBox2.Controls.Add(this.tbxNeoDBname);
      this.groupBox2.Controls.Add(this.label8);
      this.groupBox2.Controls.Add(this.tbxNeopath);
      this.groupBox2.Controls.Add(this.label7);
      this.groupBox2.Controls.Add(this.tbxNorquepath);
      this.groupBox2.Controls.Add(this.label6);
      this.groupBox2.Controls.Add(this.tbxModelpathfile);
      this.groupBox2.Controls.Add(this.label5);
      this.groupBox2.Controls.Add(this.dgIForeignkey);
      this.groupBox2.Controls.Add(this.dgForeignkey);
      this.groupBox2.Controls.Add(this.dgColumn);
      this.groupBox2.Controls.Add(this.dgTable);
      this.groupBox2.Location = new System.Drawing.Point(8, 6);
      this.groupBox2.Name = "groupBox2";
      this.groupBox2.Size = new System.Drawing.Size(848, 601);
      this.groupBox2.TabIndex = 0;
      this.groupBox2.TabStop = false;
      this.groupBox2.Text = "Model Builder";
      // 
      // cbNamingMethod
      // 
      this.cbNamingMethod.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.cbNamingMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cbNamingMethod.Items.AddRange(new object[] {
                  "nochange",
                  "underscore",
                  "javaname"});
      this.cbNamingMethod.Location = new System.Drawing.Point(410, 572);
      this.cbNamingMethod.Name = "cbNamingMethod";
      this.cbNamingMethod.Size = new System.Drawing.Size(192, 21);
      this.cbNamingMethod.TabIndex = 22;
      // 
      // textBox1
      // 
      this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.textBox1.Enabled = false;
      this.textBox1.Location = new System.Drawing.Point(672, 572);
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(168, 21);
      this.textBox1.TabIndex = 21;
      this.textBox1.Visible = false;
      // 
      // label11
      // 
      this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label11.Enabled = false;
      this.label11.Location = new System.Drawing.Point(616, 572);
      this.label11.Name = "label11";
      this.label11.Size = new System.Drawing.Size(100, 13);
      this.label11.TabIndex = 20;
      this.label11.Text = "Package:";
      this.label11.Visible = false;
      // 
      // lblNamingMethod
      // 
      this.lblNamingMethod.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.lblNamingMethod.Location = new System.Drawing.Point(328, 572);
      this.lblNamingMethod.Name = "lblNamingMethod";
      this.lblNamingMethod.Size = new System.Drawing.Size(100, 13);
      this.lblNamingMethod.TabIndex = 18;
      this.lblNamingMethod.Text = "Naming method:";
      // 
      // tbTablePrefix
      // 
      this.tbTablePrefix.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.tbTablePrefix.Location = new System.Drawing.Point(120, 572);
      this.tbTablePrefix.Name = "tbTablePrefix";
      this.tbTablePrefix.Size = new System.Drawing.Size(192, 21);
      this.tbTablePrefix.TabIndex = 17;
      // 
      // lblPrefix
      // 
      this.lblPrefix.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.lblPrefix.Location = new System.Drawing.Point(8, 572);
      this.lblPrefix.Name = "lblPrefix";
      this.lblPrefix.Size = new System.Drawing.Size(120, 13);
      this.lblPrefix.TabIndex = 16;
      this.lblPrefix.Text = "Table prefix:";
      // 
      // cbxIdMethod
      // 
      this.cbxIdMethod.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.cbxIdMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cbxIdMethod.Items.AddRange(new object[] {
                  "guid",
                  "native",
                  "none"});
      this.cbxIdMethod.Location = new System.Drawing.Point(672, 553);
      this.cbxIdMethod.Name = "cbxIdMethod";
      this.cbxIdMethod.Size = new System.Drawing.Size(168, 21);
      this.cbxIdMethod.TabIndex = 15;
      // 
      // label10
      // 
      this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label10.Location = new System.Drawing.Point(616, 553);
      this.label10.Name = "label10";
      this.label10.Size = new System.Drawing.Size(100, 12);
      this.label10.TabIndex = 14;
      this.label10.Text = "Id method:";
      // 
      // tbxpackagename
      // 
      this.tbxpackagename.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.tbxpackagename.Location = new System.Drawing.Point(672, 533);
      this.tbxpackagename.Name = "tbxpackagename";
      this.tbxpackagename.Size = new System.Drawing.Size(168, 21);
      this.tbxpackagename.TabIndex = 13;
      // 
      // label9
      // 
      this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label9.Location = new System.Drawing.Point(616, 533);
      this.label9.Name = "label9";
      this.label9.Size = new System.Drawing.Size(100, 13);
      this.label9.TabIndex = 12;
      this.label9.Text = "Package:";
      // 
      // tbxNeoDBname
      // 
      this.tbxNeoDBname.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.tbxNeoDBname.Location = new System.Drawing.Point(410, 553);
      this.tbxNeoDBname.Name = "tbxNeoDBname";
      this.tbxNeoDBname.Size = new System.Drawing.Size(192, 21);
      this.tbxNeoDBname.TabIndex = 11;
      // 
      // label8
      // 
      this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label8.Location = new System.Drawing.Point(328, 553);
      this.label8.Name = "label8";
      this.label8.Size = new System.Drawing.Size(100, 12);
      this.label8.TabIndex = 10;
      this.label8.Text = "Neo DB name:";
      // 
      // tbxNeopath
      // 
      this.tbxNeopath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.tbxNeopath.Location = new System.Drawing.Point(410, 533);
      this.tbxNeopath.Name = "tbxNeopath";
      this.tbxNeopath.Size = new System.Drawing.Size(192, 21);
      this.tbxNeopath.TabIndex = 9;
      // 
      // label7
      // 
      this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label7.Location = new System.Drawing.Point(328, 533);
      this.label7.Name = "label7";
      this.label7.Size = new System.Drawing.Size(100, 13);
      this.label7.TabIndex = 8;
      this.label7.Text = "Neo path:";
      // 
      // tbxNorquepath
      // 
      this.tbxNorquepath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.tbxNorquepath.Location = new System.Drawing.Point(120, 553);
      this.tbxNorquepath.Name = "tbxNorquepath";
      this.tbxNorquepath.Size = new System.Drawing.Size(192, 21);
      this.tbxNorquepath.TabIndex = 7;
      // 
      // label6
      // 
      this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label6.Location = new System.Drawing.Point(8, 553);
      this.label6.Name = "label6";
      this.label6.Size = new System.Drawing.Size(100, 12);
      this.label6.TabIndex = 6;
      this.label6.Text = "Norque.dtd path:";
      // 
      // tbxModelpathfile
      // 
      this.tbxModelpathfile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.tbxModelpathfile.Location = new System.Drawing.Point(120, 533);
      this.tbxModelpathfile.Name = "tbxModelpathfile";
      this.tbxModelpathfile.Size = new System.Drawing.Size(192, 21);
      this.tbxModelpathfile.TabIndex = 5;
      // 
      // label5
      // 
      this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.label5.Location = new System.Drawing.Point(8, 533);
      this.label5.Name = "label5";
      this.label5.Size = new System.Drawing.Size(120, 13);
      this.label5.TabIndex = 4;
      this.label5.Text = "Model path && filename:";
      // 
      // dgIForeignkey
      // 
      this.dgIForeignkey.AllowNavigation = false;
      this.dgIForeignkey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.dgIForeignkey.CaptionText = "IForeignkeys";
      this.dgIForeignkey.DataMember = "";
      this.dgIForeignkey.HeaderForeColor = System.Drawing.SystemColors.ControlText;
      this.dgIForeignkey.Location = new System.Drawing.Point(312, 452);
      this.dgIForeignkey.Name = "dgIForeignkey";
      this.dgIForeignkey.RowHeadersVisible = false;
      this.dgIForeignkey.RowHeaderWidth = 15;
      this.dgIForeignkey.Size = new System.Drawing.Size(528, 76);
      this.dgIForeignkey.TabIndex = 3;
      // 
      // dgForeignkey
      // 
      this.dgForeignkey.AllowNavigation = false;
      this.dgForeignkey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.dgForeignkey.CaptionText = "Foreignkeys";
      this.dgForeignkey.DataMember = "";
      this.dgForeignkey.HeaderForeColor = System.Drawing.SystemColors.ControlText;
      this.dgForeignkey.Location = new System.Drawing.Point(312, 350);
      this.dgForeignkey.Name = "dgForeignkey";
      this.dgForeignkey.Size = new System.Drawing.Size(528, 96);
      this.dgForeignkey.TabIndex = 2;
      // 
      // dgColumn
      // 
      this.dgColumn.AllowNavigation = false;
      this.dgColumn.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                  | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.dgColumn.CaptionText = "Columns";
      this.dgColumn.DataMember = "";
      this.dgColumn.HeaderForeColor = System.Drawing.SystemColors.ControlText;
      this.dgColumn.Location = new System.Drawing.Point(312, 13);
      this.dgColumn.Name = "dgColumn";
      this.dgColumn.Size = new System.Drawing.Size(528, 330);
      this.dgColumn.TabIndex = 1;
      this.dgColumn.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dgColumn_Navigate);
      // 
      // dgTable
      // 
      this.dgTable.AllowNavigation = false;
      this.dgTable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                  | System.Windows.Forms.AnchorStyles.Left)));
      this.dgTable.CaptionText = "Tables";
      this.dgTable.DataMember = "";
      this.dgTable.HeaderForeColor = System.Drawing.SystemColors.ControlText;
      this.dgTable.Location = new System.Drawing.Point(8, 13);
      this.dgTable.Name = "dgTable";
      this.dgTable.Size = new System.Drawing.Size(288, 515);
      this.dgTable.TabIndex = 0;
      // 
      // panel2
      // 
      this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                  | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.panel2.Controls.Add(this.groupBox1);
      this.panel2.Location = new System.Drawing.Point(0, 0);
      this.panel2.Name = "panel2";
      this.panel2.Size = new System.Drawing.Size(864, 327);
      this.panel2.TabIndex = 0;
      // 
      // groupBox1
      // 
      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.groupBox1.Controls.Add(this.btnGenerate);
      this.groupBox1.Controls.Add(this.cbxJavaName);
      this.groupBox1.Controls.Add(this.cbxCatalogs);
      this.groupBox1.Controls.Add(this.label4);
      this.groupBox1.Controls.Add(this.btnConnect);
      this.groupBox1.Controls.Add(this.cbxNTAuthentication);
      this.groupBox1.Controls.Add(this.tbxPassword);
      this.groupBox1.Controls.Add(this.label3);
      this.groupBox1.Controls.Add(this.tbxUser);
      this.groupBox1.Controls.Add(this.label2);
      this.groupBox1.Controls.Add(this.tbxDBName);
      this.groupBox1.Controls.Add(this.label1);
      this.groupBox1.Location = new System.Drawing.Point(8, 6);
      this.groupBox1.Name = "groupBox1";
      this.groupBox1.Size = new System.Drawing.Size(848, 65);
      this.groupBox1.TabIndex = 0;
      this.groupBox1.TabStop = false;
      this.groupBox1.Text = "Database";
      // 
      // btnGenerate
      // 
      this.btnGenerate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.btnGenerate.Location = new System.Drawing.Point(744, 10);
      this.btnGenerate.Name = "btnGenerate";
      this.btnGenerate.Size = new System.Drawing.Size(96, 19);
      this.btnGenerate.TabIndex = 1;
      this.btnGenerate.Text = "Generate Model";
      this.btnGenerate.Click += new System.EventHandler(this.btnGenerate_Click);
      // 
      // cbxJavaName
      // 
      this.cbxJavaName.Location = new System.Drawing.Point(376, 19);
      this.cbxJavaName.Name = "cbxJavaName";
      this.cbxJavaName.Size = new System.Drawing.Size(128, 20);
      this.cbxJavaName.TabIndex = 11;
      this.cbxJavaName.Text = "Generate JavaName";
      // 
      // cbxCatalogs
      // 
      this.cbxCatalogs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cbxCatalogs.Location = new System.Drawing.Point(704, 39);
      this.cbxCatalogs.Name = "cbxCatalogs";
      this.cbxCatalogs.Size = new System.Drawing.Size(136, 21);
      this.cbxCatalogs.TabIndex = 10;
      this.cbxCatalogs.SelectedValueChanged += new System.EventHandler(this.cbxCatalogs_SelectedValueChanged);
      // 
      // label4
      // 
      this.label4.Location = new System.Drawing.Point(640, 42);
      this.label4.Name = "label4";
      this.label4.Size = new System.Drawing.Size(100, 18);
      this.label4.TabIndex = 9;
      this.label4.Text = "Databases:";
      // 
      // btnConnect
      // 
      this.btnConnect.Location = new System.Drawing.Point(512, 39);
      this.btnConnect.Name = "btnConnect";
      this.btnConnect.Size = new System.Drawing.Size(96, 18);
      this.btnConnect.TabIndex = 7;
      this.btnConnect.Text = "Load Databases";
      this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
      // 
      // cbxNTAuthentication
      // 
      this.cbxNTAuthentication.Location = new System.Drawing.Point(376, 39);
      this.cbxNTAuthentication.Name = "cbxNTAuthentication";
      this.cbxNTAuthentication.Size = new System.Drawing.Size(120, 19);
      this.cbxNTAuthentication.TabIndex = 6;
      this.cbxNTAuthentication.Text = "NT Authentication";
      // 
      // tbxPassword
      // 
      this.tbxPassword.Location = new System.Drawing.Point(248, 39);
      this.tbxPassword.Name = "tbxPassword";
      this.tbxPassword.PasswordChar = '*';
      this.tbxPassword.Size = new System.Drawing.Size(100, 21);
      this.tbxPassword.TabIndex = 5;
      // 
      // label3
      // 
      this.label3.Location = new System.Drawing.Point(192, 42);
      this.label3.Name = "label3";
      this.label3.Size = new System.Drawing.Size(100, 12);
      this.label3.TabIndex = 4;
      this.label3.Text = "Password:";
      // 
      // tbxUser
      // 
      this.tbxUser.Location = new System.Drawing.Point(64, 39);
      this.tbxUser.Name = "tbxUser";
      this.tbxUser.Size = new System.Drawing.Size(112, 21);
      this.tbxUser.TabIndex = 3;
      // 
      // label2
      // 
      this.label2.Location = new System.Drawing.Point(8, 42);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(100, 12);
      this.label2.TabIndex = 2;
      this.label2.Text = "User:";
      // 
      // tbxDBName
      // 
      this.tbxDBName.Location = new System.Drawing.Point(64, 19);
      this.tbxDBName.Name = "tbxDBName";
      this.tbxDBName.Size = new System.Drawing.Size(112, 21);
      this.tbxDBName.TabIndex = 1;
      // 
      // label1
      // 
      this.label1.Location = new System.Drawing.Point(8, 22);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(100, 13);
      this.label1.TabIndex = 0;
      this.label1.Text = "Server:";
      // 
      // stb
      // 
      this.stb.Location = new System.Drawing.Point(0, 691);
      this.stb.Name = "stb";
      this.stb.Size = new System.Drawing.Size(864, 18);
      this.stb.TabIndex = 1;
      // 
      // mainMenu1
      // 
      this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                  this.menuItem1,
                  this.menuItem3,
                  this.menuItem6});
      // 
      // menuItem1
      // 
      this.menuItem1.Index = 0;
      this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                  this.mitmExit});
      this.menuItem1.Text = "File";
      // 
      // mitmExit
      // 
      this.mitmExit.Index = 0;
      this.mitmExit.Text = "Exit";
      this.mitmExit.Click += new System.EventHandler(this.mitmExit_Click);
      // 
      // menuItem3
      // 
      this.menuItem3.Index = 1;
      this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                  this.mitmConflicts,
                  this.mitmBuild});
      this.menuItem3.Text = "Project";
      // 
      // mitmConflicts
      // 
      this.mitmConflicts.Index = 0;
      this.mitmConflicts.Text = "Check for conflicts";
      this.mitmConflicts.Click += new System.EventHandler(this.mitmConflicts_Click);
      // 
      // mitmBuild
      // 
      this.mitmBuild.Index = 1;
      this.mitmBuild.Text = "Build Xml model";
      this.mitmBuild.Click += new System.EventHandler(this.mitmBuild_Click);
      // 
      // menuItem6
      // 
      this.menuItem6.Index = 2;
      this.menuItem6.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                  this.mitmAbout});
      this.menuItem6.Text = "Info";
      // 
      // mitmAbout
      // 
      this.mitmAbout.Index = 0;
      this.mitmAbout.Text = "About";
      this.mitmAbout.Click += new System.EventHandler(this.mitmAbout_Click);
      // 
      // NewMainForm
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
      this.ClientSize = new System.Drawing.Size(864, 709);
      this.Controls.Add(this.stb);
      this.Controls.Add(this.panel1);
      this.Menu = this.mainMenu1;
      this.Name = "NewMainForm";
      this.Text = "SQLToNeo";
      this.Load += new System.EventHandler(this.NewMainForm_Load);
      this.panel1.ResumeLayout(false);
      this.panel3.ResumeLayout(false);
      this.groupBox2.ResumeLayout(false);
      this.groupBox2.PerformLayout();
      ((System.ComponentModel.ISupportInitialize)(this.dgIForeignkey)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.dgForeignkey)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.dgColumn)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.dgTable)).EndInit();
      this.panel2.ResumeLayout(false);
      this.groupBox1.ResumeLayout(false);
      this.groupBox1.PerformLayout();
      this.ResumeLayout(false);
    }
    private System.Windows.Forms.ComboBox cbNamingMethod;
    private System.Windows.Forms.TextBox tbTablePrefix;
    private System.Windows.Forms.Label lblPrefix;
    private System.Windows.Forms.Label lblNamingMethod;
    private System.Windows.Forms.Label label11;
    private System.Windows.Forms.TextBox textBox1;
    #endregion

    public void NoModelLoaded()
    {
      MessageBox.Show("No Model loaded!");
    }

    public DialogResult SaveChanges()
    {
      return MessageBox.Show("You did changes to this xml model!\nDo you want to save these and generate the xml model?", "Save changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
    }

    public void CreateProjectFolder(string path)
    {
      MessageBox.Show("The project folder doesn't exist.\nSQLToNeo will now create it under:\n\n"+path,"Create project folder", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }

    public void CommandLineError()
    {
      MessageBox.Show("You tried to start SQLToNeo with wrong commandline parameter!","Wrong commandline parameter", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }

    private void btnConnect_Click(object sender, System.EventArgs e)
    {
      Controller.LoadCatalogs();
    }

    private void cbxCatalogs_SelectedValueChanged(object sender, System.EventArgs e)
    {
      Controller.LoadDatabase();
    }

    private void btnGenerate_Click(object sender, System.EventArgs e)
    {
      Controller.GenerateModel();
    }

    private void AddStatusBarPanel()
    {
      StatusBarPanel sbp = new StatusBarPanel();
      sbp.AutoSize = StatusBarPanelAutoSize.Spring;
      sbp.BorderStyle = StatusBarPanelBorderStyle.Sunken;
      sbp.Text = "Current Database: No Database selected";
      StatusBar.Panels.Add(sbp);

      sbp = new StatusBarPanel();
      sbp.AutoSize = StatusBarPanelAutoSize.None;
      sbp.Width = 300;
      sbp.BorderStyle = StatusBarPanelBorderStyle.Sunken;
      sbp.Text = "Statistics: No Database selected";
      StatusBar.Panels.Add(sbp);
      StatusBar.ShowPanels = true;
    }

    private void mitmAbout_Click(object sender, System.EventArgs e)
    {
      string m = "SQLToNeo Version "+System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
      m += "\nAuthor: L.Behrmman";
      m += "\nLicense: LGPL";
      m += "\nHomepage: http://sqltoneo.sourceforge.net";
      MessageBox.Show(m);
    }

    private void mitmConflicts_Click(object sender, System.EventArgs e)
    {
      Controller.CheckforConflicts();
    }

    private void mitmBuild_Click(object sender, System.EventArgs e)
    {
      this.btnGenerate_Click(null, null);
    }

    private void mitmExit_Click(object sender, System.EventArgs e)
    {
      this.Close();
    }

    private void NewMainForm_Load(object sender, System.EventArgs e)
    {
      //Command line for QueryCommander support
      if(Commandline.Length>0)
      {        
        if(!Controller.ValidateCommandline())
          return;
        string[] args = Commandline.Split(';');
        string dataBase = args[0];
        string catalog  = args[1];
        string userName = args[2];
        string passWord = args[3];
        bool ntauthentication = Convert.ToBoolean(Convert.ToInt32(args[4]));

        tbxDBName.Text=dataBase;
        tbxUser.Text=userName;
        tbxPassword.Text=passWord;
        cbxCatalogs.Text=catalog;
        cbxNTAuthentication.Checked = ntauthentication;
        Controller.LoadCatalogs();

        for(int i=0;i<cbxCatalogs.Items.Count;i++)
        {
          if(cbxCatalogs.Items[i].ToString().ToLower()==catalog.ToLower())
          {
            cbxCatalogs.SelectedIndex=i;
            break;
          }
        }
      }
    }

    private void dgColumn_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
    {
    
    }
  }
}

/*
 * $Log: NewMainForm.cs,v $
 * Revision 1.14  2004/11/29 14:21:37  larsbm
 * - change label texts
 *
 * Revision 1.13  2004/11/22 09:13:14  larsbm
 * - Add commandline possibility for QueryCommander
 *
 * Revision 1.12  2004/11/09 07:59:38  larsbm
 * - Add method : CreateProjectFolder()
 *
 * Revision 1.11  2004/11/09 07:34:00  larsbm
 * - Deny add and delete rows
 * - rember changes did by the user to the xml model
 *
 * Revision 1.10  2004/11/08 12:46:51  larsbm
 * - Add little validation
 *
 * Revision 1.9  2004/11/02 14:02:38  larsbm
 * - Add new property to IDataBaseConnector
 * - Form for displaying possible conflicts
 * - Implement Conflictform
 * - Add Mainmenu to mainform
 *
 * Revision 1.8  2004/11/02 07:30:48  larsbm
 * - removed unused files
 *
 * Revision 1.7  2004/10/27 14:09:22  larsbm
 * - Fixed bugs in tablebuilder, TablestyleCreator
 * - Working on the forms
 * - Finishing DBTypes
 * - Add IWriter & Writer, NeoXMLModelWriter as abstraction for writing the xml model
 *
 * Revision 1.6  2004/10/26 13:23:45  larsbm
 * - Fixed bugs in tablebuilder
 * - Working on the forms
 * - Finishing MergeSpecial
 * - Make app run with mergespecial
 * - start converter for sqldatatypes
 *
 * Revision 1.5  2004/10/20 14:03:30  larsbm
 * - Added support for foreign and primary keys
 * - Implement SQLServerConnector (half)
 * - Running into trouble with merging datasets marked as todo
 *
 * Revision 1.4  2004/10/18 14:13:53  larsbm
 * - Add columns, foreignkeys
 * - Bring Anaylzer, NewMainformController and DataSetController together
 * - Several bugfixes
 *
 * Revision 1.3  2004/10/13 08:53:54  larsbm
 * - Start to implement new anaylzer via bridge pattern
 * - Adding a test for the new analyzer
 *
 * 
 */
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.