Exemplo n.º 1
0
        private void InitWizards()
        {
            iWizardUserControlList = new SortedList();
            List <object> objectList = ReflectionManager.CreateInstancesByInterface(WizardType);

            foreach (object obj in objectList)
            {
                IWizardUserControl iWizardUserControl = obj as IWizardUserControl;
                iWizardUserControl.Report = report;
                iWizardUserControlList.Add(iWizardUserControl.SortID, iWizardUserControl);
            }
            SuspendLayout();
            foreach (DictionaryEntry de in iWizardUserControlList)
            {
                Control control = de.Value as Control;
                control.Dock = DockStyle.Fill;
                pnlCenter.Controls.Add(control);
            }
            ResumeLayout();
        }
Exemplo n.º 2
0
        private void InitControls()
        {
            List <Type>   iPublicInterfaceList        = ReflectionManager.GetTypesByInterface(typeof(IPublicInterface), TypeOfType.Interface);
            List <object> iPublicInterfaceSettingList = ReflectionManager.CreateInstancesByInterface(typeof(IPublicInterfaceSettingUserControl));

            foreach (Type type in iPublicInterfaceList)
            {
                foreach (IPublicInterfaceSettingUserControl iPublicInterfaceSettingUserControl in iPublicInterfaceSettingList)
                {
                    if (type == iPublicInterfaceSettingUserControl.InterfaceType)
                    {
                        iPublicInterfaceSettingUserControl.InterfaceSetting = report.MainReportSetting.InterfaceSetting;
                        TabPage tabPage = new TabPage();
                        tabPage.Text = type.Name;
                        tabPage.Controls.Add(iPublicInterfaceSettingUserControl as Control);
                        (iPublicInterfaceSettingUserControl as Control).Dock = DockStyle.Fill;
                        tabPage.Tag = iPublicInterfaceSettingUserControl;
                        tabControl.TabPages.Add(tabPage);
                    }
                }
            }
        }