public static FrameConfig FromIni(IKeyedStorage <string, string> section) { FrameMode winFrame; return(new FrameConfig( section["WndClass"], section["WndTitle"], Enum.TryParse(section["WndFrame"], true, out winFrame) ? winFrame : FrameMode.Unchanged, ParsePoint(section["WndPos"]), ParseSize(section["WndSize"]) )); }
public static ShooterConfig FromIni(IKeyedStorage <string, string> section) { ImageFormat format; int quality; string folder; string nameFormat; return(new ShooterConfig( Enum.TryParse(section["Format"], true, out format) && format != ImageFormat.None ? format : _defaultFormat, Int32.TryParse(section["Quality"], NumberStyles.Integer, CultureInfo.InvariantCulture, out quality) && quality > 0 ? quality : _defaultQuality, !String.IsNullOrEmpty(folder = section["Folder"]) ? folder : _defaultFolder, !String.IsNullOrEmpty(nameFormat = section["NameFormat"]) ? nameFormat : _defaultNameFormat )); }