Exemplo n.º 1
0
        public void UpdateForm(FormBase targetForm, FormBase sourceForm)
        {
            foreach (PropertyInfo property in typeof(FormBase).GetProperties())
            {
                foreach (Attribute attribute in property.GetCustomAttributes(true))
                {
                    if (attribute is FormBaseAttribute)
                    {
                        object sourceFormValue = property.GetValue(sourceForm);

                        property.SetValue(targetForm, sourceFormValue);
                    }
                }
            }

            targetForm.Refresh();
            targetForm.Update();
        }
Exemplo n.º 2
0
        public static void ShowForm(FormBase form, FormBase parent)
        {
            form.Show();

            if (parent != null) parent.Close();
        }