private void SetType(PatternType type) { _patternType = type; IPattern result = null; switch (type) { case PatternType.Gradient: result = new GradientPattern(); break; case PatternType.Line: break; case PatternType.Marker: break; case PatternType.Picture: result = new PicturePattern(); break; case PatternType.Simple: result = new SimplePattern(); break; } if (result != null) { result.Outline = _innerPattern.Outline; } _innerPattern = result; }
/// <summary> /// Sets the fill color of the top-most pattern. /// If the pattern is not a simple pattern, a simple pattern will be forced. /// </summary> /// <param name="color">The Color structure</param> public void SetFillColor(Color color) { if (_patterns == null) { return; } if (_patterns.Count == 0) { return; } ISimplePattern sp = _patterns[_patterns.Count - 1] as ISimplePattern; if (sp == null) { sp = new SimplePattern(); _patterns[_patterns.Count - 1] = sp; } sp.FillColor = color; }
/// <summary> /// Sets the fill color of the top-most pattern. /// If the pattern is not a simple pattern, a simple pattern will be forced. /// </summary> /// <param name="color">The Color structure.</param> public void SetFillColor(Color color) { if (Patterns == null) { return; } if (Patterns.Count == 0) { return; } if (Patterns[Patterns.Count - 1] is not ISimplePattern sp) { sp = new SimplePattern(); Patterns[Patterns.Count - 1] = sp; } sp.FillColor = color; }
/// <summary> /// Sets the fill color of the top-most pattern. /// If the pattern is not a simple pattern, a simple pattern will be forced. /// </summary> /// <param name="color">The Color structure</param> public void SetFillColor(Color color) { if (_patterns == null) return; if (_patterns.Count == 0) return; ISimplePattern sp = _patterns[_patterns.Count - 1] as ISimplePattern; if (sp == null) { sp = new SimplePattern(); _patterns[_patterns.Count - 1] = sp; } sp.FillColor = color; }
private void SetType(PatternType type) { _patternType = type; IPattern result = null; switch (type) { case PatternType.Gradient: result = new GradientPattern(); break; case PatternType.Line: break; case PatternType.Marker: break; case PatternType.Picture: result = new PicturePattern(); break; case PatternType.Simple: result = new SimplePattern(); break; } if (result != null) result.Outline = _innerPattern.Outline; _innerPattern = result; }