diff --git a/README.md b/README.md index a3a13f0..58343db 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,33 @@ [![NuGet version (Micro-Manager.NET)](https://img.shields.io/nuget/v/Micro-Manager.NET.svg)](https://www.nuget.org/packages/Micro-Manager.NET/2.0.3) [![NuGet version (Micro-Manager.NET)](https://img.shields.io/nuget/dt/Micro-Manager.NET?color=g)](https://www.nuget.org/packages/Micro-Manager.NET/2.0.3) # Micro-Manager.NET - Controlling Micro-Manager 2.0.3 with IKVM & C# +Using Micro-Manager 2.0.3 with IKVM & C# # Building - Get IKVM 8.10.2. - Then use Micro-Manager in C# ``` +using mmcorej; using org.micromanager.@internal; -using System; namespace MMTest { public partial class Form1 : Form { - public Form1(string[] args) + public Form1() { InitializeComponent(); // Now, set the Java "user.dir" system property to match the C# current directory - string p = Path.GetDirectoryName(config).Replace("\\","/"); + string p = Path.GetDirectoryName("C:/Program Files/Micro-Manager-2.0/"); Directory.SetCurrentDirectory(p); - java.lang.System.setProperty("user.dir",p); + java.lang.System.setProperty("user.dir", p); java.lang.System.setProperty("force.annotation.index", "true"); java.lang.System.setProperty("org.micromanager.corej.path", "C:/Program Files/Micro-Manager-2.0/"); CMMCore core; + MMStudio studio; try { - MMStudio.main(new string[] {}); + MMStudio.main(new string[] { }); studio = MMStudio.getInstance(); core = studio.core(); } @@ -38,4 +39,5 @@ namespace MMTest } } } + ```