Exemple #1
0
        public string GetUniqueIdentifier(UXIL.Node n, Node pathOrigin = null)
        {
            if (n == DocumentScope)
            {
                return(Self);
            }

            var on = n as PropertyNode;

            if (@on?.Name != null)
            {
                return(on.Name);
            }

            if (n is UXIL.ResourceRefNode)
            {
                return(((UXIL.ResourceRefNode)n).StaticRefId);
            }

            if (_identifiers.ContainsNode(n))
            {
                if (pathOrigin != null)
                {
                    return(GetUnique(n, n.Name.ToIdentifier(), pathOrigin));
                }

                return(_identifiers.Get(n));
            }

            if (n.Name == null)
            {
                return(GetUnique(n, "temp", null));
            }
            else
            {
                return(GetUnique(n, n.Name.ToIdentifier(), pathOrigin));
            }
        }