Beispiel #1
0
        /// <summary>
        /// Cambios Bajo costo
        /// </summary>
        /// <param name="zone"></param>
        /// <param name="frm"></param>
        /// <param name="userControlName"></param>
        /// <param name="parameter"></param>
        /// <param name="parameters"></param>
        public static void AddToPanelWithParameters(Zone zone, Form frm, string userControlName, object parameter, object extraData, params string[] parameters)
        {
            string panelName = string.Empty;

            switch (zone)
            {
            case Zone.Left:
                panelName = "pnlLeft";
                break;

            case Zone.Middle:
                panelName = "pnlMiddle";
                break;

            case Zone.Right:
                panelName = "pnlRight";
                break;
            }

            panelName = panelName.ToLower();

            Control[] controls = frm.Controls.Find(panelName, true);
            if (controls[0].Controls.Count > 0)
            {
                if (controls[0].Controls[0] is CustomUserControl)
                {
                    ((CustomUserControl)controls[0].Controls[0]).Dispose();
                }
            }

            //controls[0].Controls.Clear();
            //frm.PerformLayout();
            //GC.Collect();

            CustomUserControl cu = (CustomUserControl)Loader.GetReferenceUserControl(userControlName);

            cu.Parameters = parameters;
            cu.Data       = extraData;
            cu.Parameter  = parameter;
            controls[0].Controls.Add(cu);
        }
Beispiel #2
0
        /// <summary>
        /// Cambio para cambios bajo costo
        /// </summary>
        /// <param name="zone"></param>
        /// <param name="uc"></param>
        /// <param name="userControlName"></param>
        /// <param name="parameter"></param>
        /// <param name="parameters"></param>
        public static void AddToPanelWithParameters(Zone zone, CustomUserControl uc, string userControlName, object parameter, object extraData, params string[] parameters)
        {
            Form frm = uc.ParentForm;

            AddToPanelWithParameters(zone, frm, userControlName, parameter, extraData, parameters);
        }
Beispiel #3
0
        public static void AddToPanel(Zone zone, CustomUserControl uc, string userControlName)
        {
            Form frm = uc.ParentForm;

            AddToPanel(zone, frm, userControlName);
        }
 public frmPreloading(CustomUserControl sender)
 {
     InitializeComponent();
     m_frmReference = sender;
 }