示例#1
0
        public bool GetMethodInfo(string strMethode, ref MethodInfo methode, ref object objetSource)
        {
            if (m_controleWnd != null)
            {
                Type       tp   = null;
                MethodInfo info = null;
                if (m_controleWnd.Control != null)
                {
                    tp = m_controleWnd.Control.GetType();
                    try
                    {
                        info = tp.GetMethod(strMethode);
                    }
                    catch { }
                    if (info != null)
                    {
                        methode     = info;
                        objetSource = m_controleWnd.Control;
                        return(true);
                    }
                }
                tp   = m_controleWnd.GetType();
                info = tp.GetMethod(strMethode);
                if (info != null)
                {
                    methode     = info;
                    objetSource = m_controleWnd;
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        //------------------------------------------------------------
        public void SetError(string strErreur)
        {
            if (m_controleWnd == null)
            {
                return;
            }
            Control ctrl = m_controleWnd.Control;
            IControleWndFor2iWnd ctrlWnd = m_controleWnd;

            while (ctrlWnd != null && !typeof(IWndErrorProvider).IsAssignableFrom(ctrlWnd.GetType()))
            {
                ctrlWnd = ctrlWnd.WndContainer as IControleWndFor2iWnd;
            }
            IWndErrorProvider provider = ctrlWnd as IWndErrorProvider;

            if (provider != null && provider.ErrorProvider != null)
            {
                provider.ErrorProvider.SetError(ctrl, strErreur);
            }
        }