public bool Start(string sourceFile) { qxdmApplication = new QXDMAutoApplication(); qxdmWindow = qxdmApplication.GetAutomationWindow(); isfHandler = qxdmWindow.LoadItemStore(sourceFile); if (isfHandler == 0xFFFFFFFF) { Debug.WriteLine("Error: Failed to load input ISF: {0}", sourceFile); return(false); } uint itemCount = qxdmWindow.GetItemCount(); Debug.WriteLine("itemCount: " + itemCount); iClient = (AutomationClientInterface)qxdmWindow.GetClientInterface(isfHandler); if (iClient == null) { Debug.WriteLine("Unable to obtain ISF client interface"); qxdmWindow.CloseItemStore(); return(false); } clientHandler = iClient.RegisterClient(true); if (clientHandler == 0xFFFFFFFF) { Debug.WriteLine("Unable to register ISF client"); qxdmWindow.CloseItemStore(); return(false); } iConfig = (AutomationConfigClient)iClient.ConfigureClient(clientHandler); if (iConfig == null) { Debug.WriteLine("Unable to configure ISF client"); iClient.UnregisterClient(clientHandler); qxdmWindow.CloseItemStore(); return(false); } return(true); }
/* * Load item store file */ public static bool Setup(AutomationWindow window) { // Get path to ISF file string fPath = Program.GetWorkingDirectory(); if (fPath == "") { return(false); } fPath += "medium.isf"; // Get file handle & load item store file uint handle = window.LoadItemStore(fPath); if (handle == 0) { Console.Write("\nUnable to load ISF:\n" + fPath + "\n"); return(false); } return(true); }
/* * Retrieve item from ISF file in current working directory */ public static bool Setup(AutomationWindow window) { string path = Program.GetWorkingDirectory(); if (path == "") { return(false); } string fileNm = path + "Example.isf"; // Get file handle & load item store file uint handle = window.LoadItemStore(fileNm); if (handle == 0) { Console.Write("\nUnable to load ISF:\n" + fileNm + "\n"); return(false); } // Retrieve item try { item = window.GetItem(handle, 2); } catch (COMException e) { Console.WriteLine("Exception while trying to retrieve item: " + e.Message); } if (item == null) { Console.WriteLine("Unable to retrieve item"); return(false); } return(true); }