Esempio n. 1
0
 public void Remove(string key)
 {
     if (0 == String.Compare(key, StyleAttribute, true, Helpers.InvariantCulture))
     {
         CssStyle.Clear();
         return;
     }
     bag.Remove(key);
 }
 /// <devdoc>
 ///    <para>
 ///       Removes an attribute from the <see langword='AttributeCollection'/>.
 ///    </para>
 /// </devdoc>
 public void Remove(string key)
 {
     if (_styleColl != null && StringUtil.EqualsIgnoreCase(key, "style"))
     {
         _styleColl.Clear();
     }
     else
     {
         _bag.Remove(key);
     }
 }
        /// <devdoc>
        ///    <para>
        ///       Removes all styles from the <see langword='CssStyleCollection'/>.
        ///    </para>
        /// </devdoc>
        public void Clear()
        {
            _table    = null;
            _intTable = null;

            if (_state != null)
            {
                _state.Remove("style");
            }
            _style = null;
        }
Esempio n. 4
0
 /// <include file='doc\AttributeCollection.uex' path='docs/doc[@for="AttributeCollection.Remove"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Removes an attribute from the <see langword='AttributeCollection'/>.
 ///    </para>
 /// </devdoc>
 public void Remove(string key)
 {
     if (_styleColl != null && String.Compare(key, "style", true, CultureInfo.InvariantCulture) == 0)
     {
         _styleColl.Clear();
     }
     else
     {
         _bag.Remove(key);
     }
 }
Esempio n. 5
0
		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");
		}
Esempio n. 6
0
		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);
		}
Esempio n. 7
0
 void SetValueInternal(string value)
 {
     _value.Length = 0;
     if (value != null)
     {
         _value.Append(value);
     }
     if (bag != null)
     {
         if (value == null)
         {
             bag.Remove(AttributeCollection.StyleAttribute);
         }
         else
         {
             bag [AttributeCollection.StyleAttribute] = value;
         }
     }
 }
Esempio n. 8
0
 /// <include file='doc\CssStyleCollection.uex' path='docs/doc[@for="CssStyleCollection.Clear"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Removes all styles from the <see langword='CssStyleCollection'/>.
 ///    </para>
 /// </devdoc>
 public void Clear()
 {
     _table = null;
     _state.Remove("style");
 }
Esempio n. 9
0
 ///<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");
 }