public static string EnsureContentName(string nameBase, Node container)
{
if (string.IsNullOrEmpty(nameBase))
return nameBase;
if (container == null)
throw new ApplicationException("Cannot create a new Content: expected context node is null");
var index = 0;
string newName = null;
while (Node.Exists(GetNewPath(container, nameBase, index++, out newName)))
{
}
return newName;
}
#endregion