public void EngineStatusInitializedAfterLaunch() { VBAIEngine engine = new VBAIEngine("APITest", "", true); EngineStatusInfo engineInfo = engine.GetEngineStatus(); Assert.True(engineInfo.status == EngineStatus.Initialized, "Engine is not in 'Initialized' state after launch."); }
public bool OpenEngine() { try { vBAIEngine = new VBAIEngine("LeaderVision", "", true); vBAIEngine.OpenInspection(vbaipath); return(true); } catch (Exception ex) { return(false); } }
private void Launch_engine_Click(object sender, RoutedEventArgs e) { try { // passing an emtpy string for the version will launch the latest Vision Builder AI engine available on the system. engine = new VBAIEngine("APITest", "", true); btnLaunchEngine.IsEnabled = false; btnOpenInspection.IsEnabled = true; } catch (VBAIException ex) { MessageBox.Show(ex.Message); } }
private void launch_Click(object sender, EventArgs e) { try { // Passing an emtpy string for the version will launch the latest Vision Builder AI engine available on the system. engine = new VBAIEngine("APITest", "", true); launch.Enabled = false; open.Enabled = true; } catch (VBAIException ex) { MessageBox.Show(ex.Message); } }
public static Exception VBAIError(Error error) { Debug.Assert(error < 0); string message = ""; try { byte[] str = new byte[256]; Error err = VBAIEngine.vbaiGetErrorString(error, str, 256); message = VBAIEngine.ConvertBytesToString(str); message = message.Replace("\n", Environment.NewLine); } catch (Exception) { message = String.Format(CultureInfo.InvariantCulture, "Could not get error message."); } finally { throw new VBAIException(message, (int)error); } }
public VBAIEngine Startengine() { engine = new VBAIEngine("APITest", "", false); return(engine); }