Esempio n. 1
0
        public string GetValidElementID(SceneNode sceneNode, string namePrefix)
        {
            namePrefix = SceneNodeIDHelper.ToCSharpID(namePrefix);
            string namePrefix1 = this.GetNamePrefix(namePrefix);

            if (this.NameAlreadyUsed(sceneNode.DocumentNode, namePrefix))
            {
                return(this.GetFirstAvailableIndexedName(sceneNode.DocumentNode, namePrefix1));
            }
            return(namePrefix);
        }
Esempio n. 2
0
 public string GetValidCopiedElementID(SceneNode sceneNode, string candidateID)
 {
     if (candidateID != null)
     {
         candidateID = SceneNodeIDHelper.ToCSharpID(candidateID);
         if (candidateID.Length == 0 || this.NameAlreadyUsed(sceneNode.DocumentNode, candidateID))
         {
             string namePrefix = this.GetNamePrefix(sceneNode.Name);
             if (namePrefix == null || !namePrefix.EndsWith(StringTable.SceneModelDuplicateLabelSuffix, StringComparison.Ordinal))
             {
                 namePrefix = candidateID + StringTable.SceneModelDuplicateLabelSuffix;
             }
             candidateID = this.GetValidElementID(sceneNode, namePrefix);
         }
     }
     return(candidateID);
 }