Exemplo n.º 1
0
    public static string get_canvas_path(wzproperty property, string path)
    {
        property = inspect_canvas(property);

        if (null != property)
        {
            string link = property.query(null as string, "source") ?? property.query(null as string, "_outlink") ?? property.query(null as string, "_inlink");

            if (null == link)
            {
                return(path);
            }
            else
            {
                int index = link.IndexOf(".img/");

                if (0 <= index)                //outlink
                {
                    return(link.Substring(0, index) + link.Substring(index + 4));
                }
                else if (path != null)                //inlink
                {
                    var result = path.Replace(property.absolute.Replace("\0", "/"), "/" + link);

                    return(result);
                }
            }
        }
        return(path);
    }
Exemplo n.º 2
0
    public static wzproperty _inspect_canvas1(wzproperty property)
    {
        property = inspect_canvas(property);

        if (null != property)
        {
            wzproperty target;
            string     link = property.query(null as string, "source") ?? property.query(null as string, "_outlink") ?? property.query(null as string, "_inlink");

            if (null == link)
            {
                target = property;
            }
            else
            {
                int index = link.IndexOf(".img/");

                if (0 <= index)
                {
                    link = link.Substring(0, index) + link.Substring(index + 4);
                    DataSource.get_data(link, out target);
                }
                else
                {
                    target = property.root[link.Split('/')];
                }

                //if (0 <= index)
                //	target = packages.query(link.Substring(0, index + 4).Split('/'))[link.Substring(index + 5).Split('/')];
                //else
                //	target = property.root[link.Split('/')];
            }

            return(target);
        }

        return(null);
    }
Exemplo n.º 3
0
    public static wzcanvas inspect_canvas1(wzproperty property)
    {
        property = Tools._inspect_canvas1(property);

        if (null != property)
        {
            wzcanvas source;

            source = property.query <wzcanvas>(null);

            return(source);
        }

        return(null);
    }