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); }
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; }
public UxInsertNodeChange(UxNodePath path, NodeSyntax node) { Node = node ?? throw new ArgumentNullException(nameof(node)); NodePath = path ?? throw new ArgumentNullException(nameof(path)); }
public UxElementNameChange(UxNodePath nodePath, NameToken oldName, NameToken newName) { NodePath = nodePath; OldName = oldName; NewName = newName; }
public UxReplaceNodeChange(UxNodePath nodePath, NodeSyntax oldNode, NodeSyntax newNode) { NodePath = nodePath; OldNode = oldNode; NewNode = newNode; }