예제 #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, double> > setter)
        {
            VariableSymbolSizeGroupStyle grpStyle = null;
            IPlotGroupStyleCollection    grpColl  = null;

            if (externalGroups.ContainsType(MyType))
            {
                grpColl = externalGroups;
            }
            else if (localGroups != null && localGroups.ContainsType(MyType))
            {
                grpColl = localGroups;
            }

            if (null != grpColl)
            {
                grpStyle = (VariableSymbolSizeGroupStyle)grpColl.GetPlotGroupStyle(MyType);
                grpColl.OnBeforeApplication(MyType);
                setter(grpStyle._symbolSizeForIndex);
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Func <int, double> getter)
        {
            if (!externalGroups.ContainsType(MyType) &&
                null != localGroups &&
                !localGroups.ContainsType(MyType))
            {
                localGroups.Add(new VariableSymbolSizeGroupStyle());
            }

            VariableSymbolSizeGroupStyle grpStyle = null;

            if (externalGroups.ContainsType(typeof(SymbolSizeGroupStyle)))
            {
                grpStyle = (VariableSymbolSizeGroupStyle)externalGroups.GetPlotGroupStyle(MyType);
            }
            else if (localGroups != null)
            {
                grpStyle = (VariableSymbolSizeGroupStyle)localGroups.GetPlotGroupStyle(MyType);
            }

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                grpStyle.Initialize(getter);
            }
        }
예제 #3
0
		public VariableSymbolSizeGroupStyle(VariableSymbolSizeGroupStyle from)
		{
			this._isInitialized = from._isInitialized;
			this._symbolSizeForIndex = from._symbolSizeForIndex;
		}
예제 #4
0
 public VariableSymbolSizeGroupStyle(VariableSymbolSizeGroupStyle from)
 {
     _isInitialized      = from._isInitialized;
     _symbolSizeForIndex = from._symbolSizeForIndex;
 }