Example #1
0
        public void Unregister(Delegate callBack, string eventName)
        {
            switch (eventName)
            {
            case Constants.TestGenerationStart:
                TestGenerationStart -= ModuleUtils.GetDeleage <RuntimeDelegate.TestGenerationAction>(callBack);
                break;

            case Constants.TestGenerationEnd:
                TestGenerationEnd -= ModuleUtils.GetDeleage <RuntimeDelegate.TestGenerationAction>(callBack);
                break;

            case Constants.SessionGenerationStart:
                SessionGenerationStart -= ModuleUtils.GetDeleage <RuntimeDelegate.SessionGenerationAction>(callBack);
                break;

            case Constants.SessionGenerationReport:
                SessionGenerationReport -= ModuleUtils.GetDeleage <RuntimeDelegate.SessionGenerationAction>(callBack);
                break;

            case Constants.SessionGenerationEnd:
                SessionGenerationEnd -= ModuleUtils.GetDeleage <RuntimeDelegate.SessionGenerationAction>(callBack);
                break;

            case Constants.TestProjectStart:
                TestProjectStart -= ModuleUtils.GetDeleage <RuntimeDelegate.TestProjectStatusAction>(callBack);
                break;

            case Constants.SessionStart:
                SessionStart -= ModuleUtils.GetDeleage <RuntimeDelegate.SessionStatusAction>(callBack);
                break;

            case Constants.SequenceStarted:
                SequenceStarted -= ModuleUtils.GetDeleage <RuntimeDelegate.SequenceStatusAction>(callBack);
                break;

            case Constants.StatusReceived:
                StatusReceived -= ModuleUtils.GetDeleage <RuntimeDelegate.StatusReceivedAction>(callBack);
                break;

            case Constants.SequenceOver:
                SequenceOver -= ModuleUtils.GetDeleage <RuntimeDelegate.SequenceStatusAction>(callBack);
                break;

            case Constants.SessionOver:
                SessionOver -= ModuleUtils.GetDeleage <RuntimeDelegate.SessionStatusAction>(callBack);
                break;

            case Constants.BreakPointHitted:
                BreakPointHitted -= ModuleUtils.GetDeleage <RuntimeDelegate.BreakPointHittedAction>(callBack);
                break;

            case Constants.TestProjectOver:
                TestProjectOver -= ModuleUtils.GetDeleage <RuntimeDelegate.TestProjectStatusAction>(callBack);
                break;

            default:
                I18N i18N = I18N.GetInstance(Constants.I18nName);
                throw new TestflowInternalException(ModuleErrorCode.UnexistEvent, i18N.GetFStr("UnexistEvent", eventName));
                break;
            }
        }