コード例 #1
0
ファイル: XLiffProp.cs プロジェクト: phillip-hopper/l10nsharp
        /// ------------------------------------------------------------------------------------
        /// <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));
        }
コード例 #2
0
ファイル: XLiffProp.cs プロジェクト: phillip-hopper/l10nsharp
        /// ------------------------------------------------------------------------------------
        /// <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);
        }
コード例 #3
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Adds a property.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public bool AddProp(XLiffProp prop)
 {
     return(XLiffProp.AddProp(prop, _props));
 }
コード例 #4
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Adds a property.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public bool AddProp(string lang, string type, string value)
 {
     return(XLiffProp.AddProp(lang, type, value, _props));
 }