Пример #1
0
        /// <summary>
        /// Opens any form that implements <see cref="IFormBase"/>
        /// </summary>
        /// <typeparam name="T">The form to open</typeparam>
        /// <param name="formToClose">The form to close that implements <see cref="IFormBase"/></param>
        /// <param name="disposeAll">If true closes all forms that where previously hidden</param>
        /// <returns></returns>
        public static T OpenForm <T>(IFormBase formToClose) where T : IFormBase, new()
        {
            var form = new T();

            if (formToClose != null)
            {
                //remove close application if form is closed
                formToClose.FormClosed -= Form_FormClosed;

                //fade out current form and close it
                FadeOutForm(formToClose);

                //copy width and height to new form
                form.Width       = formToClose.Width;
                form.Height      = formToClose.Height;
                form.MinimumSize = formToClose.MinimumSize;
            }

            //add event to close application if form is closed
            form.FormClosed += Form_FormClosed;

            //Fade in new form
            FadeInForm(form);
            return(form);
        }
Пример #2
0
 public FrmBase(IDbAdmin objetoDbAdmin, IFormBase frmNuevoEditar)
 {
     InitializeComponent();
     dbAdmin        = objetoDbAdmin;
     FrmNuevoEditar = frmNuevoEditar;
     ActualizarGrilla();
 }
 public static void SafeExecuteAction(this IFormBase form, Action action)
 {
     try
     {
         action();
     }
     catch (Exception ex)
     {
         Logger.LogHelper.Logger.Error(ex);
         MyMessageBox.ShowException(form, ex);
     }
 }
Пример #4
0
 private static void FadeOutForm(IFormBase formToClose)
 {
     if (TransitionSpeed > 0)
     {
         formToClose.Opacity = 1;
         while (formToClose.Opacity > 0.1)
         {
             System.Threading.Thread.Sleep(TransitionSpeed);
             formToClose.Opacity -= 0.05;
         }
     }
     formToClose.Opacity = 0;
     formToClose.Close();
 }
Пример #5
0
        private static void FadeInForm(IFormBase form)
        {
            form.Opacity = 0.1;
            form.Show();
            if (TransitionSpeed > 0)
            {
                Application.DoEvents(); //do the render panel events
                while (form.Opacity < 1.0)
                {
                    System.Threading.Thread.Sleep(TransitionSpeed);
                    form.Opacity += 0.05;
                }
            }

            form.Opacity = 1;
        }
Пример #6
0
 public void SetMaster(IFormItemBase item, IFormBase master)
 {
     (item as XPBaseObject).SetMemberValue(MasterPropertyName, master);
 }
Пример #7
0
 public virtual IEnumerable <IFormItemBase> Get_BaseItems(IFormBase form)
 {
     return((form as XPBaseObject).GetMemberValue(this.ItemsPropertyName) as IEnumerable <IFormItemBase>);
     //throw new Exception("请继承自FormBaseLogic并重载Get_Items方法,实现返回明细项目的集合!或在自己的逻辑类中实现Get_Items方法!");
 }
Пример #8
0
 public CoreManager(IFormBase MainWindow)
 {
     this.MainWindow = MainWindow;
 }
Пример #9
0
		public CoreManager(IFormBase MainWindow)
		{
			this.MainWindow=MainWindow;
		}