public Entry(FileSystem.TestDelegate test, Volume volume, Int32 size, Type type) { Test = test; Volume = volume; Size = size; Type = type; }
public static void Init() { sTests = new List <FileSystem.TestDelegate>(); foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) { foreach (Type t in a.GetTypes()) { if ((typeof(IFileSystemAuto).IsAssignableFrom(t)) && (!t.IsAbstract)) { MethodInfo minfo = t.GetMethod("GetTest", BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly); if (minfo == null) { continue; } FileSystem.TestDelegate method = minfo.Invoke(null, null) as FileSystem.TestDelegate; if (method == null) { continue; } if (!sTests.Contains(method)) { sTests.Add(method); } } } } }
public static Boolean GetInfo(String typeName, out Int32 blockSize, out Type volumeType) { blockSize = -1; volumeType = null; if ((typeName == null) || (typeName.Length == 0)) { return(false); } if (!typeName.StartsWith("FSX.", StringComparison.OrdinalIgnoreCase)) { typeName = String.Concat("FSX.", typeName); } Type type = Type.GetType(typeName, false, true); if ((type == null) || !(typeof(IFileSystemAuto).IsAssignableFrom(type)) || (type.IsAbstract)) { return(false); } MethodInfo minfo = type.GetMethod("GetTest", BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly); if (minfo == null) { return(false); } FileSystem.TestDelegate method = minfo.Invoke(null, null) as FileSystem.TestDelegate; if (method == null) { return(false); } method(null, 0, out blockSize, out volumeType); return(true); }