using System;
using System.IO;
namespace MfGames.IO.Extensions
{
///
/// Additional methods for types.
///
public static class TypeExtensions
{
///
/// Gets the directory for a given type.
///
/// The type assembly to get the directory.
/// The directory or null if the assembly or location is null.
public static DirectoryInfo? GetDirectory(this Type? type)
{
return type?.Assembly.GetDirectory();
}
///
/// Gets the file for a given type's assembly.
///
/// The type assembly to get the directory.
/// The directory or null if the assembly or location is null.
public static FileInfo? GetFile(this Type? type)
{
return type?.Assembly.GetFile();
}
}
}