/// <summary>シーケンス内の指定したインデックスにアクセス可能な場合、その位置へ移動する。</summary> /// <typeparam name="T"></typeparam> /// <param name="scroller"></param> /// <param name="index"></param> /// <returns></returns> public static ResultWithValue <IElementScroller <T> > TryMoveTo <T>(this IElementScroller <T> scroller, int index) { var cnt = index - scroller.CurrentIndex; if (scroller.CanMove(cnt)) { return(new ResultWithValue <IElementScroller <T> >(scroller.MoveTo(cnt))); } else { return(new ResultWithValue <IElementScroller <T> >(false, scroller)); } }