/// <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);
            }
        }
        /// <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);
            }
        }
 public LineConnection2DGroupStyle(LineConnection2DGroupStyle from)
 {
     _isInitialized       = from._isInitialized;
     _lineConnectionStyle = from._lineConnectionStyle;
 }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LineConnection2DGroupStyle s = null != o ? (LineConnection2DGroupStyle)o : new LineConnection2DGroupStyle();

                return(s);
            }
		public LineConnection2DGroupStyle(LineConnection2DGroupStyle from)
		{
			this._isInitialized = from._isInitialized;
			this._lineConnectionStyle = from._lineConnectionStyle;
		}