示例#1
0
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Getter getter)
        {
            if (!externalGroups.ContainsType(typeof(DashPatternGroupStyle)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(DashPatternGroupStyle)))
            {
                localGroups.Add(new DashPatternGroupStyle());
            }

            DashPatternGroupStyle grpStyle = null;

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

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                grpStyle.Initialize(getter());
            }
        }
示例#2
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                DashPatternGroupStyle s = null != o ? (DashPatternGroupStyle)o : new DashPatternGroupStyle();

                s._isStepEnabled = info.GetBoolean("StepEnabled");

                s._listOfValues = DashPatternListManager.Instance.BuiltinDefault;
                s.SetValueCoercedToGroup(DashPatternListManager.Instance.BuiltinDefault[0]);

                return(s);
            }
示例#3
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                DashPatternGroupStyle s = null != o ? (DashPatternGroupStyle)o : new DashPatternGroupStyle();

                s._isStepEnabled = info.GetBoolean("StepEnabled");

                var value = (IDashPattern)info.GetValue("Value", s);

                var listOfValues = (DashPatternList)info.GetValue("ListOfValues", s);

                DashPatternListManager.Instance.TryRegisterList(listOfValues, Main.ItemDefinitionLevel.Project, out var registeredList);
                s._listOfValues = registeredList;
                s.SetValueCoercedToGroup(value);

                return(s);
            }
示例#4
0
        public static void ApplyStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Setter setter)
        {
            DashPatternGroupStyle     grpStyle = null;
            IPlotGroupStyleCollection grpColl  = null;

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

            if (null != grpColl)
            {
                grpStyle = (DashPatternGroupStyle)grpColl.GetPlotGroupStyle(typeof(DashPatternGroupStyle));
                grpColl.OnBeforeApplication(typeof(DashPatternGroupStyle));
                setter(grpStyle.DashStyle);
            }
        }
示例#5
0
 public DashPatternGroupStyle(DashPatternGroupStyle from)
 {
     _isStepEnabled = from._isStepEnabled;
     _value         = from._value;
     _listOfValues  = from._listOfValues;
 }
示例#6
0
		public DashPatternGroupStyle(DashPatternGroupStyle from)
		{
			this._isStepEnabled = from._isStepEnabled;
			this._value = from._value;
			this._listOfValues = from._listOfValues;
		}