private void ChangeFigure(SetFigureMethod method)
        {
            var color = _parent.ChangeFigure(_model, method);

            FigureName.Value = _model.Figure;
            Background.Value = color;
        }
Ejemplo n.º 2
0
        public Section AddSection(Section previousSection, SetFigureMethod method)
        {
            var figure = GetFigure(method, previousSection);

            var section = new Section()
            {
                Body = string.Empty, Figure = figure
            };

            _sections.Add(section);

            return(section);
        }
 internal void AddSection(Section previousSection, SetFigureMethod method)
 {
     try
     {
         var newSection = _dialogue.AddSection(previousSection, method);
         if (newSection != null)
         {
             RegisterFigureColor(newSection.Figure);
             _sections.Add(new SectionViewModel(this, newSection, method == SetFigureMethod.Create));
         }
     }
     catch (Exception exception)
     {
         var ex = exception.ToString();
     }
 }
Ejemplo n.º 4
0
        private string GetFigure(SetFigureMethod method, Section section = null)
        {
            string result = null;

            switch (method)
            {
            case SetFigureMethod.Rotate:
                result = (section != null) ? RotateFigure(section.Figure) : _figures[0];
                break;

            case SetFigureMethod.Create:
                var num = 1;
                while (_figures.Contains($"{FigureName_Other} {num}"))
                {
                    num++;
                }
                result = $"{FigureName_Other} {num}";
                _figures.Add(result);
                break;
            }
            return(result);
        }
Ejemplo n.º 5
0
        public void ChangeFigure(Section currentSection, SetFigureMethod method)
        {
            var figure = GetFigure(method, currentSection);

            currentSection.Figure = figure;
        }
 internal SolidColorBrush ChangeFigure(Section currentSection, SetFigureMethod method)
 {
     _dialogue.ChangeFigure(currentSection, method);
     return(RegisterFigureColor(currentSection.Figure));
 }
 private void AddSection(SetFigureMethod method)
 {
     IsBodyEditable.Value = false;
     _parent.AddSection(_model, method);
 }