Exemplo n.º 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"></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);
            }
        }
Exemplo n.º 2
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;
			}
		}