Example #1
0
        private void EhAutomaticBinningTypeChanged()
        {
            var wasUserBefore = _doc.CreationOptions.IsUserDefinedBinningType;

            _doc.CreationOptions.IsUserDefinedBinningType = !_view.UseAutomaticBinning;

            if (!_doc.CreationOptions.IsUserDefinedBinningType && wasUserBefore)
            {
                HistogramCreation.PopulateHistogramCreationInformation(_doc);
                Initialize(true);
            }
        }
Example #2
0
        private void EhBinningTypeChanged()
        {
            var selNode = _binningTypes.FirstSelectedNode;

            if (null == selNode)
            {
                return;
            }
            var bintype = (Type)selNode.Tag;

            if (_doc.CreationOptions.Binning.GetType() == bintype)
            {
                return;
            }

            var binning = (IBinning)Activator.CreateInstance(bintype);

            _doc.CreationOptions.Binning = binning;

            HistogramCreation.PopulateHistogramCreationInformation(_doc);
            Initialize(true);
        }
Example #3
0
        public override bool Apply(bool disposeController)
        {
            _doc.CreationOptions.IgnoreNaN      = _view.IgnoreNaNValues;
            _doc.CreationOptions.IgnoreInfinity = _view.IgnoreInfiniteValues;

            if (_view.IgnoreValuesBelowLowerBoundary)
            {
                _doc.CreationOptions.IsLowerBoundaryInclusive = _view.IsLowerBoundaryInclusive;
                _doc.CreationOptions.LowerBoundaryToIgnore    = _view.LowerBoundary;
            }
            else
            {
                _doc.CreationOptions.IsLowerBoundaryInclusive = true;
                _doc.CreationOptions.LowerBoundaryToIgnore    = null;
            }

            if (_view.IgnoreValuesAboveUpperBoundary)
            {
                _doc.CreationOptions.IsUpperBoundaryInclusive = _view.IsUpperBoundaryInclusive;
                _doc.CreationOptions.UpperBoundaryToIgnore    = _view.UpperBoundary;
            }
            else
            {
                _doc.CreationOptions.IsUpperBoundaryInclusive = true;
                _doc.CreationOptions.UpperBoundaryToIgnore    = null;
            }

            _doc.CreationOptions.IsUserDefinedBinningType = !_view.UseAutomaticBinning;

            if (!_binningController.Apply(disposeController))
            {
                return(ApplyEnd(false, disposeController));
            }

            bool shouldShowDialog = HistogramCreation.PopulateHistogramCreationInformation(_doc);

            if (disposeController) // user pressed ok
            {
                if (ShouldLeaveDialogOpen(_doc))
                {
                    Initialize(true);
                    return(ApplyEnd(false, disposeController));
                }
                else
                {
                    return(ApplyEnd(true, disposeController));
                }
            }
            else
            {
                // we pressed apply thus we must update the gui
                if (ShouldLeaveDialogOpen(_doc))
                {
                    Initialize(true);
                    return(ApplyEnd(false, disposeController));
                }
                else
                {
                    Initialize(true);
                    return(ApplyEnd(true, disposeController));
                }
            }
        }