예제 #1
0
		/// <summary>
		/// looks up plural form alternative first for given flid, secondly for its destination class.
		/// </summary>
		/// <param name="cache"></param>
		/// <param name="tbl"></param>
		/// <param name="owningFlid"></param>
		/// <param name="titleStr">*{dstClass}* if couldn't find result.</param>
		/// <returns>true if we found an alternate form. false if titleStr is null or in *{key}* format.</returns>
		public static bool TryFindPluralFormFromFlid(FdoCache cache, StringTable tbl, uint owningFlid, out string titleStr)
		{
			titleStr = null;
			// first see if we can find an expanded name for the name of a flid.
			string flidName = cache.MetaDataCacheAccessor.GetFieldName(owningFlid);
			if (!String.IsNullOrEmpty(flidName))
			{
				if (TryFindString(tbl, "AlternativeTitles", flidName, out titleStr))
					return true;
			}
			// secondly, see if we can find the plural form for the destination class.
			uint dstClass = cache.GetDestinationClass(owningFlid);
			return TryFindPluralFormFromClassId(cache, tbl, dstClass, out titleStr);
		}