Simple Constructor Chaining
<p>All, I have an application I want to lanch from another application or as a stand alone utility. To facilitate the start up of appA from appB, I use the following code in <code>Main()</code>/Program.cs </p>

<pre><code>[STAThread]
static void Main(string[] args)
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new SqlEditorForm(args));
} 
</code></pre>

<p>Now, in <code>SqlEditorForm</code> I have two constructors </p>

<pre><code>public SqlEditorForm(string[] args)
    : this()
{
    InitializeComponent();

    // Test if called from appB...
    if (args != null &amp;&amp; args.Count() &gt; 0)
    {
        // Do stuff here...
    }
}
</code></pre>

<p>and the deafult </p>

<pre><code>public SqlEditorForm()
{
    // Always do lots of stuff here...
}
</code></pre>

<p>This to me looks fine, but when run as stand alone (<code>args.Length = 0</code>) the <code>SqlEditorForm(string[] args)</code> constructor is getting called, and before it steps into the constructor to perform <code>InitializeComponent();</code>, it goes and initialises all of the global variables for the class <em>then</em> steps directly into the default constructor. </p>

<p><em>Question, The chaining of the constructors seems to be happending in the wrong order. I want to know why?</em></p>

<p>Thanks for your time.</p>
