<commit_before>using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;

namespace WeifenLuo.WinFormsUI.Docking
{
	internal class VS2005DockPaneStrip : DockPaneStripBase
	{
        private class TabVS2005 : Tab
        {
            public TabVS2005(IDockContent content)
                : base(content)
            {
            }

            private int m_tabX;
            public int TabX
            {
                get { return m_tabX; }
                set { m_tabX = value; }
            }

            private int m_tabWidth;
            public int TabWidth
            {
                get { return m_tabWidth; }
                set { m_tabWidth = value; }
            }

            private int m_maxWidth;
            public int MaxWidth
            {
                get { return m_maxWidth; }
                set { m_maxWidth = value; }
            }

            private bool m_flag;
            protected internal bool Flag
            {
                get { return m_flag; }
                set { m_flag = value; }
            }
        }

        protected internal override DockPaneStripBase.Tab CreateTab(IDockContent content)
        {
            return new TabVS2005(content);
        }

        private sealed class InertButton : InertButtonBase
        {
            private Bitmap m_image0, m_image1;

            public InertButton(Bitmap image0, Bitmap image1)
                : base()
            {
                m_image0 = image0;
                m_image1 = image1;
            }

            private int m_imageCategory = 0;
            public int ImageCategory
            {
                get { return m_imageCategory; }
                set
                {
                    if (m_imageCategory == value)
                        return;

                    m_imageCategory = value;
                    Invalidate();
                }
            }

            public override Bitmap Image
            {
                get { return ImageCategory == 0 ? m_image0 : m_image1; }
            }

            protected override void OnRefreshChanges()
            {
                if (VS2005DockPaneStrip.ColorDocumentActiveText != ForeColor)
                {
                    ForeColor = VS2005DockPaneStrip.ColorDocumentActiveText;
                    Invalidate();
                }
            }
        }

		#region consts
        private const int _ToolWindowStripGapTop = 0;
        private const int _ToolWindowStripGapBottom = 1;
		private const int _ToolWindowStripGapLeft = 0;
		private const int _ToolWindowStripGapRight = 0;
		private const int _ToolWindowImageHeight = 16;
		private const int _ToolWindowImageWidth = 16;
		private const int _ToolWindowImageGapTop = 3;
		private const int _ToolWindowImageGapBottom = 1;
		private const int _ToolWindowImageGapLeft = 2;
		private const int _ToolWindowImageGapRight = 0;
		private const int _ToolWindowTextGapRight = 3;
		private const int _ToolWindowTabSeperatorGapTop = 3;
		private const int _ToolWindowTabSeperatorGapBottom = 3;

        private const int _DocumentStripGapTop = 0;
        private const int _DocumentStripGapBottom = 1;
		private const int _DocumentTabMaxWidth = 200;
		private const int _DocumentButtonGapTop = 4;
		private const int _DocumentButtonGapBottom = 4;
		private const int _DocumentButtonGapBetween = 0;
		private const int _DocumentButtonGapRight = 3;
		private const int _DocumentTabGapTop = 3;
		private const int _DocumentTabGapLeft = 3;
		private const int _DocumentTabGapRight = 3;
        private const int _DocumentIconGapBottom = 2;
		private const int _DocumentIconGapLeft = 8;
        private const int _DocumentIconGapRight = 0;
		private const int _DocumentIconHeight = 16;
		private const int _DocumentIconWidth = 16;
        private const int _DocumentTextGapRight = 3;
		#endregion

        private static Bitmap _imageButtonClose;
        private static Bitmap ImageButtonClose
        {
            get
            {
                if (_imageButtonClose == null)
                    _imageButtonClose = Resources.DockPane_Close;

                return _imageButtonClose;
            }
        }

        private InertButton m_buttonClose;
        private InertButton ButtonClose
        {
            get
            {
                if (m_buttonClose == null)
                {
                    m_buttonClose = new InertButton(ImageButtonClose, ImageButtonClose);
                    m_toolTip.SetToolTip(m_buttonClose, ToolTipClose);
                    m_buttonClose.Click += new EventHandler(Close_Click);
                    Controls.Add(m_buttonClose);
                }

                return m_buttonClose;
            }
        }

        private static Bitmap _imageButtonWindowList;
        private static Bitmap ImageButtonWindowList
        {
            get
            {
                if (_imageButtonWindowList == null)
                    _imageButtonWindowList = Resources.DockPane_Option;

                return _imageButtonWindowList;
            }
        }

        private static Bitmap _imageButtonWindowListOverflow;
        private static Bitmap ImageButtonWindowListOverflow
        {
            get
            {
                if (_imageButtonWindowListOverflow == null)
                    _imageButtonWindowListOverflow = Resources.DockPane_OptionOverflow;

                return _imageButtonWindowListOverflow;
            }
        }

        private InertButton m_buttonWindowList;
        private InertButton ButtonWindowList
        {
            get
            {
                if (m_buttonWindowList == null)
                {
                    m_buttonWindowList = new InertButton(ImageButtonWindowList, ImageButtonWindowListOverflow);
                    m_toolTip.SetToolTip(m_buttonWindowList, ToolTipSelect);
                    m_buttonWindowList.Click += new EventHandler(WindowList_Click);
                    Controls.Add(m_buttonWindowList);
                }

                return m_buttonWindowList;
            }
        }

        private static GraphicsPath GraphicsPath
        {
            get { return VS2005AutoHideStrip.GraphicsPath; }
        }

		private IContainer m_components;
		private ToolTip m_toolTip;
		private IContainer Components
		{
			get	{	return m_components;	}
		}

		#region Customizable Properties
        private static int ToolWindowStripGapTop
        {
            get { return _ToolWindowStripGapTop; }
        }

        private static int ToolWindowStripGapBottom
        {
            get { return _ToolWindowStripGapBottom; }
        }

		private static int ToolWindowStripGapLeft
		{
			get	{	return _ToolWindowStripGapLeft;	}
		}

		private static int ToolWindowStripGapRight
		{
			get	{	return _ToolWindowStripGapRight;	}
		}

		private static int ToolWindowImageHeight
		{
			get	{	return _ToolWindowImageHeight;	}
		}

		private static int ToolWindowImageWidth
		{
			get	{	return _ToolWindowImageWidth;	}
		}

		private static int ToolWindowImageGapTop
		{
			get	{	return _ToolWindowImageGapTop;	}
		}

		private static int ToolWindowImageGapBottom
		{
			get	{	return _ToolWindowImageGapBottom;	}
		}

		private static int ToolWindowImageGapLeft
		{
			get	{	return _ToolWindowImageGapLeft;	}
		}

		private static int ToolWindowImageGapRight
		{
			get	{	return _ToolWindowImageGapRight;	}
		}

		private static int ToolWindowTextGapRight
		{
			get	{	return _ToolWindowTextGapRight;	}
		}

		private static int ToolWindowTabSeperatorGapTop
		{
			get	{	return _ToolWindowTabSeperatorGapTop;	}
		}

		private static int ToolWindowTabSeperatorGapBottom
		{
			get	{	return _ToolWindowTabSeperatorGapBottom;	}
		}

		private static string _toolTipClose;
		private static string ToolTipClose
		{
			get
			{	
				if (_toolTipClose == null)
					_toolTipClose = Strings.DockPaneStrip_ToolTipClose;
				return _toolTipClose;
			}
		}

		private static string _toolTipSelect;
		private static string ToolTipSelect
		{
			get
			{	
				if (_toolTipSelect == null)
					_toolTipSelect = Strings.DockPaneStrip_ToolTipWindowList;
				return _toolTipSelect;
			}
		}

		private TextFormatFlags ToolWindowTextFormat
		{
			get
            {	
                TextFormatFlags textFormat = TextFormatFlags.EndEllipsis |
                    TextFormatFlags.HorizontalCenter |
                    TextFormatFlags.SingleLine |
                    TextFormatFlags.VerticalCenter;
                if (RightToLeft == RightToLeft.Yes)
                    return textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right;
                else
                    return textFormat;
            }
		}

        private static int DocumentStripGapTop
        {
            get { return _DocumentStripGapTop; }
        }

        private static int DocumentStripGapBottom
        {
            get { return _DocumentStripGapBottom; }
        }

		private TextFormatFlags DocumentTextFormat
		{
        	get
            {	
                 TextFormatFlags textFormat = TextFormatFlags.PathEllipsis |
                    TextFormatFlags.SingleLine |
                    TextFormatFlags.VerticalCenter |
                    TextFormatFlags.PreserveGraphicsClipping |
                    TextFormatFlags.HorizontalCenter;
                 if (RightToLeft == RightToLeft.Yes)
                     return textFormat | TextFormatFlags.RightToLeft;
                 else
                     return textFormat;
            }
		}

		private static int DocumentTabMaxWidth
		{
			get	{	return _DocumentTabMaxWidth;	}
		}

		private static int DocumentButtonGapTop
		{<commit_msg>Bug Fix [1830402]: Content Tab titles are being cut off. Changed how the text is being drawn to include ellipses at the end.<commit_after>using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;

namespace WeifenLuo.WinFormsUI.Docking
{
	internal class VS2005DockPaneStrip : DockPaneStripBase
	{
        private class TabVS2005 : Tab
        {
            public TabVS2005(IDockContent content)
                : base(content)
            {
            }

            private int m_tabX;
            public int TabX
            {
                get { return m_tabX; }
                set { m_tabX = value; }
            }

            private int m_tabWidth;
            public int TabWidth
            {
                get { return m_tabWidth; }
                set { m_tabWidth = value; }
            }

            private int m_maxWidth;
            public int MaxWidth
            {
                get { return m_maxWidth; }
                set { m_maxWidth = value; }
            }

            private bool m_flag;
            protected internal bool Flag
            {
                get { return m_flag; }
                set { m_flag = value; }
            }
        }

        protected internal override DockPaneStripBase.Tab CreateTab(IDockContent content)
        {
            return new TabVS2005(content);
        }

        private sealed class InertButton : InertButtonBase
        {
            private Bitmap m_image0, m_image1;

            public InertButton(Bitmap image0, Bitmap image1)
                : base()
            {
                m_image0 = image0;
                m_image1 = image1;
            }

            private int m_imageCategory = 0;
            public int ImageCategory
            {
                get { return m_imageCategory; }
                set
                {
                    if (m_imageCategory == value)
                        return;

                    m_imageCategory = value;
                    Invalidate();
                }
            }

            public override Bitmap Image
            {
                get { return ImageCategory == 0 ? m_image0 : m_image1; }
            }

            protected override void OnRefreshChanges()
            {
                if (VS2005DockPaneStrip.ColorDocumentActiveText != ForeColor)
                {
                    ForeColor = VS2005DockPaneStrip.ColorDocumentActiveText;
                    Invalidate();
                }
            }
        }

		#region consts
        private const int _ToolWindowStripGapTop = 0;
        private const int _ToolWindowStripGapBottom = 1;
		private const int _ToolWindowStripGapLeft = 0;
		private const int _ToolWindowStripGapRight = 0;
		private const int _ToolWindowImageHeight = 16;
		private const int _ToolWindowImageWidth = 16;
		private const int _ToolWindowImageGapTop = 3;
		private const int _ToolWindowImageGapBottom = 1;
		private const int _ToolWindowImageGapLeft = 2;
		private const int _ToolWindowImageGapRight = 0;
		private const int _ToolWindowTextGapRight = 3;
		private const int _ToolWindowTabSeperatorGapTop = 3;
		private const int _ToolWindowTabSeperatorGapBottom = 3;

        private const int _DocumentStripGapTop = 0;
        private const int _DocumentStripGapBottom = 1;
		private const int _DocumentTabMaxWidth = 200;
		private const int _DocumentButtonGapTop = 4;
		private const int _DocumentButtonGapBottom = 4;
		private const int _DocumentButtonGapBetween = 0;
		private const int _DocumentButtonGapRight = 3;
		private const int _DocumentTabGapTop = 3;
		private const int _DocumentTabGapLeft = 3;
		private const int _DocumentTabGapRight = 3;
        private const int _DocumentIconGapBottom = 2;
		private const int _DocumentIconGapLeft = 8;
        private const int _DocumentIconGapRight = 0;
		private const int _DocumentIconHeight = 16;
		private const int _DocumentIconWidth = 16;
        private const int _DocumentTextGapRight = 3;
		#endregion

        private static Bitmap _imageButtonClose;
        private static Bitmap ImageButtonClose
        {
            get
            {
                if (_imageButtonClose == null)
                    _imageButtonClose = Resources.DockPane_Close;

                return _imageButtonClose;
            }
        }

        private InertButton m_buttonClose;
        private InertButton ButtonClose
        {
            get
            {
                if (m_buttonClose == null)
                {
                    m_buttonClose = new InertButton(ImageButtonClose, ImageButtonClose);
                    m_toolTip.SetToolTip(m_buttonClose, ToolTipClose);
                    m_buttonClose.Click += new EventHandler(Close_Click);
                    Controls.Add(m_buttonClose);
                }

                return m_buttonClose;
            }
        }

        private static Bitmap _imageButtonWindowList;
        private static Bitmap ImageButtonWindowList
        {
            get
            {
                if (_imageButtonWindowList == null)
                    _imageButtonWindowList = Resources.DockPane_Option;

                return _imageButtonWindowList;
            }
        }

        private static Bitmap _imageButtonWindowListOverflow;
        private static Bitmap ImageButtonWindowListOverflow
        {
            get
            {
                if (_imageButtonWindowListOverflow == null)
                    _imageButtonWindowListOverflow = Resources.DockPane_OptionOverflow;

                return _imageButtonWindowListOverflow;
            }
        }

        private InertButton m_buttonWindowList;
        private InertButton ButtonWindowList
        {
            get
            {
                if (m_buttonWindowList == null)
                {
                    m_buttonWindowList = new InertButton(ImageButtonWindowList, ImageButtonWindowListOverflow);
                    m_toolTip.SetToolTip(m_buttonWindowList, ToolTipSelect);
                    m_buttonWindowList.Click += new EventHandler(WindowList_Click);
                    Controls.Add(m_buttonWindowList);
                }

                return m_buttonWindowList;
            }
        }

        private static GraphicsPath GraphicsPath
        {
            get { return VS2005AutoHideStrip.GraphicsPath; }
        }

		private IContainer m_components;
		private ToolTip m_toolTip;
		private IContainer Components
		{
			get	{	return m_components;	}
		}

		#region Customizable Properties
        private static int ToolWindowStripGapTop
        {
            get { return _ToolWindowStripGapTop; }
        }

        private static int ToolWindowStripGapBottom
        {
            get { return _ToolWindowStripGapBottom; }
        }

		private static int ToolWindowStripGapLeft
		{
			get	{	return _ToolWindowStripGapLeft;	}
		}

		private static int ToolWindowStripGapRight
		{
			get	{	return _ToolWindowStripGapRight;	}
		}

		private static int ToolWindowImageHeight
		{
			get	{	return _ToolWindowImageHeight;	}
		}

		private static int ToolWindowImageWidth
		{
			get	{	return _ToolWindowImageWidth;	}
		}

		private static int ToolWindowImageGapTop
		{
			get	{	return _ToolWindowImageGapTop;	}
		}

		private static int ToolWindowImageGapBottom
		{
			get	{	return _ToolWindowImageGapBottom;	}
		}

		private static int ToolWindowImageGapLeft
		{
			get	{	return _ToolWindowImageGapLeft;	}
		}

		private static int ToolWindowImageGapRight
		{
			get	{	return _ToolWindowImageGapRight;	}
		}

		private static int ToolWindowTextGapRight
		{
			get	{	return _ToolWindowTextGapRight;	}
		}

		private static int ToolWindowTabSeperatorGapTop
		{
			get	{	return _ToolWindowTabSeperatorGapTop;	}
		}

		private static int ToolWindowTabSeperatorGapBottom
		{
			get	{	return _ToolWindowTabSeperatorGapBottom;	}
		}

		private static string _toolTipClose;
		private static string ToolTipClose
		{
			get
			{	
				if (_toolTipClose == null)
					_toolTipClose = Strings.DockPaneStrip_ToolTipClose;
				return _toolTipClose;
			}
		}

		private static string _toolTipSelect;
		private static string ToolTipSelect
		{
			get
			{	
				if (_toolTipSelect == null)
					_toolTipSelect = Strings.DockPaneStrip_ToolTipWindowList;
				return _toolTipSelect;
			}
		}

		private TextFormatFlags ToolWindowTextFormat
		{
			get
            {	
                TextFormatFlags textFormat = TextFormatFlags.EndEllipsis |
                    TextFormatFlags.HorizontalCenter |
                    TextFormatFlags.SingleLine |
                    TextFormatFlags.VerticalCenter;
                if (RightToLeft == RightToLeft.Yes)
                    return textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right;
                else
                    return textFormat;
            }
		}

        private static int DocumentStripGapTop
        {
            get { return _DocumentStripGapTop; }
        }

        private static int DocumentStripGapBottom
        {
            get { return _DocumentStripGapBottom; }
        }

		private TextFormatFlags DocumentTextFormat
		{
        	get
            {
                TextFormatFlags textFormat = TextFormatFlags.EndEllipsis |
                    TextFormatFlags.SingleLine |
                    TextFormatFlags.VerticalCenter |
                    TextFormatFlags.HorizontalCenter;
                if (RightToLeft == RightToLeft.Yes)
                    return textFormat | TextFormatFlags.RightToLeft;
                else
                    return textFormat;
            }
		}

		private static int DocumentTabMaxWidth
		{
			get	{	return _DocumentTabMaxWidth;	}
		}

		private static int DocumentButtonGapTop
		{
{'fraction_non_alphanumeric': 0.04886160143259145, 'fraction_numerical': 0.008135072908672296, 'mean_word_length': 1.7954805491990846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '514271', 'n_tokens_mistral': 5563, 'n_tokens_neox': 5047, 'n_words': 1207}