tabseparator.cs

来自「浏览器端看到树型目录结构,用户可以完整地看到像windows资源管理器一样的效果」· CS 代码 · 共 66 行

CS
66
字号
//------------------------------------------------------------------------------
// Copyright (c) 2000-2003 Microsoft Corporation. All Rights Reserved.
//------------------------------------------------------------------------------

namespace Microsoft.Web.UI.WebControls
{
    using System;
    using System.ComponentModel;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    /// <summary>
    /// Represents a separator within a TabStrip.
    /// </summary>
    public class TabSeparator : TabItem
    {
        /// <summary>
        /// Separators are active when they are next to a selected tab.
        /// </summary>
        internal override bool Active
        {
            get
            {
                TabStrip parent = ParentTabStrip;
                if (parent == null)
                {
                    return false;
                }

                int nIndex = parent.Items.IndexOf(this);
                if (nIndex > 0)
                {
                    // Look at the item to the left
                    TabItem item = parent.Items[nIndex - 1];
                    if ((item != null) && (item is Tab) && ((Tab)item).Active)
                    {
                        // If the item is a tab and is active, then the separator is active
                        return true;
                    }
                }

                if (nIndex < (parent.Items.Count - 1))
                {
                    // Look at the item to the right
                    TabItem item = parent.Items[nIndex + 1];
                    if ((item != null) && (item is Tab) && ((Tab)item).Active)
                    {
                        // If the item is a tab and is active, then the separator is active
                        return true;
                    }
                }

                return false;
            }
        }

        /// <summary>
        /// The uplevel tag name for the tab item.
        /// </summary>
        protected override string UpLevelTag
        {
            get { return TabStrip.TabSeparatorTagName; }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?