using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer.Management.Smo;

namespace SubscriptionBuilder
{
	public partial class MainForm : Form
	{
		public MainForm()
		{
			InitializeComponent();

			// Wire events
			this.instanceChooser1.SelectedChanged += new EventHandler<RulesControls.SmoEventArgs<Microsoft.SqlServer.Management.Nmo.Instance>>(applicationChooser1.HandleParentContextChange);
			this.applicationChooser1.SelectedChanged += new EventHandler<RulesControls.SmoEventArgs<Microsoft.SqlServer.Management.Nmo.Application>>(subscriptionClassChooser1.HandleParentContextChange);
			this.subscriptionClassChooser1.SelectedChanged +=new EventHandler<RulesControls.SmoEventArgs<Microsoft.SqlServer.Management.Nmo.SubscriptionClass>>(conditionEventRuleChooser1.HandleParentContextChange);
			this.conditionEventRuleChooser1.SelectedChanged += new EventHandler<RulesControls.SmoEventArgs<Microsoft.SqlServer.Management.Nmo.SubscriptionConditionEventRule>>(subscriptionControl1.HandleParentContextChange);

			// Set server
			this.instanceChooser1.ParentContext = new Server(".");
		}
	}
}