private void InternalInitialize()
        {
            _context = _doc.GetPropertyContext();

            AxisStyleCondController = new ConditionalDocumentController <AxisStyle>(CreateAxisStyle, RemoveAxisStyle, CreateAxisStyleController)
            {
                UseDocumentCopy = UseDocument.Directly
            };
            MajorLabelCondController = new ConditionalDocumentController <AxisLabelStyle>(CreateMajorLabel, RemoveMajorLabel)
            {
                UseDocumentCopy = UseDocument.Directly
            };
            MinorLabelCondController = new ConditionalDocumentController <AxisLabelStyle>(CreateMinorLabel, RemoveMinorLabel)
            {
                UseDocumentCopy = UseDocument.Directly
            };

            if (_doc.Contains(AxisInformation.Identifier))
            {
                var axStyle = _doc[AxisInformation.Identifier];
                AxisStyleCondController.InitializeDocument(axStyle);
                if (axStyle.AreMajorLabelsEnabled)
                {
                    MajorLabelCondController.InitializeDocument(axStyle.MajorLabelStyle);
                }
                if (axStyle.AreMinorLabelsEnabled)
                {
                    MinorLabelCondController.InitializeDocument(axStyle.MinorLabelStyle);
                }
            }
        }
Exemplo n.º 2
0
        public static void AddAxis(AxisStyleCollection collection, AxisCreationArguments creationArgs)
        {
            var context = collection.GetPropertyContext();
            var axstyle = new AxisStyle(creationArgs.CurrentStyle, false, false, false, null, context);

            if (creationArgs.TemplateStyle != null && collection.Contains(creationArgs.TemplateStyle))
            {
                axstyle.CopyWithoutIdFrom(collection[creationArgs.TemplateStyle]);
                if (creationArgs.MoveAxis)
                {
                    collection.Remove(creationArgs.TemplateStyle);
                }
            }
            collection.Add(axstyle);
        }