Beispiel #1
0
        public static bool TryParse(string str, out UxNodePath path)
        {
            path = null;
            var parts = str.Split(new[] { '/' }, StringSplitOptions.None);

            if (parts.Length < 1)
            {
                return(false);
            }
            if (parts[0] != string.Empty)
            {
                return(false);
            }
            var indexes = new int[parts.Length - 1];

            for (var i = 1; i < parts.Length; i++)
            {
                if (!int.TryParse(parts[i], out var index))
                {
                    return(false);
                }

                indexes[i - 1] = index;
            }
            path = new UxNodePath(indexes);
            return(true);
        }
Beispiel #2
0
 public UxInsertAttributeChange(
     UxNodePath nodePath,
     int attributeIndex,
     AttributeSyntaxBase attribute)
 {
     NodePath       = nodePath;
     AttributeIndex = attributeIndex;
     Attribute      = attribute;
 }
 public UxReplaceAttributeChange(
     UxNodePath nodePath,
     int attributeIndex,
     AttributeSyntaxBase oldAttribute,
     AttributeSyntaxBase newAttribute)
 {
     NodePath       = nodePath;
     AttributeIndex = attributeIndex;
     OldAttribute   = oldAttribute;
     NewAttribute   = newAttribute;
 }
Beispiel #4
0
 public UxInsertNodeChange(UxNodePath path, NodeSyntax node)
 {
     Node     = node ?? throw new ArgumentNullException(nameof(node));
     NodePath = path ?? throw new ArgumentNullException(nameof(path));
 }
Beispiel #5
0
 public UxElementNameChange(UxNodePath nodePath, NameToken oldName, NameToken newName)
 {
     NodePath = nodePath;
     OldName  = oldName;
     NewName  = newName;
 }
Beispiel #6
0
 public UxReplaceNodeChange(UxNodePath nodePath, NodeSyntax oldNode, NodeSyntax newNode)
 {
     NodePath = nodePath;
     OldNode  = oldNode;
     NewNode  = newNode;
 }