Append method IsDirectoryEmpty

pull/1/head
Ogoun 5 years ago
parent 64d594cc0c
commit a074f9c02a

@ -304,5 +304,10 @@ namespace ZeroLevel.Services.FileSystem
} }
} }
} }
public static bool IsDirectoryEmpty(string path)
{
return !Directory.EnumerateFileSystemEntries(path).Any();
}
} }
} }

@ -77,6 +77,10 @@ namespace ZeroLevel.Services.Serialization
public static byte[] SerializeCompatible(object obj) public static byte[] SerializeCompatible(object obj)
{ {
if (null == obj)
{
return null;
}
var direct_seriazlizable = (obj as IBinarySerializable); var direct_seriazlizable = (obj as IBinarySerializable);
if (direct_seriazlizable != null) if (direct_seriazlizable != null)
{ {
@ -95,6 +99,10 @@ namespace ZeroLevel.Services.Serialization
public static byte[] SerializeCompatible<T>(T obj) public static byte[] SerializeCompatible<T>(T obj)
{ {
if (null == obj)
{
return null;
}
var direct_seriazlizable = (obj as IBinarySerializable); var direct_seriazlizable = (obj as IBinarySerializable);
if (direct_seriazlizable != null) if (direct_seriazlizable != null)
{ {

Loading…
Cancel
Save

Powered by TurnKey Linux.