private static void RegisterCodecs(Assembly asm) { Type[] types = asm.GetExportedTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsDefined(typeof(DicomCodecAttribute), false)) { IDcmCodec codec = (IDcmCodec)Activator.CreateInstance(types[i]); _codecs.Add(codec.GetTransferSyntax(), types[i]); } } }
private static void RegisterCodecs(Assembly asm) { bool x64 = (IntPtr.Size == 8); string m = null; PortableExecutableKinds kind; ImageFileMachine machine; asm.ManifestModule.GetPEKind(out kind, out machine); if (kind == PortableExecutableKinds.ILOnly) { m = ""; } else if (kind == PortableExecutableKinds.PE32Plus) { m = " [x64]"; } else if (kind == PortableExecutableKinds.Required32Bit) { m = " [x86]"; } else { m = " [Unknown]"; } Type[] types = asm.GetExportedTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsDefined(typeof(DicomCodecAttribute), false)) { IDcmCodec codec = (IDcmCodec)Activator.CreateInstance(types[i]); _codecs.Add(codec.GetTransferSyntax(), types[i]); _codecNames.Add(codec.GetName() + m); Debug.Log.Info("Codec: {0}", codec.GetName() + m); } } }
private static void RegisterCodecs(Assembly asm) { if (_codecs == null) { _codecs = new Dictionary <DicomTransferSyntax, Type>(); } #if !SILVERLIGHT bool x64 = (IntPtr.Size == 8); string m = String.Empty; PortableExecutableKinds kind; ImageFileMachine machine; asm.ManifestModule.GetPEKind(out kind, out machine); if ((kind & PortableExecutableKinds.PE32Plus) != 0) { m = " [x64]"; } else if ((kind & PortableExecutableKinds.Required32Bit) != 0) { m = " [x86]"; } Type[] types = asm.GetExportedTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsDefined(typeof(DicomCodecAttribute), false)) { IDcmCodec codec = (IDcmCodec)Activator.CreateInstance(types[i]); _codecs.Add(codec.GetTransferSyntax(), types[i]); _codecNames.Add(codec.GetName() + m); Debug.Log.Info("Codec: {0}", codec.GetName() + m); } } #endif }