コード例 #1
0
 /// <summary>
 /// Merges a CssCollection into this one.
 /// </summary>
 /// <param name="src">The source collection.</param>
 /// <param name="overwrite">If true, will overwrite attributes of the same name.</param>
 public void Merge(CssCollection src, bool overwrite)
 {
     foreach (string name in src)
     {
         if ((this[name] == null) || (overwrite))
         {
             Add(name, src[name]);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of a TabStrip.
 /// </summary>
 public TabStrip() : base()
 {
     _Items = new TabItemCollection(this);
     _CachedSelectedIndex = NotSet;
     _OldMultiPageIndex   = -1;
     _TabDefaultStyle     = new CssCollection();
     _TabHoverStyle       = new CssCollection();
     _TabSelectedStyle    = new CssCollection();
     _SepDefaultStyle     = new CssCollection();
     _SepHoverStyle       = new CssCollection();
     _SepSelectedStyle    = new CssCollection();
 }
コード例 #3
0
        /// <summary>
        /// Clones this collection.
        /// </summary>
        /// <returns>A copy of this collection.</returns>
        public virtual object Clone()
        {
            CssCollection col = (CssCollection)Activator.CreateInstance(this.GetType(), BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, new object[] { this }, null);

            col._bRenderFontTag   = this._bRenderFontTag;
            col._bRenderBoldTag   = this._bRenderBoldTag;
            col._bRenderItalicTag = this._bRenderItalicTag;

            col._IsTrackingViewState = this._IsTrackingViewState;
            col._Dirty = this._Dirty;

            col.ItemAdded   = this.ItemAdded;
            col.ItemRemoved = this.ItemRemoved;
            col.Cleared     = this.Cleared;

            return(col);
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of a CssCollection.
 /// </summary>
 /// <param name="col">A collection to initialize this collection with.</param>
 public CssCollection(CssCollection col) : base()
 {
     Merge(col, true);
 }
コード例 #5
0
 /// <summary>
 /// Called when an item is removed.
 /// </summary>
 /// <param name="c">The collection</param>
 /// <param name="e">Event arguments</param>
 private void OnRemove(CssCollection c, CssEventArgs e)
 {
     Style.Remove(e.Name);
 }
コード例 #6
0
 /// <summary>
 /// Called when an item is added.
 /// </summary>
 /// <param name="c">The collection</param>
 /// <param name="e">Event arguments</param>
 private void OnAdd(CssCollection c, CssEventArgs e)
 {
     Style.Add(e.Name, e.Value);
 }
コード例 #7
0
ファイル: TabItem.cs プロジェクト: jango2015/ComponentLibrary
 /// <summary>
 /// Initializes a new instance of a TabItem.
 /// </summary>
 public TabItem() : base()
 {
     _DefaultStyle  = new CssCollection();
     _HoverStyle    = new CssCollection();
     _SelectedStyle = new CssCollection();
 }