public static void SetGlobalStyle(string style) { // Make a copy of the collection since it may be referenced from context instances, // which don't expect the collection to change globalStyles = globalStyles.Add(style); NotifyGlobalStylesChanged(); }
public override void SetStyles(object backend, StyleSet styles) { var ctx = (VectorBackend)backend; ctx.Commands.Add(DrawingCommand.SetStyles); ctx.Objects.Add(styles); }
/// <summary> /// Creates a new image that is a copy of another image /// </summary> /// <param name="image">Image.</param> public Image(Image image) : base(image.Backend, image.ToolkitEngine) { NativeRef = image.NativeRef; requestedSize = image.requestedSize; requestedAlpha = image.requestedAlpha; styles = image.styles; Init(); }
public StyleSet AddRange(StyleSet styleSet) { if (styles == null) { return(styleSet); } return(AddRange(styleSet.styles)); }
public void ClearStyle(string style) { if (string.IsNullOrEmpty(style)) { throw new ArgumentException("style can't be empty"); } styles = styles.Remove(style); handler.SetStyles(Backend, styles); }
internal Context(object backend, Toolkit toolkit, ContextBackendHandler handler, bool getGlobalStyles = true) : base(backend, toolkit, handler) { this.handler = handler; if (getGlobalStyles) { styles = globalStyles; if (styles != StyleSet.Empty) { handler.SetStyles(Backend, styles); } } }
public void Restore() { handler.Restore(Backend); if (contextStack.Count > 0) { var info = contextStack.Pop(); globalAlpha = info.Alpha; if (styles != info.Styles) { styles = info.Styles; handler.SetStyles(Backend, styles); } } }
public void Restore() { handler.Restore(Backend); if (stackTop != null) { var info = stackTop; stackTop = stackTop.Previous; globalAlpha = info.Alpha; if (styles != info.Styles) { styles = info.Styles; handler.SetStyles(Backend, styles); } } }
public void SetStyle(string style) { if (string.IsNullOrEmpty(style)) { throw new ArgumentException("style can't be empty"); } if (style[0] == '!') { styles = styles.Remove(style.Substring(1)); } else { styles = styles.Add(style); } handler.SetStyles(Backend, styles); }
public bool Equals(StyleSet other) { if (other.styles == styles) { return(true); } if (other.styles == null || styles == null || other.styles.Length != styles.Length) { return(false); } for (int n = 0; n < styles.Length; n++) { if (styles [n] != other.styles [n]) { return(false); } } return(true); }
public static void ClearGlobalStyle(string style) { globalStyles = globalStyles.Remove(style); NotifyGlobalStylesChanged(); }
public void ClearAllStyles() { styles = StyleSet.Empty; handler.SetStyles(Backend, styles); }
internal void SetStyles(StyleSet styles) { this.styles = this.styles.AddRange(styles.Intersect(RegisteredStyles).ToArray()); handler.SetStyles(Backend, this.styles); }
internal void SetStyles(StyleSet styles) { this.styles = this.styles.AddRange(styles.Intersect(RegisteredStyles).ToArray()); this.styles = this.styles.RemoveAll(styles.Where(s => s.StartsWith("-", StringComparison.Ordinal)).Select(s => s.TrimStart('-')).ToArray()); handler.SetStyles(Backend, this.styles); }