void BuildPathMap(Locatable locatable) { foreach(object value in locatable.GetAllAttributeValues()) { ILocatableList locatableList = value as ILocatableList; if (locatableList != null) { foreach (Locatable locatableValue in locatableList) { if (locatableValue.IsArchetypeRoot) { string archetypedPath = rootLocatable.PathOfItem(locatableValue); // %HYYKA% // CM: 16/04/09 in normal case, pathMap should not contain duplicated keys. // otherwise, the data instance is invalid. Since this is not for validation purpose, // when there are duplicated path in pathMap, not throw exception. //pathMap.Add(archetypedPath, locatableValue); if(!pathMap.ContainsKey(archetypedPath)) pathMap.Add(archetypedPath, locatableValue); } BuildPathMap(locatableValue); } } else { Locatable locatableValue = value as Locatable; if (locatableValue != null) { if (locatableValue.IsArchetypeRoot) { string archetypedPath = rootLocatable.PathOfItem(locatableValue); pathMap.Add(archetypedPath, locatableValue); } BuildPathMap(locatableValue); } } } }