Exemplo n.º 1
0
        /// <summary>
		/// Returns copy of the item.
		/// </summary>
		public override BaseItem Copy()
		{
            Separator objCopy = new Separator(m_Name);
			this.CopyToItem(objCopy);
			return objCopy;
		}
Exemplo n.º 2
0
        protected override void OnStyleChanged()
        {
            if (this.EffectiveStyle == eDotNetBarStyle.Office2010 || this.EffectiveStyle == eDotNetBarStyle.Metro)
            {
                if (_WindowIcon == null)
                {
                    _IconSeparator = new Separator("sys_caption_separator");
                    _IconSeparator.SetSystemItem(true);
                    m_CaptionContainer.SubItems._Add(_IconSeparator, 0);
                    _WindowIcon = new SystemCaptionItem();
                    _WindowIcon.Name = "sys_caption_icon";
                    _WindowIcon.Enabled = false;
                    _WindowIcon.Style = this.Style;
                    _WindowIcon.IsSystemIcon = true;
                    _WindowIcon.QueryIconOnPaint = true;
                    m_CaptionContainer.SubItems._Add(_WindowIcon, 0);
                }
            }
            else if (this.EffectiveStyle == eDotNetBarStyle.Windows7)
            {
                if (_WindowIcon == null)
                {
                    _IconSeparator = new Separator("sys_caption_separator");
                    _IconSeparator.FixedSize = new Size(3, 12);
                    _IconSeparator.SetSystemItem(true);
                    m_CaptionContainer.SubItems._Add(_IconSeparator, 0);
                    _WindowIcon = new SystemCaptionItem();
                    _WindowIcon.Name = "sys_caption_icon";
                    _WindowIcon.Enabled = false;
                    _WindowIcon.Style = this.Style;
                    _WindowIcon.IsSystemIcon = true;
                    _WindowIcon.QueryIconOnPaint = true;
                    m_CaptionContainer.SubItems._Add(_WindowIcon, 0);
                }
            }
            else if(_WindowIcon!=null)
            {
                if (m_CaptionContainer.SubItems.Contains(_WindowIcon))
                    m_CaptionContainer.SubItems._Remove(_WindowIcon);
                _WindowIcon.Dispose();
                _WindowIcon = null;
                if (m_CaptionContainer.SubItems.Contains(_IconSeparator))
                    m_CaptionContainer.SubItems._Remove(_IconSeparator);
                _IconSeparator.Dispose();
                _IconSeparator = null;
            }

            base.OnStyleChanged();
        }