public static SerializableData CreateData(SerializationInfo info, Type initialType) { if (info == null) { throw new ArgumentNullException("info"); } var type = info.GetSavedType(initialType); if (type == null) { throw new InvalidOperationException("type == null"); } return((SerializableData)Activator.CreateInstance(typeof(SerializableData <>).MakeGenericType(type), info.AsEnumerable())); }