public UIActionState TryPromoteActiveVariation(bool perform)
        {
            // Find the first move in this variation.
            Variation firstMoveInVariation = GetFirstMove(game.ActiveTree.ParentVariation);

            if (firstMoveInVariation == null)
            {
                // Already the main line of the game.
                return(UIActionVisibility.Disabled);
            }

            if (perform)
            {
                firstMoveInVariation.RepositionBefore(firstMoveInVariation.VariationIndex - 1);
                GameUpdated();
            }
            return(UIActionVisibility.Enabled);
        }