Esempio n. 1
0
        private IConfiguration NewObject(string classType, string caption, int height)
        {
            EditObject     obj;
            IConfiguration config = null;

            try
            {
                ConfigurationPanel.EditObjectButton.Text = caption;

                Assembly a = Assembly.GetAssembly(this.GetType());

                object[] args = new object[1];
                args[0] = SqlConnectionControl.ServiceBroker;
                //Create a new instance of class type stored in classType.
                config = (IConfiguration)a.CreateInstance
                             (classType, true, BindingFlags.CreateInstance, null, args,
                             System.Globalization.CultureInfo.CurrentCulture, null);

                obj = ConfigurationPanel.AddObject("(New)", config);
                obj.Expand(height);
                obj.ButtonVisible = false;
            }
            catch (Exception ex)
            {
                ExceptionMessageBox emb = new ExceptionMessageBox(ex);
                emb.Show(this);
            }

            return(config);
        }
Esempio n. 2
0
        private void OptionsButton_Click(object sender, EventArgs e)
        {
            EditObject obj;

            ConfigurationPanel.RemoveAllObjects();

            ConfigurationPanel.EditObjectButton.Text = "Application Configuration";

            obj = ConfigurationPanel.AddObject("Application Configuration",
                                               SqlConnectionControl.OptionsConfiguration);
            obj.ButtonVisible = false;

            ConfigurationPanel.ActiveEditObject = obj;

            ConfigurationPanel.SetStripButtonState(ObjectsSplitPanel.operations.New);
            this.TaskTabControl.SelectTab(ConfigurationTabPageName);
        }