GetRegistrableTypesInAssembly() private method

private GetRegistrableTypesInAssembly ( Assembly assembly ) : System.Type[]
assembly System.Reflection.Assembly
return System.Type[]
コード例 #1
0
ファイル: ConfigUtils.cs プロジェクト: OPCFoundation/UA-.NET
		/// <summary>
		/// Unregisters the COM types in the specified assembly.
		/// </summary>
		public static List<System.Type> UnregisterComTypes(string filePath)
		{
			// load assmebly.
			Assembly assembly = Assembly.LoadFrom(filePath);

			// check that the correct assembly is being unregistered.
			VerifyCodebase(assembly, filePath);

			RegistrationServices services = new RegistrationServices();

			// list types to register/unregister.
			List<System.Type> types = new List<System.Type>(services.GetRegistrableTypesInAssembly(assembly));

			// unregister types.	
			if (!services.UnregisterAssembly(assembly))
			{
				throw new ApplicationException("Unregister COM Types Failed.");
			}

			return types;
		}