private void browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            //e.Cancel = true;
            string urlString = e.Url.ToString();
            int    i         = urlString.IndexOf("#link");

            if (i >= 0)
            {
                string link = urlString.Substring(i);
                Console.WriteLine(link);
                e.Cancel = true;

                RuleValue       rv            = links[link];
                DPModifyControl modifyControl = rv.DataProvider.GetModifyUserInterface();
                var             form          = DPControlContainerModifyForm.CreateForm(modifyControl);

                WinForms.SetFormRelativePosition(form, this, FormRelativePosition.LEFT);
                DialogResult dialogResult = form.ShowDialog(this);

                if (dialogResult == DialogResult.OK)
                {
                    rv.DataProvider.UpdateProviderFromPropertyValues();
                    DisplayTradeDescription();
                }
            }
        }
        void displayControl2_Click(object sender, EventArgs e)
        {
            if (dataProvider2.GetModifyUserInterface() != null)
            {
                Control modifyControl = dataProvider2.GetModifyUserInterface();
                Size    controlSize   = modifyControl.Size;
                var     dpModifyForm  = new DPControlContainerModifyForm();
                dpModifyForm.Width  = controlSize.Width + 16;
                dpModifyForm.Height = controlSize.Height + 112;
                Panel panel = dpModifyForm.Controls["panelControl"] as Panel;
                panel.Controls.Add(modifyControl);
                modifyControl.Dock = DockStyle.Fill;

                DialogResult dialogResult = dpModifyForm.ShowDialog(this);

                if (dialogResult == DialogResult.OK)
                {
                    dataProvider2.UpdateProviderFromPropertyValues();
                    dataProvider2.GetDisplayUserInterface().InitializeControl();
                }
            }
        }
        private void comboValue2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (settingComboValue == true)
            {
                return;
            }

            ShowTrueFalseBox(false);

            string dataProviderName = comboValue2.Text;

            dataProvider2 = (IDataProvider)Activator.CreateInstance(dataProviders[dataProviderName]);

            txtDescription.Text = dataProvider2.Name + ": " + dataProvider2.Description;

            DialogResult dialogResult = System.Windows.Forms.DialogResult.Cancel;

            // See if we need to display a UI for this data provider.
            if (dataProvider2.GetModifyUserInterface() != null)
            {
                DPModifyControl modifyControl = dataProvider2.GetModifyUserInterface();
                Size            controlSize   = modifyControl.Size;
                var             dpModifyForm  = new DPControlContainerModifyForm();
                dpModifyForm.Width  = controlSize.Width + 16;
                dpModifyForm.Height = controlSize.Height + 112;
                Panel panel = dpModifyForm.Controls["panelControl"] as Panel;
                panel.Controls.Add(modifyControl);
                modifyControl.Dock = DockStyle.Fill;

                WinForms.SetFormRelativePosition(dpModifyForm, this, FormRelativePosition.RIGHT);
                dialogResult = dpModifyForm.ShowDialog(this);

                if (dialogResult == DialogResult.OK)
                {
                    dataProvider2.UpdateProviderFromPropertyValues();
                }
                else
                {
                    ResetComboValue2();
                }
            }

            if (dataProvider2.GetModifyUserInterface() == null || dialogResult == System.Windows.Forms.DialogResult.OK)
            {
                previousComboValue2      = comboValue2.SelectedIndex;
                ruleValue2               = new RuleValue(dataProvider2);
                ruleValue2.ValueUpdated += ruleValue_ValueUpdated;
                DPDisplayControl displayControl = ruleValue2.DataProvider.GetDisplayUserInterface();
                panelValue2UI.Controls.Clear();
                panelValue2UI.Controls.Add(displayControl);
                displayControl.Dock = DockStyle.Fill;

                dataProvider2.UpdateProviderFromPropertyValues();

                if (dataProvider2.GetModifyUserInterface() == null)
                {
                    displayControl.Cursor = Cursors.Default;
                }
                else
                {
                    displayControl.Cursor = Cursors.Hand;
                    displayControl.Click += displayControl2_Click;
                }

                CheckConditionEnableTest();
            }
        }