private static bool ProcessStringsInString(String @string, Func <string, string> process)
        {
            var s = process(@string.Value);

            if (s == null)
            {
                return(false);
            }
            @string.Value = s;
            return(true);
        }
示例#2
0
        private static bool SetVersionString(StringTable stringTable, string versionName, string value)
        {
            var matchingString = stringTable.Children.SingleOrDefault(s => s.szKey == versionName);

            if (matchingString != null)
            {
                if (matchingString.Value == value)
                {
                    return(false);
                }
                matchingString.wType = 1;
                matchingString.Value = value;
                return(true);
            }

            var children  = stringTable.Children.ToList();
            var newString = new String {
                wType = 1, szKey = versionName, Value = value
            };

            children.Add(newString);
            stringTable.Children = children.ToArray();
            return(true);
        }
        private static bool SetVersionString(StringTable stringTable, string versionName, string value)
        {
            var matchingString = stringTable.Children.SingleOrDefault(s => s.szKey == versionName);
            if (matchingString != null)
            {
                if (matchingString.Value == value)
                    return false;
                matchingString.wType = 1;
                matchingString.Value = value;
                return true;
            }

            var children = stringTable.Children.ToList();
            var newString = new String { wType = 1, szKey = versionName, Value = value };
            children.Add(newString);
            stringTable.Children = children.ToArray();
            return true;
        }
 private static bool ProcessStringsInString(String @string, Func<string, string> process)
 {
     var s = process(@string.Value);
     if (s == null)
         return false;
     @string.Value = s;
     return true;
 }