Пример #1
0
 public ExtraPropertyInfo(ExtraPropertyId id, IDictionary <string, string> descriptions)
 {
     if (id == null)
     {
         throw new ArgumentNullException();
     }
     if (descriptions == null)
     {
         throw new ArgumentNullException();
     }
     PropertyId   = id;
     Descriptions = descriptions.AsReadOnly();
 }
Пример #2
0
 /// <summary>
 ///     Gets the value of an "extra" property. If the referenced property doesn't exist, a null value is returned.</summary>
 public virtual string this[ExtraPropertyId property]
 {
     get
     {
         if (property == null)
         {
             return(null);
         }
         if (property == ExtraPropertyId.TierArabic)
         {
             return(Tier == 0 ? "" : Tier.ToString());
         }
         else if (property == ExtraPropertyId.TierRoman)
         {
             return(WdUtil.RomanNumerals[Tier].ToString());
         }
         string result;
         if (!_extras.TryGetValue(property, out result))
         {
             return(null);
         }
         return(result);
     }
 }