private static NodeType GetNodeType(XamlNode current)
        {
            switch (current.NodeType)
            {
                case XamlNodeType.StartMember:
                case XamlNodeType.EndMember:
                    return NodeType.Member;

                case XamlNodeType.StartObject:
                case XamlNodeType.EndObject:
                    return NodeType.Object;

                case XamlNodeType.GetObject:
                    return NodeType.GetObject;

                case XamlNodeType.NamespaceDeclaration:
                    return NodeType.NamespaceDeclaration;

                case XamlNodeType.Value:
                    return NodeType.Value;

                case XamlNodeType.None:
                    return NodeType.Root;
            }

            throw new InvalidOperationException("Cannont translate the type");
        }
Example #2
0
 public bool Equals(XamlNode other)
 {
     return nodeType == other.nodeType && Equals(data, other.data) && internalNodeType == other.internalNodeType;
 }