Exemplo n.º 1
0
		/// <summary>
		/// Makes a copy of the ItemStyle object.
		/// </summary>
		/// <returns>New Instance of a ItemStyle object</returns>
		public object Clone()
		{
			ItemStyle copy=new ItemStyle();
			copy.Alignment=this.Alignment;
			copy.BackColor1.SetColor(this.BackColor1.Color);
			copy.BackColor1.Alpha=this.BackColor1.Alpha;
			copy.BackColor1.SetColorSchemePart(this.BackColor1.ColorSchemePart);
			copy.BackColor2.SetColor(this.BackColor2.Color);
			copy.BackColor2.Alpha=this.BackColor2.Alpha;
			copy.BackColor2.SetColorSchemePart(this.BackColor2.ColorSchemePart);
			if(this.BackgroundImage!=null)
				copy.BackgroundImage=this.BackgroundImage.Clone() as System.Drawing.Image;
			copy.BackgroundImageAlpha=this.BackgroundImageAlpha;
			copy.BackgroundImagePosition=this.BackgroundImagePosition;
			copy.Border=this.Border;
			copy.BorderDashStyle=this.BorderDashStyle;
			copy.BorderColor.SetColor(this.BorderColor.Color);
			copy.BorderColor.Alpha=this.BorderColor.Alpha;
			copy.BorderColor.SetColorSchemePart(this.BorderColor.ColorSchemePart);
			copy.BorderWidth=this.BorderWidth;
			if(this.Font!=null)
				copy.Font=this.Font.Clone() as Font;
			copy.ForeColor.SetColor(this.ForeColor.Color);
			copy.ForeColor.Alpha=this.ForeColor.Alpha;
			copy.ForeColor.SetColorSchemePart(this.ForeColor.ColorSchemePart);
			copy.GradientAngle=this.GradientAngle;
			copy.LineAlignment=this.LineAlignment;
			copy.BorderSide=this.BorderSide;
			copy.TextTrimming=this.TextTrimming;
			copy.WordWrap=this.WordWrap;
			copy.Custom=this.Custom;
			copy.MarginBottom=this.MarginBottom;
			copy.MarginLeft=this.MarginLeft;
			copy.MarginRight=this.MarginRight;
			copy.MarginTop=this.MarginTop;
			copy.CornerType=this.CornerType;
			copy.CornerDiameter=this.CornerDiameter;
            copy.VerticalText = this.VerticalText;
            copy.UseMnemonic = _UseMnemonic;
			return copy;
		}
Exemplo n.º 2
0
		internal void SetHeaderSideMouseDownStyle(ItemStyle style)
		{
			if(m_HeaderSideMouseDownStyle!=null)
				m_HeaderSideMouseDownStyle.VisualPropertyChanged-=new EventHandler(this.VisualPropertyChanged);
			m_HeaderSideMouseDownStyle=style;
			if(m_HeaderSideMouseDownStyle!=null)
				m_HeaderSideMouseDownStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged);
		}
Exemplo n.º 3
0
		internal void SetBackgroundStyle(ItemStyle newStyle)
		{
			if(m_BackgroundStyle!=null)
				m_BackgroundStyle.VisualPropertyChanged-=new EventHandler(this.VisualPropertyChanged);
			m_BackgroundStyle=newStyle;
			if(m_BackgroundStyle!=null)
				m_BackgroundStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged);
		}
Exemplo n.º 4
0
		public void ResetBackgroundStyle()
		{
			m_BackgroundStyle.VisualPropertyChanged-=new EventHandler(this.VisualPropertyChanged);
			m_BackgroundStyle=new ItemStyle();
			m_BackgroundStyle.VisualPropertyChanged+=new EventHandler(this.VisualPropertyChanged);
		}
Exemplo n.º 5
0
		internal void ApplyStyle(ItemStyle style)
		{
			if(style==null)
				return;

			m_Alignment=style.Alignment;
			if(!style.BackColor1.IsEmpty)
				m_BackColor1=style.BackColor1;
			if(!style.BackColor2.IsEmpty)
				m_BackColor2=style.BackColor2;
			if(style.BackgroundImage!=null)
                m_BackgroundImage=style.BackgroundImage;
			if(style.BackgroundImageAlpha!=255)
				m_BackgroundImageAlpha=style.BackgroundImageAlpha;
			if(style.BackgroundImagePosition!=eBackgroundImagePosition.Stretch)
				m_BackgroundImagePosition=style.BackgroundImagePosition;
			if(style.Border!=eBorderType.None)
				m_Border=style.Border;
			if(style.BorderDashStyle!=DashStyle.Solid)
				m_BorderDashStyle=style.BorderDashStyle;
			if(!style.BorderColor.IsEmpty)
				m_BorderColor=style.BorderColor;
			if(style.BorderSide!=DEFAULT_BORDERSIDE)
				m_BorderSide=style.BorderSide;
			if(style.BorderWidth!=1)
				m_BorderWidth=style.BorderWidth;
			if(style.Font!=null)
				m_Font=style.Font;
			if(!style.ForeColor.IsEmpty)
				m_ForeColor=style.ForeColor;
			if(style.LineAlignment!=StringAlignment.Center)
				m_LineAlignment=style.LineAlignment;
			if(style.TextTrimming!=StringTrimming.EllipsisCharacter)
				m_TextTrimming=style.TextTrimming;
			if(style.WordWrap!=false)
				m_WordWrap=style.WordWrap;
			if(style.MarginBottom!=0)
				m_MarginBottom=style.MarginBottom;
			if(style.MarginLeft!=0)
				m_MarginLeft=style.MarginLeft;
			if(style.MarginRight!=0)
				m_MarginRight=style.MarginRight;
			if(style.MarginTop!=0)
				m_MarginTop=style.MarginTop;
            if(style.CornerType!=eCornerType.Square)
				m_CornerType=style.CornerType;
			if(style.CornerDiameter!=DEFAULT_CORNER_DIAMETER)
				m_CornerDiameter=style.CornerDiameter;
            if (style.VerticalText)
                m_VerticalText = style.VerticalText;
            if (!style.UseMnemonic)
                _UseMnemonic = style.UseMnemonic;
		}
Exemplo n.º 6
0
		/// <summary>
		///     Resets the style to it's default value.
		/// </summary>
		public void ResetStyleMouseDown()
		{
            if (m_StyleMouseDown != null) m_StyleMouseDown.VisualPropertyChanged -= new EventHandler(this.OnVisualPropertyChanged);
			m_StyleMouseDown=new ItemStyle();
			m_StyleMouseDown.VisualPropertyChanged+=new EventHandler(this.OnVisualPropertyChanged);
		}
Exemplo n.º 7
0
		/// <summary>
		///     Resets the style to it's default value.
		/// </summary>
		public void ResetStyle()
		{
            if (m_Style != null) m_Style.VisualPropertyChanged -= new EventHandler(this.OnVisualPropertyChanged);
			// Set default style
			m_Style=new ItemStyle();			
			m_Style.VisualPropertyChanged+=new EventHandler(this.OnVisualPropertyChanged);
			RefreshStyleSystemColors();
		}