Exemple #1
0
        public static string GetValueString(this Wz_Node node)
        {
            var    type = node.GetNodeType();
            string value;

            switch (type)
            {
            case Shared.NodeType.Wz_Uol:
                var target = node.GetValue <Wz_Uol>().HandleUol(node);
                value = $"link:{target.FullPathToFile}";
                break;

            case Shared.NodeType.Wz_Vector:
                var point = node.GetValue <Wz_Vector>();
                value = $"({point.X},{point.Y})";
                break;

            case Shared.NodeType.Wz_Normal:
                value = node.Value.ToString();
                break;

            case Shared.NodeType.Wz_Null:
            case Shared.NodeType.Wz_File:
            case Shared.NodeType.Wz_Image:
            case Shared.NodeType.Wz_Sound:
            case Shared.NodeType.Wz_Png:
            default:
                value = $"link:{node.FullPathToFile}";
                break;
            }
            return(value);
        }
Exemple #2
0
 public static Node ToNode(this Wz_Node wz_Node)
 {
     return(new Node
     {
         Text = wz_Node.Text,
         Value = wz_Node.Value?.ToString(),
         FullPathToFile = wz_Node.FullPathToFile,
         Type = wz_Node.GetNodeType(),
         parent = wz_Node.ParentNode?.ToNode()
     });
 }