static public ConnectionType StringToMainType(string s)
{
ConnectionType result;
lock( _string_to_main_type ) {
if( false ==_string_to_main_type.TryGetValue(s, out result)) {
int dot_idx = s.IndexOf('.');
string maintype = s;
if( dot_idx > 0 ) {
maintype = s.Substring(0, dot_idx);
}
try {
result = (ConnectionType)Enum.Parse(typeof(ConnectionType),
maintype,
true);
}
catch { result = ConnectionType.Unknown; }
_string_to_main_type[String.Intern(s)] = result;
}
}
return result;
}