update dev300-m58
[ooovba.git] / cli_ure / workbench / dynload / dynload.cs
blobca35da8b7c15041ebf3e8e55b2ee8899b34e8d73
1 using System;
2 using unoidl.com.sun.star.lang;
3 using unoidl.com.sun.star.uno;
4 using unoidl.com.sun.star.bridge;
5 using unoidl.com.sun.star.frame;
7 class DynLoad
10 static void Main(string[] args)
12 connect(args);
15 /** Connect to a running office that is accepting connections.
16 @return The ServiceManager to instantiate office components. */
17 static private XMultiServiceFactory connect( string[] args )
19 if (args.Length == 0)
20 Console.WriteLine("You need to provide a file URL to the office" +
21 " program folder\n");
22 System.Collections.Hashtable ht = new System.Collections.Hashtable();
23 ht.Add( "SYSBINDIR", args[ 0 ] );
24 XComponentContext xContext =
25 uno.util.Bootstrap.defaultBootstrap_InitialComponentContext(
26 args[ 0 ] + "/uno.ini", ht.GetEnumerator() );
28 if (xContext != null)
29 Console.WriteLine("Successfully created XComponentContext\n");
30 else
31 Console.WriteLine("Could not create XComponentContext\n");
33 return null;