Apache.NMS.Util.URISupport.GetProperties C# (CSharp) Метод

GetProperties() публичный статический Метод

public static GetProperties ( StringDictionary props, string prefix ) : StringDictionary
props System.Collections.Specialized.StringDictionary
prefix string
Результат System.Collections.Specialized.StringDictionary
        public static StringDictionary GetProperties(StringDictionary props, string prefix)
        {
            if(props == null)
            {
                throw new Exception("Properties Object was null");
            }

            StringDictionary result = new StringDictionary();

            foreach(string key in props.Keys)
            {
                if(key.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase))
                {
                    string bareKey = key.Substring(prefix.Length);
                    String value = props[key];
                    result[bareKey] = value;
                }
            }

            return result;
        }