public Style Parse(string s) { if (s == null || s.Length == 0) { return(null); } styleStr = s.ToLower(); Clear(); try { AddParams(); Style style = new Style(); style.pen = sbPen.GetPen(); style.pen2 = sbPen2.GetPen(); style.brush = sbBrush.GetBrush(); style.imageStyle = sbImage.GetImageStyle(); style.textStyle = sbText.GetTextStyle(); style.extStyle = sbExt.GetExtStyle(); return(style.IsNull() ? null : style); } catch (Exception ex) { //!!! Log.Exception(ex); } return(null); }
public Brush GetBrush() { if (sbImage.Count > 0) { ImageStyle imageStyle = sbImage.GetImageStyle(); if (imageStyle != null) { return(GetTextureBrush(imageStyle)); } } if (Count == 0) { return(null); } if (HasKey("hs")) { return(GetHatchBrush()); } return(GetSolidBrush()); }