/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ internal static bool AddProp(string lang, string type, string value, List <XLiffProp> propList) { var prop = new XLiffProp(); prop.Lang = lang; prop.Type = type; prop.Value = value; return(AddProp(prop, propList)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ internal static bool AddProp(XLiffProp prop, List <XLiffProp> propList) { if (prop == null || prop.IsEmpty || propList == null) { return(false); } //review: I (jh) was surprised to see that each setting of a property merely added it to this list, so we'd get dozens of the same thing over and over. //From what I can tell looking around, it seems it is safe to treat these properites as atomic, so I've added this Remove before re-adding with the //current value. propList.RemoveAll(p => p.Type == prop.Type); propList.Add(prop); return(true); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ public bool AddProp(XLiffProp prop) { return(XLiffProp.AddProp(prop, _props)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ public bool AddProp(string lang, string type, string value) { return(XLiffProp.AddProp(lang, type, value, _props)); }