Пример #1
0
        /// <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);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
		public VariableColorGroupStyle(VariableColorGroupStyle from)
		{
			this._isInitialized = from._isInitialized;
			this._colorForIndex = from._colorForIndex;
		}
Пример #4
0
 public VariableColorGroupStyle(VariableColorGroupStyle from)
 {
     _isInitialized = from._isInitialized;
     _colorForIndex = from._colorForIndex;
 }