本文整理匯總了C#中System.Web.UI.StateBag.Remove方法的典型用法代碼示例。如果您正苦於以下問題:C# StateBag.Remove方法的具體用法?C# StateBag.Remove怎麽用?C# StateBag.Remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.UI.StateBag
的用法示例。
在下文中一共展示了StateBag.Remove方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IDictionary_Deny_Unrestricted
public void IDictionary_Deny_Unrestricted ()
{
IDictionary d = new StateBag ();
d.Add ("key", "value");
Assert.IsTrue (d.Contains ("key"), "Contains");
Assert.AreEqual (1, d.Count, "Count");
d.Remove ("key");
d["key"] = "value";
Assert.AreEqual ("value", d["key"], "this[string]");
d.Clear ();
Assert.IsFalse (d.IsFixedSize, "IsFixedSize");
Assert.IsFalse (d.IsReadOnly, "IsReadOnly");
ICollection c = (d as ICollection);
Assert.IsFalse (c.IsSynchronized, "IsSynchronized");
Assert.IsNotNull (c.SyncRoot, "SyncRoot");
}
示例2: Deny_Unrestricted
public void Deny_Unrestricted ()
{
StateBag bag = new StateBag (true);
Assert.IsNotNull (bag.Add ("key", "value"), "Add");
Assert.AreEqual (1, bag.Count, "Count");
Assert.IsNotNull (bag.GetEnumerator (), "GetEnumerator");
bag.SetItemDirty ("key", true);
Assert.IsTrue (bag.IsItemDirty ("key"), "IsItemDirty");
bag.Remove ("key");
bag.Clear ();
bag["key"] = "value";
Assert.IsNotNull (bag["key"], "this[string]");
Assert.IsNotNull (bag.Keys, "Keys");
Assert.IsNotNull (bag.Values, "Values");
bag.SetDirty (true);
}
示例3: ClearSortArrowState
///<summary>
///Removes any state maintaining objects that are used to track sort orders in the gridview CreateSortArrows method
///</summary>
///<param name="viewState"></param>
///<remarks></remarks>
public static void ClearSortArrowState(StateBag viewState)
{
viewState.Remove("EntitySortProperty");
viewState.Remove("EntitySortDirection");
}