예제 #1
0
            /// <summary>
            /// Creates a new instance of the
            /// <see cref="YaTabPage.ControlCollection"/> class with
            /// the specified <i>owner</i>.
            /// </summary>
            /// <param name="owner">
            /// The <see cref="YaTabPage"/> that owns this collection.
            /// </param>
            /// <exception cref="ArgumentNullException">
            /// Thrown if <i>owner</i> is <b>null</b>.
            /// </exception>
            /// <exception cref="ArgumentException">
            /// Thrown if <i>owner</i> is not a <see cref="YaTabPage"/>.
            /// </exception>
            public ControlCollection(Control owner) : base(owner)
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner", "Tried to create a YaTabPage.ControlCollection with a null owner.");
                }
                YaTabPage c = owner as YaTabPage;

                if (c == null)
                {
                    throw new ArgumentException("Tried to create a YaTabPage.ControlCollection with a non-YaTabPage owner.", "owner");
                }
            }
예제 #2
0
            /// <summary>
            /// Overridden. Adds a <see cref="Control"/> to the
            /// <see cref="YaTabPage"/>.
            /// </summary>
            /// <param name="value">
            /// The <see cref="Control"/> to add, which must not be a
            /// <see cref="YaTabPage"/>.
            /// </param>
            /// <exception cref="ArgumentNullException">
            /// Thrown if <i>value</i> is <b>null</b>.
            /// </exception>
            /// <exception cref="ArgumentException">
            /// Thrown if <i>value</i> is a <see cref="YaTabPage"/>.
            /// </exception>
            public override void Add(Control value)
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value", "Tried to add a null value to the YaTabPage.ControlCollection.");
                }
                YaTabPage p = value as YaTabPage;

                if (p != null)
                {
                    throw new ArgumentException("Tried to add a YaTabPage control to the YaTabPage.ControlCollection.", "value");
                }
                base.Add(value);
            }
예제 #3
0
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 'NewTabEventArgs.NewTabEventArgs(YaTabPage)'
        public NewTabEventArgs(YaTabPage newTab)
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 'NewTabEventArgs.NewTabEventArgs(YaTabPage)'
        {
            NewTab = newTab;
        }
 /// <summary>
 /// Adds a "NEW_TAB" at the end of the list of tabs.
 /// </summary>
 public YaTabPage AddNewTab()
 {
     var newTab = new YaTabPage();
     newTab.Tag = "NEW_TAB";
     newTab.ImageIndex = -1;
     newTab.Text = "+";
     this.Controls.Add(newTab);
     return newTab;
 }
 /// <summary>
 /// Overridden. Inherited from <see cref="Control"/>.
 /// </summary>
 /// <param name="cea">
 /// See <see cref="Control.OnControlRemoved(ControlEventArgs)"/>.
 /// </param>
 protected override void OnControlRemoved(ControlEventArgs cea)
 {
     cea.Control.TextChanged -= ChildTextChangeEventHandler;
     try
     {
         cea.Control.Dispose();
     }
     catch { }
     base.OnControlRemoved(cea);
     if (Controls.Count > 0)
     {
         yaSelectedIndex = 0;
         yaSelectedTab.Visible = false;
         yaSelectedTab = (YaTabPage)Controls[0];
         yaSelectedTab.Visible = true;
     }
     else
     {
         yaSelectedIndex = -1;
         yaSelectedTab = null;
     }
     CalculateTabLengths();
     CalculateLastVisibleTabIndex();
     InU();
 }
 /// <summary>
 /// Overridden. Inherited from <see cref="Control"/>.
 /// </summary>
 /// <param name="cea">
 /// See <see cref="Control.OnControlAdded(ControlEventArgs)"/>.
 /// </param>
 protected override void OnControlAdded(ControlEventArgs cea)
 {
     base.OnControlAdded(cea);
     cea.Control.Visible = false;
     if (yaSelectedIndex == -1)
     {
         yaSelectedIndex = 0;
         yaSelectedTab = (YaTabPage)cea.Control;
         yaSelectedTab.Visible = true;
     }
     cea.Control.TextChanged += ChildTextChangeEventHandler;
     CalculateTabLengths();
     CalculateLastVisibleTabIndex();
     InU();
 }
예제 #7
0
 public NewTabEventArgs(YaTabPage newTab)
 {
     NewTab = newTab;
 }
 public NewTabEventArgs(YaTabPage newTab)
 {
     NewTab = newTab;
 }