Exemplo n.º 1
0
        private void ShowAdditionalActionForm(Type classForm)
        {
            Form inst = (Form)Activator.CreateInstance(classForm);

            inst.TopLevel = false;
            panelAdditionalActionForm.Controls.Add(inst);
            inst.FormBorderStyle = FormBorderStyle.None;
            inst.Dock            = DockStyle.Fill;
            inst.Show();
            actionAdditionalForm = inst;
            IFormAction ifrm = actionAdditionalForm as IFormAction;

            if (ifrm != null)
            {
                ifrm.SetAction(EditRule.Action);
            }
        }
Exemplo n.º 2
0
 private void SetListIndexActionType(Type t)
 {
     for (int i = 0; i < listBoxActionType.Items.Count; i++)
     {
         ClassRecord rec = (ClassRecord)listBoxActionType.Items[i];
         if (rec.classRecord == t)
         {
             // if called Previous or Next rule action, SelectedIndex may be same and ChangeSelected wouldn't be called
             // flagReinit used for set value in these cases
             Boolean flagReinit = listBoxActionType.SelectedIndex == i;
             listBoxActionType.SelectedIndex = i;
             if (flagReinit)
             {
                 IFormAction ifrm = actionAdditionalForm as IFormAction;
                 if (ifrm != null)
                 {
                     ifrm.SetAction(editRule.Action);
                 }
             }
             return;
         }
     }
     listBoxActionType.SelectedIndex = -1;
 }