/// <summary> /// Search by CommandParameter from ButtonBase collection. /// </summary> /// <typeparam name="T">Type of collection.</typeparam> /// <param name="collection">ButtonBase collection.</param> /// <param name="commandParameter">Command parameter.</param> /// <returns>Hit elements.</returns> #else /// <summary> /// コマンドパラメータから要素を検索。 /// </summary> /// <typeparam name="T">コレクションのタイプ。</typeparam> /// <param name="collection">DependencyObjectのコレクション。</param> /// <param name="commandParameter">コマンドパラメータ。</param> /// <returns>ヒットした要素。</returns> #endif public static IEnumerable <T> ByCommandParameter <T>(IEnumerable <T> collection, object commandParameter) where T : ButtonBase { return(CastUtility.CastList <DependencyObject, T>(ByCommandParameterCore(CastUtility.CastList <T, DependencyObject>(collection), commandParameter))); }
/// <summary> /// Search by Command from ButtonBase collection. /// </summary> /// <typeparam name="T">Type of collection.</typeparam> /// <param name="collection">ButtonBase collection.</param> /// <param name="command">Command.</param> /// <returns>Hit elements.</returns> #else /// <summary> /// コマンドから要素を検索。 /// </summary> /// <typeparam name="T">コレクションのタイプ。</typeparam> /// <param name="collection">DependencyObjectのコレクション。</param> /// <param name="command">コマンド。</param> /// <returns>ヒットした要素。</returns> #endif public static IEnumerable <T> ByCommand <T>(IEnumerable <T> collection, ICommand command) where T : ButtonBase { return(CastUtility.CastList <DependencyObject, T>(ByCommandCore(CastUtility.CastList <T, DependencyObject>(collection), command))); }
/// <summary> /// Search by Text from TextBlock collection. /// </summary> /// <typeparam name="T">Type of collection.</typeparam> /// <param name="collection">TextBlock collection.</param> /// <param name="contentText">Content text.</param> /// <returns>Hit elements.</returns> #else /// <summary> /// Textから要素を検索。 /// </summary> /// <typeparam name="T">コレクションのタイプ。</typeparam> /// <param name="collection">DependencyObjectのコレクション。</param> /// <param name="contentText">文字列。</param> /// <returns>ヒットした要素。</returns> #endif public static IEnumerable <T> ByText <T>(IEnumerable <T> collection, string contentText) where T : TextBlock { return(CastUtility.CastList <DependencyObject, T>(ByTextCore(CastUtility.CastList <T, DependencyObject>(collection), contentText))); }
/// <summary> /// Search by flag of IsCancel. /// </summary> /// <typeparam name="T">Type of collection.</typeparam> /// <param name="collection">ButtonBase collection.</param> /// <returns>Hit elements.</returns> #else /// <summary> /// IsCancelフラグが立っているボタンを検索。 /// </summary> /// <typeparam name="T">コレクションのタイプ。</typeparam> /// <param name="collection">DependencyObjectのコレクション。</param> /// <returns>ヒットした要素。</returns> #endif public static IEnumerable <T> ByIsCancel <T>(IEnumerable <T> collection) where T : Button { return(CastUtility.CastList <DependencyObject, T>(ByIsCancelCore(CastUtility.CastList <T, DependencyObject>(collection)))); }
/// <summary> /// Search by Name from FrameworkElement collection. /// </summary> /// <typeparam name="T">Type of collection.</typeparam> /// <param name="collection">FrameworkElement collection.</param> /// <param name="name">Name.</param> /// <returns>Hit elements.</returns> #else /// <summary> /// 名前から要素を検索。 /// </summary> /// <typeparam name="T">コレクションのタイプ。</typeparam> /// <param name="collection">FrameworkElementのコレクション。</param> /// <param name="name">名前。</param> /// <returns>ヒットした要素。</returns> #endif public static IEnumerable <T> ByName <T>(IEnumerable <T> collection, string name) where T : FrameworkElement { return(CastUtility.CastList <DependencyObject, T>(ByNameCore(CastUtility.CastList <T, DependencyObject>(collection), name))); }