Пример #1
0
Файл: CPU.cs Проект: CalebJ2/KOS
 /// <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")
             );
     }
 }
Пример #2
0
Файл: CPU.cs Проект: KSP-KOS/KOS
        /// <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);
               }
        }
Пример #3
0
 public void AssertValidDelegateCall(IUserDelegate userDelegate)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public void AssertValidDelegateCall(IUserDelegate userDelegate)
 {
     throw new NotImplementedException();
 }