Esempio n. 1
0
        public string GenerateIdl(Assembly assembly)
        {
            var converter = new TypeLibConverter();
            var sink      = new TypeLibExporterNotifySink();
            var lib       = (ITypeLib)converter.ConvertAssemblyToTypeLib(assembly, assembly.GetName().Name,
                                                                         TypeLibExporterFlags.None, sink);
            var formatter = new PlainIDLFormatter();
            var owLib     = new OWTypeLib(lib);

            owLib.Listeners.Add(new IdlListener());

            owLib.BuildIDLInto(formatter);
            return(formatter.ToString());
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     try
     {
         if (args.Length < 1)
         {
             throw new Exception("oledump TLBNAME");
         }
         var tl = new OWTypeLib(args[0]);
         var pi = new PlainIDLFormatter();
         tl.BuildIDLInto(pi);
         System.Console.WriteLine(pi.ToString());
     }
     catch (Exception e)
     {
         System.Console.WriteLine("OleDump:\r\n");
         System.Console.Error.WriteLine("Error : " + e.Message);
     }
 }