Framework_4_0 preprocessor is necessary for legacy compatibility.
This commit is contained in:
parent
12fe97babd
commit
558fcf495a
15 changed files with 755 additions and 46 deletions
|
|
@ -1137,7 +1137,7 @@ namespace Server
|
|||
|
||||
if ( s == null )
|
||||
return false;
|
||||
|
||||
#if Framework_4_0
|
||||
Type type = typeof(T);
|
||||
T tempVal;
|
||||
|
||||
|
|
@ -1151,6 +1151,19 @@ namespace Server
|
|||
Console.WriteLine( "Could not parse {0} enum attribute '{1}' in element '{2}'", type, attribute, xml.Name );
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
try
|
||||
{
|
||||
value = (T)Enum.Parse(type, s, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine( "Could not parse {0} enum attribute '{1}' in element '{2}'", type, attribute, xml.Name );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static bool ReadMap( XmlElement xml, string attribute, ref Map value )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue