public static void InternalValidateLayout(this IPanel panel)
    {
        if (m_ValidateLayoutMethod == null)
        {
            m_ValidateLayoutMethod = panel.GetType().GetMethod("ValidateLayout", BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public);
        }

        m_ValidateLayoutMethod.Invoke(panel, new object[] {});
    }
    public static GUIView  InternalGetGUIView(this IPanel panel)
    {
        if (m_OwnerPropertyInfo == null)
        {
            m_OwnerPropertyInfo = panel.GetType().GetProperty("ownerObject", BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public);
        }


        return((GUIView)m_OwnerPropertyInfo.GetValue(panel, new object[] {}));
    }
Beispiel #3
0
        /// <summary>
        /// Shows the specified panel as a dialog with
        /// the 'parent' panel as the parent of the dialog.
        /// If parent is null, if there is a panel currently
        /// active, it uses that as the parent
        /// </summary>
        /// <param name="parent">parent panel (can be null)</param>
        /// <param name="panel">panel to display</param>
        /// <returns>true on success</returns>
        public bool ShowDialog(IPanel parent, IPanel panel)
        {
            bool retVal = true;

            if (!(panel is Form))
            {
                return(false);
            }

            var form = (Form)panel;

            Log.Debug("showDialog " + form.Name + ", type: " + form.GetType());

            // if parent has not been specified, used the current form
            // as the parent and Show as Dialog.  If there is no current form, just
            // show.
            if (parent == null)
            {
                Log.Debug("parent passed is null");
                Log.IsNull("_currentForm ", _currentForm);
                Log.IsNull("_currentPanel ", _currentPanel);

                if (_currentForm is IPanel)
                {
                    Log.Debug("Showing as dialog child: " + panel.GetType() + ", parent: " + _currentForm.GetType());
                    retVal = show((IPanel)_currentForm, panel, DisplayModeTypes.Dialog);
                }
                else
                {
                    Log.Debug("Just showing " + form.GetType());
                    //retVal = Show(panel);
                    retVal = show(null, panel, DisplayModeTypes.Dialog);
                }
            }
            else
            {
                var parentForm = parent as Form;
                Log.Debug("showDialog parent: " + parentForm.Name + ", type: " + parentForm.GetType());
                retVal = show(parent, panel, DisplayModeTypes.Dialog);
            }

            return(retVal);
        }
Beispiel #4
0
        /// <summary>
        /// Shows the specified panel as a dialog with
        /// the 'parent' panel as the parent of the dialog.
        /// If parent is null, if there is a panel currently
        /// active, it uses that as the parent
        /// </summary>
        /// <param name="parent">parent panel (can be null)</param>
        /// <param name="panel">panel to display</param>
        /// <returns>true on success</returns>
        public bool ShowDialog(IPanel parent, IPanel panel)
        {
            bool retVal = true;

            if (!(panel is Form))
            {
                return false;
            }

            var form = (Form) panel;

            Log.Debug("showDialog " + form.Name + ", type: " + form.GetType());

            // if parent has not been specified, used the current form
            // as the parent and Show as Dialog.  If there is no current form, just
            // show.
            if (parent == null)
            {
                Log.Debug("parent passed is null");
                Log.IsNull("_currentForm ", _currentForm);
                Log.IsNull("_currentPanel ", _currentPanel);

                if (_currentForm is IPanel)
                {
                    Log.Debug("Showing as dialog child: " + panel.GetType() + ", parent: " + _currentForm.GetType());
                    retVal = show((IPanel) _currentForm, panel, true);
                }
                else
                {
                    Log.Debug("Just showing " + form.GetType());
                    retVal = Show(panel);
                }
            }
            else
            {
                var parentForm = parent as Form;
                Log.Debug("showDialog parent: " + parentForm.Name + ", type: " + parentForm.GetType());
                retVal = show(parent, panel, true);
            }

            return retVal;
        }