예제 #1
0
        private bool DoWork(string cmd)
        {
            switch (cmd)
            {
            case "Expand":
            {
                for (int i = 0; i < 3; i++)
                {
                    try
                    {
                        UtilAutomation.Expand(_vm.host.aeCurrent);
                        return(true);
                    }
                    catch (System.InvalidOperationException)
                    {
                        return(true);
                    }
                    catch (System.Exception ex)
                    {
                        _vm.host.WriteLog(ex.Message);
                        UtilSys.Wait(1000);
                    }
                }
            }
                return(false);

            case "Collapse":
                UtilAutomation.Collapse(_vm.host.aeCurrent);
                break;

            case "Select":
                AutomationPattern.Select(_vm.host.aeCurrent);
                break;

            default:
                _vm.host.WriteLog("Unrecognized TreeItem Command: '" + cmd + "'");
                return(false);
            }
            return(true);
        }