示例#1
0
        /*
         * 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);
        }