/// <summary> /// If Libronix is running, save its workspace in the specified file. /// <param name="path"></param> /// </summary> public static void SaveWorkspace(string path) { try { // If Libronix isn't running, we'll get an exception here object libApp = Marshal.GetActiveObject("LibronixDLS.LbxApplication"); if (libApp == null) { return; } LbxApplication libronixApp = libApp as LbxApplication; object document = libronixApp.MSXML.CreateDocument(0); //MSXML2.DOMDocument40 doc = new MSXML2.DOMDocument40(); //doc. libronixApp.SaveWorkspace(document, ""); MSXML2.DOMDocument doc = document as MSXML2.DOMDocument; doc.save(path); //Type docType = document.GetType(); //MethodInfo info = docType.GetMethod("save"); //if (info != null) // info.Invoke(document, new object[] {path}); } catch (COMException) { return; } }