Пример #1
0
        /// <summary>
        /// Executes a step only on those items, where in the own collection the stepping is enabled, but in the foreign collection it is present, but is not enabled.
        /// </summary>
        /// <param name="step"></param>
        /// <param name="foreignStyles"></param>
        public void StepIfForeignSteppingFalse(int step, PlotGroupStyleCollectionBase foreignStyles)
        {
            foreach (KeyValuePair <Type, IPlotGroupStyle> entry in _typeToInstance)
            {
                Type            groupType  = entry.Key;
                IPlotGroupStyle groupStyle = entry.Value;
                GroupInfo       groupInfo  = _typeToInfo[groupType];

                if (groupInfo.ParentGroupType == null &&
                    groupInfo.WasApplied &&
                    groupStyle.IsStepEnabled &&
                    foreignStyles.ContainsType(groupType) &&
                    !(foreignStyles.GetPlotGroupStyle(groupType).IsStepEnabled)
                    )
                {
                    int       subStep      = groupStyle.Step(step);
                    GroupInfo subGroupInfo = groupInfo;
                    for (Type subGroupType = subGroupInfo.ChildGroupType; subGroupType != null && subStep != 0; subGroupType = subGroupInfo.ChildGroupType)
                    {
                        subGroupInfo = _typeToInfo[subGroupType];
                        IPlotGroupStyle subGroupStyle = _typeToInstance[subGroupType];
                        subStep = subGroupStyle.IsStepEnabled ? subGroupStyle.Step(subStep) : 0;
                    }
                }
                groupInfo.WasApplied = false;
            }
        }
Пример #2
0
        public void Step(int step)
        {
            foreach (KeyValuePair <Type, IPlotGroupStyle> entry in _typeToInstance)
            {
                Type            groupType  = entry.Key;
                IPlotGroupStyle groupStyle = entry.Value;
                GroupInfo       groupInfo  = _typeToInfo[groupType];

                if (groupInfo.ParentGroupType == null &&
                    groupInfo.WasApplied &&
                    groupStyle.IsStepEnabled
                    )
                {
                    int       subStep      = groupStyle.Step(step);
                    GroupInfo subGroupInfo = groupInfo;
                    for (Type subGroupType = subGroupInfo.ChildGroupType; subGroupType != null && subStep != 0; subGroupType = subGroupInfo.ChildGroupType)
                    {
                        subGroupInfo = _typeToInfo[subGroupType];
                        IPlotGroupStyle subGroupStyle = _typeToInstance[subGroupType];
                        subStep = subGroupStyle.IsStepEnabled ? subGroupStyle.Step(subStep) : 0;
                    }
                }
                groupInfo.WasApplied = false;
            }
        }