コード例 #1
0
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Func <bool> getter)
        {
            if (!externalGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle)))
            {
                localGroups.Add(new IgnoreMissingDataPointsGroupStyle());
            }

            IgnoreMissingDataPointsGroupStyle grpStyle = null;

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

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                grpStyle.Initialize(getter());
            }
        }
コード例 #2
0
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Int32FunctionValueGetter getter)
        {
            if (!externalGroups.ContainsType(typeof(SkipFrequencyGroupStyle)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(SkipFrequencyGroupStyle)))
            {
                localGroups.Add(new SkipFrequencyGroupStyle());
            }

            SkipFrequencyGroupStyle grpStyle = null;

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

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                grpStyle.Initialize(getter());
            }
        }
コード例 #3
0
ファイル: ColorPlotGroupStyle.cs プロジェクト: olesar/Altaxo
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Getter getter)
        {
            if (!externalGroups.ContainsType(typeof(ColorGroupStyle)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(ColorGroupStyle)))
            {
                localGroups.Add(ColorGroupStyle.NewLocalGroupStyle());
            }

            ColorGroupStyle grpStyle = null;

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

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                grpStyle.Initialize(getter());
            }
        }
コード例 #4
0
        /// <summary>
        /// Prepares the style.
        /// </summary>
        /// <param name="externalGroups">The external groups.</param>
        /// <param name="localGroups">The local groups.</param>
        /// <param name="getter">The getter function. Item1 of the tuple is the line connection style, Item2 of the tuple is the ConnectCircular flag.</param>
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Func <Tuple <ILineConnectionStyle, bool> > getter)
        {
            if (!externalGroups.ContainsType(typeof(LineConnection2DGroupStyle)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(LineConnection2DGroupStyle)))
            {
                localGroups.Add(new LineConnection2DGroupStyle());
            }

            LineConnection2DGroupStyle grpStyle = null;

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

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                var data = getter();
                grpStyle.Initialize(data.Item1, data.Item2);
            }
        }
コード例 #5
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);
            }
        }
コード例 #6
0
ファイル: PlotGroupStyle.cs プロジェクト: olesar/Altaxo
        public static T GetStyleToInitialize <T>(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups
            ) where T : IPlotGroupStyle, new()
        {
            if (!externalGroups.ContainsType(typeof(T)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(T)))
            {
                localGroups.Add(new T());
            }

            var grpStyle = default(T);

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

            if (grpStyle != null && !grpStyle.IsInitialized)
            {
                return(grpStyle);
            }
            else
            {
                return(default(T));
            }
        }
コード例 #7
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);
            }
        }
コード例 #8
0
ファイル: PlotGroupStyle.cs プロジェクト: olesar/Altaxo
        /// <summary>
        /// Looks first in externalGroups, then in localGroups for the type of PlotGroupStyle to apply.
        /// If an instance of this type is found, this instance is returned. If found, the containig collection
        /// is informed that this group style will be applied now by calling OnBeforeApplication.
        /// </summary>
        /// <typeparam name="T">Type of PlotGroupStyle to look for.</typeparam>
        /// <param name="externalGroups">First collection to look for the group style.</param>
        /// <param name="localGroups">Second collection to look for the group style.</param>
        /// <returns>The instance of the plot group style (if found), or null otherwise.</returns>
        public static T GetStyleToApply <T>(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups
            ) where T : IPlotGroupStyle
        {
            var grpStyle = default(T);
            IPlotGroupStyleCollection grpColl = null;

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

            if (null != grpColl)
            {
                grpStyle = (T)grpColl.GetPlotGroupStyle(typeof(T));
                grpColl.OnBeforeApplication(typeof(T));
            }

            return(grpStyle);
        }
コード例 #9
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"></param>
        /// <returns></returns>
        public static bool ApplyStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Action <ILineConnectionStyle, bool> setter)
        {
            LineConnection2DGroupStyle grpStyle = null;
            IPlotGroupStyleCollection  grpColl  = null;

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

            if (null != grpColl)
            {
                grpStyle = (LineConnection2DGroupStyle)grpColl.GetPlotGroupStyle(typeof(LineConnection2DGroupStyle));
                grpColl.OnBeforeApplication(typeof(LineConnection2DGroupStyle));
                setter(grpStyle.LineConnectionStyle, grpStyle._connectCircular);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #10
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"></param>
        /// <returns></returns>
        public static bool ApplyStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Action <bool> setter)
        {
            IgnoreMissingDataPointsGroupStyle grpStyle = null;
            IPlotGroupStyleCollection         grpColl  = null;

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

            if (null != grpColl)
            {
                grpStyle = (IgnoreMissingDataPointsGroupStyle)grpColl.GetPlotGroupStyle(typeof(IgnoreMissingDataPointsGroupStyle));
                grpColl.OnBeforeApplication(typeof(IgnoreMissingDataPointsGroupStyle));
                setter(grpStyle.IgnoreMissingDataPoints);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #11
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"></param>
        /// <returns></returns>
        public static bool ApplyStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            SymbolSizeSetter setter)
        {
            SymbolSizeGroupStyle      grpStyle = null;
            IPlotGroupStyleCollection grpColl  = null;

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

            if (null != grpColl)
            {
                grpStyle = (SymbolSizeGroupStyle)grpColl.GetPlotGroupStyle(typeof(SymbolSizeGroupStyle));
                grpColl.OnBeforeApplication(typeof(SymbolSizeGroupStyle));
                setter(grpStyle.SymbolSize);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #12
0
 public static void IntendToApply(
     IPlotGroupStyleCollection externalGroups,
     IPlotGroupStyleCollection localGroups,
     int numberOfItems,
     double minimumLogicalXValue,
     double maximumLogicalXValue
     )
 {
     if (externalGroups != null && externalGroups.ContainsType(typeof(BarWidthPositionGroupStyle)))
     {
         ((BarWidthPositionGroupStyle)externalGroups.GetPlotGroupStyle(typeof(BarWidthPositionGroupStyle))).IntendToApply(numberOfItems, minimumLogicalXValue, maximumLogicalXValue);
     }
 }
コード例 #13
0
ファイル: PlotGroupStyle.cs プロジェクト: olesar/Altaxo
        public static bool ShouldAddLocalGroupStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            System.Type type)
        {
            bool found = false;

            if (externalGroups != null && externalGroups.ContainsType(type))
            {
                found = true;
            }
            if (!found && localGroups != null && localGroups.ContainsType(type))
            {
                found = true;
            }

            return(!found && localGroups != null);
        }
コード例 #14
0
ファイル: ColorPlotGroupStyle.cs プロジェクト: olesar/Altaxo
        public static void ApplyStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Setter setter)
        {
            ColorGroupStyle           grpStyle = null;
            IPlotGroupStyleCollection grpColl  = null;

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

            if (null != grpColl)
            {
                grpStyle = (ColorGroupStyle)grpColl.GetPlotGroupStyle(typeof(ColorGroupStyle));
                grpColl.OnBeforeApplication(typeof(ColorGroupStyle));
                setter(grpStyle.Color);
            }
        }
コード例 #15
0
ファイル: PlotGroupStyle.cs プロジェクト: olesar/Altaxo
 public static bool ShouldAddExternalGroupStyle(
     IPlotGroupStyleCollection externalGroups,
     System.Type type)
 {
     return(!externalGroups.ContainsType(type));
 }
コード例 #16
0
		public static void PrepareStyle(
			IPlotGroupStyleCollection externalGroups,
			IPlotGroupStyleCollection localGroups,
			Func<bool> getter)
		{
			if (!externalGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle))
				&& null != localGroups
				&& !localGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle)))
			{
				localGroups.Add(new IgnoreMissingDataPointsGroupStyle());
			}

			IgnoreMissingDataPointsGroupStyle grpStyle = null;
			if (externalGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle)))
				grpStyle = (IgnoreMissingDataPointsGroupStyle)externalGroups.GetPlotGroupStyle(typeof(IgnoreMissingDataPointsGroupStyle));
			else if (localGroups != null)
				grpStyle = (IgnoreMissingDataPointsGroupStyle)localGroups.GetPlotGroupStyle(typeof(IgnoreMissingDataPointsGroupStyle));

			if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
				grpStyle.Initialize(getter());
		}
コード例 #17
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;
			}
		}
コード例 #18
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);
		}
コード例 #19
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"></param>
		/// <returns></returns>
		public static bool ApplyStyle(
			IPlotGroupStyleCollection externalGroups,
			IPlotGroupStyleCollection localGroups,
			Action<bool> setter)
		{
			IgnoreMissingDataPointsGroupStyle grpStyle = null;
			IPlotGroupStyleCollection grpColl = null;
			if (externalGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle)))
				grpColl = externalGroups;
			else if (localGroups != null && localGroups.ContainsType(typeof(IgnoreMissingDataPointsGroupStyle)))
				grpColl = localGroups;

			if (null != grpColl)
			{
				grpStyle = (IgnoreMissingDataPointsGroupStyle)grpColl.GetPlotGroupStyle(typeof(IgnoreMissingDataPointsGroupStyle));
				grpColl.OnBeforeApplication(typeof(IgnoreMissingDataPointsGroupStyle));
				setter(grpStyle.IgnoreMissingDataPoints);
				return true;
			}
			else
			{
				return false;
			}
		}
コード例 #20
0
		public static void IntendToApply(
			IPlotGroupStyleCollection externalGroups,
			IPlotGroupStyleCollection localGroups,
			int numberOfItems,
			double minimumLogicalXValue,
			double maximumLogicalXValue,
			double minimumLogicalYValue,
			double maximumLogicalYValue
			)
		{
			if (externalGroups != null && externalGroups.ContainsType(typeof(BarSizePosition3DGroupStyle)))
			{
				((BarSizePosition3DGroupStyle)externalGroups.GetPlotGroupStyle(typeof(BarSizePosition3DGroupStyle))).IntendToApply(numberOfItems, minimumLogicalXValue, maximumLogicalXValue, minimumLogicalYValue, maximumLogicalYValue);
			}
			else if (localGroups != null && localGroups.ContainsType(typeof(BarSizePosition3DGroupStyle)))
			{
				((BarSizePosition3DGroupStyle)localGroups.GetPlotGroupStyle(typeof(BarSizePosition3DGroupStyle))).IntendToApply(numberOfItems, minimumLogicalXValue, maximumLogicalXValue, minimumLogicalYValue, maximumLogicalYValue);
			}
		}
コード例 #21
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"></param>
		/// <returns></returns>
		public static bool ApplyStyle(
			IPlotGroupStyleCollection externalGroups,
			IPlotGroupStyleCollection localGroups,
			Action<ILineConnectionStyle, bool> setter)
		{
			LineConnection2DGroupStyle grpStyle = null;
			IPlotGroupStyleCollection grpColl = null;
			if (externalGroups.ContainsType(typeof(LineConnection2DGroupStyle)))
				grpColl = externalGroups;
			else if (localGroups != null && localGroups.ContainsType(typeof(LineConnection2DGroupStyle)))
				grpColl = localGroups;

			if (null != grpColl)
			{
				grpStyle = (LineConnection2DGroupStyle)grpColl.GetPlotGroupStyle(typeof(LineConnection2DGroupStyle));
				grpColl.OnBeforeApplication(typeof(LineConnection2DGroupStyle));
				setter(grpStyle.LineConnectionStyle, grpStyle._connectCircular);
				return true;
			}
			else
			{
				return false;
			}
		}
コード例 #22
0
    public static void PrepareStyle(
      IPlotGroupStyleCollection externalGroups,
      IPlotGroupStyleCollection localGroups,
      Getter getter)
    {
      if (!externalGroups.ContainsType(typeof(ColorGroupStyle))
        && null != localGroups
        && !localGroups.ContainsType(typeof(ColorGroupStyle)))
      {
        localGroups.Add(new ColorGroupStyle());
      }

      ColorGroupStyle grpStyle = null;
      if (externalGroups.ContainsType(typeof(ColorGroupStyle)))
        grpStyle = (ColorGroupStyle)externalGroups.GetPlotGroupStyle(typeof(ColorGroupStyle));
      else if (localGroups != null)
        grpStyle = (ColorGroupStyle)localGroups.GetPlotGroupStyle(typeof(ColorGroupStyle));

      if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
        grpStyle.Initialize(getter());
    }
コード例 #23
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"></param>
    /// <returns></returns>
    public static bool ApplyStyle(
      IPlotGroupStyleCollection externalGroups,
      IPlotGroupStyleCollection localGroups,
      Int32ValueSetter setter)
    {
      SkipFrequencyGroupStyle grpStyle = null;
      IPlotGroupStyleCollection grpColl = null;
      if (externalGroups.ContainsType(typeof(SkipFrequencyGroupStyle)))
        grpColl = externalGroups;
      else if (localGroups != null && localGroups.ContainsType(typeof(SkipFrequencyGroupStyle)))
        grpColl = localGroups;

      if (null != grpColl)
      {
        grpStyle = (SkipFrequencyGroupStyle)grpColl.GetPlotGroupStyle(typeof(SkipFrequencyGroupStyle));
        grpColl.OnBeforeApplication(typeof(SkipFrequencyGroupStyle));
        setter(grpStyle.SkipFrequency);
        return true;
      }
      else
      {
        return false;
      }


    }
コード例 #24
0
    public static void ApplyStyle(
      IPlotGroupStyleCollection externalGroups,
      IPlotGroupStyleCollection localGroups,
      Setter setter)
    {
      ColorGroupStyle grpStyle = null;
      IPlotGroupStyleCollection grpColl = null;
      if (externalGroups.ContainsType(typeof(ColorGroupStyle)))
        grpColl = externalGroups;
      else if (localGroups != null && localGroups.ContainsType(typeof(ColorGroupStyle)))
        grpColl = localGroups;

      if (null != grpColl)
      {
        grpStyle = (ColorGroupStyle)grpColl.GetPlotGroupStyle(typeof(ColorGroupStyle));
        grpColl.OnBeforeApplication(typeof(ColorGroupStyle));
        setter(grpStyle.Color);
      }
    }
コード例 #25
0
		/// <summary>
		/// Prepares the style.
		/// </summary>
		/// <param name="externalGroups">The external groups.</param>
		/// <param name="localGroups">The local groups.</param>
		/// <param name="getter">The getter function. Item1 of the tuple is the line connection style, Item2 of the tuple is the ConnectCircular flag.</param>
		public static void PrepareStyle(
			IPlotGroupStyleCollection externalGroups,
			IPlotGroupStyleCollection localGroups,
			Func<Tuple<ILineConnectionStyle, bool>> getter)
		{
			if (!externalGroups.ContainsType(typeof(LineConnection2DGroupStyle))
				&& null != localGroups
				&& !localGroups.ContainsType(typeof(LineConnection2DGroupStyle)))
			{
				localGroups.Add(new LineConnection2DGroupStyle());
			}

			LineConnection2DGroupStyle grpStyle = null;
			if (externalGroups.ContainsType(typeof(LineConnection2DGroupStyle)))
				grpStyle = (LineConnection2DGroupStyle)externalGroups.GetPlotGroupStyle(typeof(LineConnection2DGroupStyle));
			else if (localGroups != null)
				grpStyle = (LineConnection2DGroupStyle)localGroups.GetPlotGroupStyle(typeof(LineConnection2DGroupStyle));

			if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
			{
				var data = getter();
				grpStyle.Initialize(data.Item1, data.Item2);
			}
		}