/// <summary>
        /// Extension method for selecting the first matching control (using the
        /// <see cref="FirstControlSelectionCommandBuilder{TControlSelector,TControlObject}"/>).
        /// </summary>
        public static TControlObject First <TControlSelector, TControlObject> (
            [NotNull] this IFluentControlSelector <TControlSelector, TControlObject> fluentControlSelector)
            where TControlSelector : IFirstControlSelector <TControlObject> where TControlObject : ControlObject
        {
            ArgumentUtility.CheckNotNull("fluentControlSelector", fluentControlSelector);

            return(fluentControlSelector.GetControl(new FirstControlSelectionCommandBuilder <TControlSelector, TControlObject>()));
        }
        /// <summary>
        /// Extension method for selecting a control by index (using the
        /// <see cref="IndexControlSelectionCommandBuilder{TControlSelector,TControlObject}"/>).
        /// </summary>
        public static TControlObject ByIndex <TControlSelector, TControlObject> (
            [NotNull] this IFluentControlSelector <TControlSelector, TControlObject> fluentControlSelector,
            int index)
            where TControlSelector : IIndexControlSelector <TControlObject> where TControlObject : ControlObject
        {
            ArgumentUtility.CheckNotNull("fluentControlSelector", fluentControlSelector);

            return(fluentControlSelector.GetControl(new IndexControlSelectionCommandBuilder <TControlSelector, TControlObject> (index)));
        }
        /// <summary>
        /// Extension method for selecting a control by item ID (using the
        /// <see cref="ItemIDControlSelectionCommandBuilder{TControlSelector,TControlObject}"/>).
        /// </summary>
        public static TControlObject ByItemID <TControlSelector, TControlObject> (
            [NotNull] this IFluentControlSelector <TControlSelector, TControlObject> fluentControlSelector,
            [NotNull] string itemID)
            where TControlSelector : IItemIDControlSelector <TControlObject> where TControlObject : ControlObject
        {
            ArgumentUtility.CheckNotNull("fluentControlSelector", fluentControlSelector);
            ArgumentUtility.CheckNotNullOrEmpty("itemID", itemID);

            return(fluentControlSelector.GetControl(new ItemIDControlSelectionCommandBuilder <TControlSelector, TControlObject> (itemID)));
        }
        /// <summary>
        /// Extension method for selecting a control by title (using the
        /// <see cref="TitleControlSelectionCommandBuilder{TControlSelector,TControlObject}"/>).
        /// </summary>
        public static TControlObject ByTitle <TControlSelector, TControlObject> (
            [NotNull] this IFluentControlSelector <TControlSelector, TControlObject> fluentControlSelector,
            [NotNull] string title)
            where TControlSelector : ITitleControlSelector <TControlObject> where TControlObject : ControlObject
        {
            ArgumentUtility.CheckNotNull("fluentControlSelector", fluentControlSelector);
            ArgumentUtility.CheckNotNullOrEmpty("title", title);

            return(fluentControlSelector.GetControl(new TitleControlSelectionCommandBuilder <TControlSelector, TControlObject> (title)));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Extension method for selecting a control by display name (using the
        /// <see cref="DisplayNameControlSelectionCommandBuilder{TControlSelector,TControlObject}"/>).
        /// </summary>
        public static TControlObject ByDisplayName <TControlSelector, TControlObject> (
            [NotNull] this IFluentControlSelector <TControlSelector, TControlObject> fluentControlSelector,
            [NotNull] string displayName)
            where TControlSelector : IDisplayNameControlSelector <TControlObject>
            where TControlObject : ControlObject
        {
            ArgumentUtility.CheckNotNull("fluentControlSelector", fluentControlSelector);
            ArgumentUtility.CheckNotNullOrEmpty("displayName", displayName);

            return(fluentControlSelector.GetControl(new DisplayNameControlSelectionCommandBuilder <TControlSelector, TControlObject> (displayName)));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Extension method for selecting a control by the domain property it represetns (using the
        /// <see cref="DomainPropertyControlSelectionCommandBuilder{TControlSelector,TControlObject}"/>).
        /// </summary>
        public static TControlObject ByDomainProperty <TControlSelector, TControlObject> (
            [NotNull] this IFluentControlSelector <TControlSelector, TControlObject> fluentControlSelector,
            [NotNull] string domainProperty,
            [CanBeNull] string domainClass = null)
            where TControlSelector : IDomainPropertyControlSelector <TControlObject>
            where TControlObject : ControlObject
        {
            ArgumentUtility.CheckNotNull("fluentControlSelector", fluentControlSelector);
            ArgumentUtility.CheckNotNullOrEmpty("domainProperty", domainProperty);
            ArgumentUtility.CheckNotEmpty("domainClass", domainClass);

            return(fluentControlSelector.GetControl(
                       new DomainPropertyControlSelectionCommandBuilder <TControlSelector, TControlObject> (domainProperty, domainClass)));
        }