Beispiel #1
0
        public static void ResetLanguage(IApplicationForm panel)
        {
            IObject bo        = null;
            var     frm       = ((Control)panel).FindForm();
            Control parent    = ((Control)panel).Parent;
            var     basePanel = panel as IBasePanel;

            if (basePanel != null)
            {
                bo     = (basePanel).BusinessObject;
                parent = (((Control)(basePanel).GetLayout())).Parent;
            }
            Close(panel);
            if (bo != null)
            {
                if (frm == MainForm)
                {
                    ShowClient(panel.GetType(), parent, bo);
                }
                else
                {
                    ShowNormal(panel.GetType(), bo, null, ((Control)panel).Width, ((Control)panel).Height);
                }
            }
            else
            {
                object key = panel.Key;
                panel = (IApplicationForm)ClassLoader.LoadClass(panel.GetType());
                if (frm == MainForm)
                {
                    ShowClient(panel, parent, ref key);
                }
                else
                {
                    ShowNormal(panel, ref key, null, ((Control)panel).Width, ((Control)panel).Height);
                }
            }
        }
Beispiel #2
0
 public static IApplicationForm FindForm(IApplicationForm formToFind, Comparison <IApplicationForm> compare)
 {
     foreach (IApplicationForm form in m_FormList)
     {
         if (form.GetType() != formToFind.GetType())
         {
             continue;
         }
         if (compare != null)
         {
             if (compare(form, formToFind) == 0)
             {
                 return(form);
             }
             continue;
         }
         return(form);
     }
     return(null);
 }
Beispiel #3
0
        /// <summary>
        /// </summary>
        /// <param name="frm"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool Register(IApplicationForm frm, object id)
        {
            if (m_CurrentForm != null)
            {
                var listPanel = m_CurrentForm as IBaseListPanel;
                if (listPanel != null)
                {
                    listPanel.HideCustomization();
                }
            }
            var ctl = FindFormByID(frm.GetType(), id);

            if (ctl == null)
            {
                m_FormList.Add(frm);
                m_CurrentForm = frm;
                return(true);
            }
            ctl.Activate();
            m_CurrentForm = ctl;
            return(false);
        }