StateBag.Remove メソッド
アセンブリ: System.Web (system.web.dll 内)
構文
使用例
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."); } }
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- StateBag.Remove メソッドのページへのリンク