/// <summary> /// Creates a unique location for the specified Source object with the specified member-name and initial relative-name. /// Example: MarkerX, "Pictogram", "Pictogram.png" /// Returns true if created, or false if already created. /// </summary> public bool CreateUniqueRelativeLocationDirect(object Source, string MemberName, string InitialRelativeName) { if (MemberName == null) { MemberName = "."; } else { MemberName = MemberName.TextToUrlIdentifier(); } if (this.RegisteredLocations.ContainsKey(Source) && this.RegisteredLocations[Source].ContainsKey(MemberName)) { return(false); } string RelativeUniqueLocation = null; if ((Source == this.SourceComposition || (Source is IRecognizableComposite && ((IRecognizableComposite)Source).CompositeParent == null)) && MemberName == ".") { RelativeUniqueLocation = Path.GetFileNameWithoutExtension(this.TargetFilePath).TextToUrlIdentifier(); } else { var RelativeName = (InitialRelativeName.IsAbsent() ? (MemberName == "." ? (Source is IIdentifiableElement ? ((IIdentifiableElement)Source).TechName : Source.ToStringAlways()).TextToUrlIdentifier() : MemberName) : InitialRelativeName); RelativeUniqueLocation = GenerateDerivedUniqueRelativeName(Source, RelativeName); } Dictionary <string, string> SubDict = null; if (this.RegisteredLocations.ContainsKey(Source)) { SubDict = this.RegisteredLocations[Source]; } else { SubDict = new Dictionary <string, string>(); this.RegisteredLocations.Add(Source, SubDict); } SubDict.Add(MemberName, RelativeUniqueLocation); return(true); }