public IModulePathNode CreatePath(string path) { if (path == null || path.Length == 0) { return(pathRoot); } string[] splittedPath = path.Split(new char[] { '/' }); IModulePathNode curPath = pathRoot; int i = 0; while (i < splittedPath.Length) { if (splittedPath[i].Length != 0) { IModulePathNode nextPath = (IModulePathNode)curPath.ChildNodes[splittedPath[i]]; if (nextPath == null) { curPath.ChildNodes[splittedPath[i]] = nextPath = new DefaultModulePathNode(splittedPath[i], curPath); } curPath = nextPath; } ++i; } return(curPath); }
public IModulePathNode CreatePath(string path) { if (path == null || path.Length == 0) { return pathRoot; } string[] splittedPath = path.Split(new char[] { '/' }); IModulePathNode curPath = pathRoot; int i = 0; while (i < splittedPath.Length) { if (splittedPath[i].Length != 0) { IModulePathNode nextPath = (IModulePathNode)curPath.ChildNodes[splittedPath[i]]; if (nextPath == null) { curPath.ChildNodes[splittedPath[i]] = nextPath = new DefaultModulePathNode(splittedPath[i], curPath); } curPath = nextPath; } ++i; } return curPath; }