/// <summary>Throw exception if the user delegate is not one the CPU can call right now.</summary> /// <param name="userDelegate">The userdelegate being checked</param> /// <exception cref="KOSInvalidDelegateContextException">thrown if the cpu is in a state where it can't call this delegate.</exception> public void AssertValidDelegateCall(IUserDelegate userDelegate) { if (userDelegate.ProgContext != currentContext) { throw new KOSInvalidDelegateContextException( (currentContext == contexts[0] ? "the interpreter" : "a program"), (currentContext == contexts[0] ? "a program" : "the interpreter") ); } }
/// <summary>Throw exception if the user delegate is not one the CPU can call right now.</summary> /// <param name="userDelegate">The userdelegate being checked</param> /// <exception cref="KOSInvalidDelegateContextException">thrown if the cpu is in a state where it can't call this delegate.</exception> public void AssertValidDelegateCall(IUserDelegate userDelegate) { if (userDelegate.ProgContext != currentContext) { string currentContextName; if (currentContext == contexts[0]) { currentContextName = "the interpreter"; } else { currentContextName = "a program"; } string delegateContextName; if (userDelegate.ProgContext == contexts[0]) { delegateContextName = "the interpreter"; } else if (currentContext == contexts[0]) { delegateContextName = "a program"; } else { delegateContextName = "a different program from a previous run"; } throw new KOSInvalidDelegateContextException(currentContextName, delegateContextName); } }
public void AssertValidDelegateCall(IUserDelegate userDelegate) { throw new NotImplementedException(); }