Exemple #1
0
        private void _UpdateEntranceLineVisibility()
        {
            bool isUndet  = _Taxon.IsNamed && (_IsRef || _Taxon.IsUndet);
            bool isSingle = _EntranceType == _EntranceTypes.Single;
            bool isFirst  = _EntranceType == _EntranceTypes.First;
            bool isLast   = _EntranceType == _EntranceTypes.Last;
            bool isNormal = _EntranceType == _EntranceTypes.Normal;

            if (!isUndet && isSingle)
            {
                if (singleLine is null)
                {
                    singleLine = new SingleLine();
                    grid_LeftPart.Children.Add(singleLine);
                }
                else
                {
                    singleLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (singleLine is not null)
                {
                    singleLine.Visibility = Visibility.Collapsed;
                }
            }

            if (isUndet && isSingle)
            {
                if (undetSingleLine is null)
                {
                    undetSingleLine = new UndetSingleLine();
                    grid_LeftPart.Children.Add(undetSingleLine);
                }
                else
                {
                    undetSingleLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (undetSingleLine is not null)
                {
                    undetSingleLine.Visibility = Visibility.Collapsed;
                }
            }

            if (!isUndet && isFirst)
            {
                if (firstLine is null)
                {
                    firstLine = new FirstLine();
                    grid_LeftPart.Children.Add(firstLine);
                }
                else
                {
                    firstLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (firstLine is not null)
                {
                    firstLine.Visibility = Visibility.Collapsed;
                }
            }

            if (isUndet && isFirst)
            {
                if (undetFirstLine is null)
                {
                    undetFirstLine = new UndetFirstLine();
                    grid_LeftPart.Children.Add(undetFirstLine);
                }
                else
                {
                    undetFirstLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (undetFirstLine is not null)
                {
                    undetFirstLine.Visibility = Visibility.Collapsed;
                }
            }

            if (!isUndet && isLast)
            {
                if (lastLine is null)
                {
                    lastLine = new LastLine();
                    grid_LeftPart.Children.Add(lastLine);
                }
                else
                {
                    lastLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (lastLine is not null)
                {
                    lastLine.Visibility = Visibility.Collapsed;
                }
            }

            if (isUndet && isLast)
            {
                if (undetLastLine is null)
                {
                    undetLastLine = new UndetLastLine();
                    grid_LeftPart.Children.Add(undetLastLine);
                }
                else
                {
                    undetLastLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (undetLastLine is not null)
                {
                    undetLastLine.Visibility = Visibility.Collapsed;
                }
            }

            if (!isUndet && isNormal)
            {
                if (normalLine is null)
                {
                    normalLine = new NormalLine();
                    grid_LeftPart.Children.Add(normalLine);
                }
                else
                {
                    normalLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (normalLine is not null)
                {
                    normalLine.Visibility = Visibility.Collapsed;
                }
            }

            if (isUndet && isNormal)
            {
                if (undetNormalLine is null)
                {
                    undetNormalLine = new UndetNormalLine();
                    grid_LeftPart.Children.Add(undetNormalLine);
                }
                else
                {
                    undetNormalLine.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (undetNormalLine is not null)
                {
                    undetNormalLine.Visibility = Visibility.Collapsed;
                }
            }
        }
Exemple #2
0
        private void _UpdateAttributes()
        {
            if (_IsRoot)
            {
                if (_ShowButton)
                {
                    _UpdateEntranceType(_EntranceTypes.Single);

                    grid_LeftPart.Visibility = Visibility.Visible;
                }
                else
                {
                    grid_LeftPart.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                if (_IsFirst && _IsLast)
                {
                    _UpdateEntranceType(_EntranceTypes.Single);
                }
                else if (_IsFirst)
                {
                    _UpdateEntranceType(_EntranceTypes.First);
                }
                else if (_IsLast)
                {
                    _UpdateEntranceType(_EntranceTypes.Last);
                }
                else
                {
                    _UpdateEntranceType(_EntranceTypes.Normal);
                }

                grid_LeftPart.Visibility = Visibility.Visible;
            }

            if ((_IsRoot && !_IsFinal) || (!_IsFinal && _ShowButton))
            {
                if (rightLine is null)
                {
                    rightLine = new SingleLine();
                    grid_RightPart.Children.Add(rightLine);
                }

                grid_RightPart.Visibility = Visibility.Visible;
            }
            else
            {
                grid_RightPart.Visibility = Visibility.Collapsed;
            }

            if (_ShowButton && _Taxon is not null)
            {
                grid_MiddlePart.Visibility = Visibility.Visible;
            }
            else
            {
                grid_MiddlePart.Visibility = Visibility.Collapsed;
            }
        }