public static bool TrySetGlobalProperty <T>(ref GlobalStyle style, string name, T value) { if (style == null) { style = new GlobalStyle(); } return(TrySetGlobalProperty(style, name, value)); }
public void TestGlobalStyle() { var obj = new _GlobalStyleFrontEndExample(); Assert.IsTrue(GlobalStyle.TrySetGlobalProperty(obj, GlobalStyle.COLOR, ColorStyle.Red)); Assert.IsTrue(GlobalStyle.TryGetGlobalProperty <ColorStyle>(obj, GlobalStyle.COLOR, out var color)); Assert.AreEqual(ColorStyle.Red, color); }
public GlobalStyle Clone() { var clone = new GlobalStyle(); if (this._Properties == null) { return(clone); } clone._Properties = new Dictionary <string, object>(); foreach (var kvp in this._Properties) { clone._Properties[kvp.Key] = kvp.Value; } return(clone); }
bool GlobalStyle.ISource.TryGetGlobalProperty <T>(string name, out T value) { return(GlobalStyle.TryGetGlobalProperty(_GlobalStyles, name, out value)); }
bool GlobalStyle.ISource.TrySetGlobalProperty <T>(string name, T value) { return(GlobalStyle.TrySetGlobalProperty(ref _GlobalStyles, name, value)); }