/// <summary> /// Try to apply the symbol size group style. Returns true if successfull applied. /// </summary> /// <param name="externalGroups"></param> /// <param name="localGroups"></param> /// <param name="setter">A function of the plot style that takes the symbol size evaluation function.</param> /// <returns>True if successfully applied, false otherwise.</returns> public static bool ApplyStyle( IPlotGroupStyleCollection externalGroups, IPlotGroupStyleCollection localGroups, Action <Func <int, Color> > setter) { VariableColorGroupStyle grpStyle = null; IPlotGroupStyleCollection grpColl = null; if (externalGroups.ContainsType(MyType)) { grpColl = externalGroups; } else if (localGroups != null && localGroups.ContainsType(MyType)) { grpColl = localGroups; } if (null != grpColl) { grpStyle = (VariableColorGroupStyle)grpColl.GetPlotGroupStyle(MyType); grpColl.OnBeforeApplication(MyType); setter(grpStyle._colorForIndex); return(true); } else { return(false); } }
public static void PrepareStyle( IPlotGroupStyleCollection externalGroups, IPlotGroupStyleCollection localGroups, Func <int, Color> getter) { if (!externalGroups.ContainsType(MyType) && null != localGroups && !localGroups.ContainsType(MyType)) { localGroups.Add(new VariableColorGroupStyle()); } VariableColorGroupStyle grpStyle = null; if (externalGroups.ContainsType(typeof(SymbolSizeGroupStyle))) { grpStyle = (VariableColorGroupStyle)externalGroups.GetPlotGroupStyle(MyType); } else if (localGroups != null) { grpStyle = (VariableColorGroupStyle)localGroups.GetPlotGroupStyle(MyType); } if (grpStyle != null && getter != null && !grpStyle.IsInitialized) { grpStyle.Initialize(getter); } }
public VariableColorGroupStyle(VariableColorGroupStyle from) { this._isInitialized = from._isInitialized; this._colorForIndex = from._colorForIndex; }
public VariableColorGroupStyle(VariableColorGroupStyle from) { _isInitialized = from._isInitialized; _colorForIndex = from._colorForIndex; }