コード例 #1
0
        /// <summary>
        /// Finds the control object from the descendants of this control using the specified
        /// search configuration.
        /// </summary>
        /// <typeparam name="TControl">The type of control to find.</typeparam>
        /// <param name="searchConfiguration">The search configuration.</param>
        /// <exception cref="InvalidSearchPropertyNamesException">
        /// Search configuration contains a property namely that isn't applicable on the control.
        /// </exception>
        public TControl Find <TControl>(By searchConfiguration = null) where TControl : ControlBase
        {
            var control = ControlBaseFactory.Create <TControl>(searchConfiguration);

            control.SourceControl.Container = sourceControl;
            return(control);
        }
コード例 #2
0
ファイル: ControlBase.cs プロジェクト: Rimpy369/cuite
        /// <summary>
        /// Gets the CUITe UI control object from the descendants of this control using the search parameters are passed.
        /// You don't have to create the object repository entry for this.
        /// </summary>
        /// <typeparam name="T">Pass the CUITe control you are looking for.</typeparam>
        /// <param name="searchParameters">In 'Key1=Value1;Key2=Value2' format. For example 'Id=firstname'
        /// or use '~' for Contains such as 'Id~first'</param>
        /// <returns>CUITe control object</returns>
        public TControl Get <TControl>(string searchParameters) where TControl : IControlBase
        {
            TControl control       = ControlBaseFactory.Create <TControl>(searchParameters);
            var      sourceControl = Activator.CreateInstance(control.SourceType, UnWrap());

            control.Wrap(sourceControl);
            return(control);
        }