Exemplo n.º 1
0
        protected virtual void EhShowColorSetManagerDialog(object sender, RoutedEventArgs e)
        {
            var listController = new ColorSetController();

            listController.InitializeDocument(InternalSelectedColor.ParentColorSet);
            Current.Gui.FindAndAttachControlTo(listController);

            if (Current.Gui.ShowDialog(listController, "Manage color sets", false))
            {
                var colorSetChosen = (IColorSet)listController.ModelObject;

                if (object.ReferenceEquals(InternalSelectedColor.ParentColorSet, colorSetChosen))
                {
                    return; // nothing has changed
                }
                if (ShowPlotColorsOnly && object.ReferenceEquals(colorSetChosen, ColorSetManager.Instance.BuiltinKnownColors))
                {
                    Current.Gui.ErrorMessageBox(string.Format("The color set '{0}' is not admitted to be used as plot color set. Please choose another color set, or derive a new color set from '{0}'.", ColorSetManager.Instance.BuiltinKnownColors.Name), "ColorSet not admitted");
                    return;
                }

                if (ShowPlotColorsOnly)
                {
                    ColorSetManager.Instance.DeclareAsPlotColorList(colorSetChosen);
                }

                // we choose the first color from the new color set
                InternalSelectedColor = colorSetChosen[0];
            }
        }
Exemplo n.º 2
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                _listController = new ColorSetController();
                _listController.InitializeDocument(_doc.ListOfValues);
            }

            if (null != _view)
            {
                _listController.ViewObject = _view;
            }
        }
Exemplo n.º 3
0
 public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers()
 {
     yield return(new ControllerAndSetNullMethod(_listController, () => _listController = null));
 }