Ejemplo n.º 1
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                if (null != _controllerSimple)
                {
                    _controllerSimple.Dispose();
                    _controllerSimple = null;
                }
                if (null != _controllerAdvanced)
                {
                    _controllerAdvanced.Dispose();
                    _controllerAdvanced = null;
                }

                if (PlotGroupCollectionControllerSimple.IsSimplePlotGrouping(_doc, out var isSerialStepping, out var isColor, out var isLineStyle, out var isSymbolStyle))
                {
                    _controllerSimple = new PlotGroupCollectionControllerSimple()
                    {
                        UseDocumentCopy = UseDocument.Directly
                    };
                    _controllerSimple.InitializeDocument(_doc);
                }
                else
                {
                    var controllerAdvanced = new PlotGroupCollectionControllerAdvanced()
                    {
                        UseDocumentCopy = UseDocument.Directly
                    };
                    controllerAdvanced.InitializeDocument(_doc);
                    controllerAdvanced.GroupStyleChanged += new WeakActionHandler(EhGroupStyleChanged, (handler) => controllerAdvanced.GroupStyleChanged -= handler);
                    _controllerAdvanced = controllerAdvanced;
                }
            }
Ejemplo n.º 2
0
        public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers()
        {
            yield return(new ControllerAndSetNullMethod(_controllerAdvanced, () => { _controllerAdvanced = null; }));

            yield return(new ControllerAndSetNullMethod(_controllerSimple, () => _controllerSimple = null));
        }