mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-20 01:22:16 +01:00
Add 'OnDeserializationComplete' function
This commit is contained in:
1 parent
4cd9a851e8
commit
8963bdb6c0
2 files changed
+17
-1
No files matched your search
@@ -0,0 +1,9 @@
|
||||
// <copyright file="IXmlSerializable.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter
|
||||
{
|
||||
public interface IXmlSerializable
|
||||
{
|
||||
void OnDeserializationComplete();
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,14 @@ namespace FileConverter
|
||||
List<T> elements = (List<T>)serializer.Deserialize(xmlReader);
|
||||
for (int index = 0; index < elements.Count; index++)
|
||||
{
|
||||
collection.Add(elements[index]);
|
||||
T item = elements[index];
|
||||
|
||||
if (item is IXmlSerializable)
|
||||
{
|
||||
(item as IXmlSerializable).OnDeserializationComplete();
|
||||
}
|
||||
|
||||
collection.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user