Пример #1
0
        /// <inheritdoc/>
        public void Initialize(IWithDoubleClickEditor smartEntity)
        {
            if (!(smartEntity is Axis axis))
            {
                throw new ArgumentException("Wrong type of entity");
            }

            _axis = axis;

            // visibility
            ChangeOrientVisibility();
            if (_axis.MarkersCount > 1)
            {
                ChangeSecondVisibility(true);
                ChangeThirdVisibility(_axis.MarkersCount > 2);
            }
            else
            {
                ChangeSecondVisibility(false);
                ChangeThirdVisibility(false);
            }

            // values
            TbFirstPrefix.Text = _axis.FirstTextPrefix;
            TbFirstText.Text   = _axis.FirstText;
            TbFirstSuffix.Text = _axis.FirstTextSuffix;

            TbSecondPrefix.Text = _axis.SecondTextPrefix;
            TbSecondText.Text   = _axis.SecondText;
            TbSecondSuffix.Text = _axis.SecondTextSuffix;

            TbThirdPrefix.Text = _axis.ThirdTextPrefix;
            TbThirdText.Text   = _axis.ThirdText;
            TbThirdSuffix.Text = _axis.ThirdTextSuffix;

            TbBottomOrientText.Text = _axis.BottomOrientText;
            TbTopOrientText.Text    = _axis.TopOrientText;

            // markers position
            CbMarkersPosition.SelectedItem = _axis.MarkersPosition;

            // focus
            TbFirstText.Focus();
        }
Пример #2
0
        private void SetValues()
        {
            // visibility
            ChangeOrientVisibility();
            if (_intellectualEntity.MarkersCount > 1)
            {
                ChangeSecondVisibility(true);
                ChangeThirdVisibility(_intellectualEntity.MarkersCount > 2);
            }
            else
            {
                ChangeSecondVisibility(false);
                ChangeThirdVisibility(false);
            }

            // values
            TbFirstPrefix.Text = _intellectualEntity.FirstTextPrefix;
            TbFirstText.Text   = _intellectualEntity.FirstText;
            TbFirstSuffix.Text = _intellectualEntity.FirstTextSuffix;

            TbSecondPrefix.Text = _intellectualEntity.SecondTextPrefix;
            TbSecondText.Text   = _intellectualEntity.SecondText;
            TbSecondSuffix.Text = _intellectualEntity.SecondTextSuffix;

            TbThirdPrefix.Text = _intellectualEntity.ThirdTextPrefix;
            TbThirdText.Text   = _intellectualEntity.ThirdText;
            TbThirdSuffix.Text = _intellectualEntity.ThirdTextSuffix;

            TbBottomOrientText.Text = _intellectualEntity.BottomOrientText;
            TbTopOrientText.Text    = _intellectualEntity.TopOrientText;

            // markers position
            CbMarkersPosition.SelectedItem = _intellectualEntity.MarkersPosition;

            // focus
            TbFirstText.Focus();
        }