예제 #1
0
파일: Window.cs 프로젝트: llenroc/CSRoot
        public List <IWinControl> GetControls(Type controltype)
        {
            try
            {
                IWinForm           form          = m_ClientChannel.GetWindow(m_WindowHandle);
                List <IWinControl> controlProxys = form.GetControls(controltype);
                if (controlProxys == null || controlProxys.Count == 0)
                {
                    return(null);
                }
                List <IWinControl> surrogateControls = new List <IWinControl>();
                foreach (IWinControl item in controlProxys)
                {
                    IWinControl surrogateControl = new SurrogateControl(item);
                    surrogateControls.Add(surrogateControl);
                }

                return(surrogateControls);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(null);
            }
        }
예제 #2
0
파일: Window.cs 프로젝트: llenroc/CSRoot
        public IWinControl GetControl(string controlId, Type controltype)
        {
            try
            {
                IWinForm    form         = m_ClientChannel.GetWindow(m_WindowHandle);
                IWinControl controlProxy = form.GetControl(controlId, controltype);
                if (controlProxy == null)
                {
                    return(null);
                }
                IWinControl surrogateControl = new SurrogateControl(controlProxy);

                return(surrogateControl);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(null);
            }
        }