public void Add(Uri baseUri, string familyName) { if (String.IsNullOrEmpty(familyName)) throw new ArgumentNullException("familyName"); if (familyName.Contains(",")) throw new NotImplementedException("Only one family name is supported."); // family name starts right of '#' int idxHash = familyName.IndexOf('#'); if (idxHash < 0) throw new ArgumentException("Family name must contain a '#'. Example './#MyFontFamilyName'", "familyName"); string key = familyName.Substring(idxHash + 1); if (String.IsNullOrEmpty(key)) throw new ArgumentException("familyName has invalid format."); if (this.fontFamilies.ContainsKey(key)) throw new ArgumentException("An entry with the specified family name already exists."); System.Windows.Media.FontFamily fontFamily = new System.Windows.Media.FontFamily(baseUri, familyName); this.fontFamilies.Add(key, fontFamily); }