StateBag.Remove メソッドとは? わかりやすく解説

StateBag.Remove メソッド

StateBag オブジェクトから、指定したキーと値のペア削除します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

使用例使用例

Remove メソッド使用するコード例次に示します

Sub MovePiece(fromPosition As String,
 toPosition As String)
   Dim bag As StateBag = ViewState
   Dim piece As Object =
 bag(fromPosition)
   If Not (piece Is Nothing)
 Then
      bag.Remove(fromPosition)
      bag.Add(toPosition, piece)
      RenderBoard()
   Else
      Throw New InvalidPositionException("There
 is no game piece at the ""from""
 position.")
   End If
End Sub 'MovePiece
void MovePiece(string fromPosition, string
 toPosition) {
   StateBag bag = ViewState;
   object piece = bag[fromPosition];
   if (piece != null) {
      bag.Remove(fromPosition);
      bag.Add(toPosition, piece);
      RenderBoard();
   }
   else {
      throw new InvalidPositionException("There is no game
 piece at the \"from\" position."); 
   }
}
function MovePiece(fromPosition : String, toPosition : String)
 {
   var bag : StateBag = ViewState;
   var piece = bag[fromPosition];
   if (piece != null) {
      bag.Remove(fromPosition);
      bag.Add(toPosition, piece);
      RenderBoard();
   }
   else {
      throw new InvalidPositionException("There is no game
 piece at the \"from\" position."); 
   }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
StateBag クラス
StateBag メンバ
System.Web.UI 名前空間
Control.ViewState プロパティ
Clear
Item
Add



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

StateBag.Remove メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



StateBag.Remove メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS