private string UpdateNodeXPath()

in Tools/UIRecorder/UIRecorder/WindowEditNodeAttribute.xaml.cs [160:204]


        private string UpdateNodeXPath()
        {
            xpathNode = $"/{uiTreeNode.Tag}";

            if (!string.IsNullOrEmpty(uiTreeNode.Name) && comboBoxName.SelectedValue != null)
            {
                var nameComboValue = comboBoxName.SelectedValue.ToString();

                if (nameComboValue == "=")
                    xpathNode += $"[@Name=\\\"{this.textBoxName.Text}\\\"]";
                else
                    xpathNode += $"[{nameComboValue}(@Name,\\\"{this.textBoxName.Text}\\\")]";
            }

            if (!string.IsNullOrEmpty(uiTreeNode.ClassName) && comboboxClass.SelectedValue != null)
            {
                var classComboValue = comboboxClass.SelectedValue.ToString();

                if (classComboValue == "=")
                    xpathNode += $"[@ClassName=\\\"{textBoxClassName.Text}\\\"]";
                else
                    xpathNode += $"[{classComboValue}(@ClassName,\\\"{textBoxClassName.Text}\\\")]";
            }

            if (!string.IsNullOrEmpty(uiTreeNode.AutomationId) && comboboxAutoId.SelectedValue != null)
            {
                var autoIdComboValue = comboboxAutoId.SelectedValue.ToString();

                if (autoIdComboValue == "=")
                    xpathNode += $"[@AutomationId=\\\"{textBoxAutoId.Text}\\\"]";
                else
                    xpathNode += $"[{autoIdComboValue}(@AutomationId,\\\"{textBoxAutoId.Text}\\\")]";
            }

            if (!string.IsNullOrEmpty(uiTreeNode.Position) && textBoxPosition.Text.Trim().Length > 0)
            {
                if (bAddPositionAtribute == true)
                {
                    var positionValue = textBoxPosition.Text.Trim();
                    xpathNode += $"[position()={positionValue}]";
                }
            }

            return xpathNode;
        }