コード例 #1
0
ファイル: Page.cs プロジェクト: sjhill01/Plugin-SDK
 /// <summary>
 /// Get the view with a specific ID from a collection cast as the target type
 /// </summary>
 /// <param name="viewId">The ID of the view to get</param>
 /// <returns>
 /// The view with the specified ID cast as the target type.
 /// </returns>
 /// <exception cref="ArgumentNullException">An invalid view ID was entered</exception>
 /// <exception cref="ArgumentException">No views are on the page to get</exception>
 /// <exception cref="IndexOutOfRangeException">The ID was found, but the view was not.  The page is probably malformed and should be recreated.</exception>
 /// <exception cref="KeyNotFoundException">No views with that ID were found</exception>
 public TViewType GetViewById <TViewType>(string viewId) where TViewType : AbstractView
 {
     return(ViewCollectionHelper.GetViewById <TViewType>(viewId, ref _views, ref _viewIds));
 }
コード例 #2
0
ファイル: Page.cs プロジェクト: sjhill01/Plugin-SDK
 /// <summary>
 /// Get the view on the page with the given ID
 /// </summary>
 /// <param name="viewId">The ID of the view to get</param>
 /// <returns>
 /// The view with the specified ID as an <see cref="AbstractView"/>.
 /// This should be cast to the appropriate view type before use.
 /// </returns>
 /// <exception cref="ArgumentNullException">An invalid view ID was entered</exception>
 /// <exception cref="ArgumentException">No views are on the page to get</exception>
 /// <exception cref="IndexOutOfRangeException">The ID was found, but the view was not.  The page is probably malformed and should be recreated.</exception>
 /// <exception cref="KeyNotFoundException">No views with that ID were found</exception>
 public AbstractView GetViewById(string viewId)
 {
     return(ViewCollectionHelper.GetViewById(viewId, ref _views, ref _viewIds));
 }