/// <summary> Gets. </summary> /// <typeparam name="T1"> Generic type parameter. </typeparam> /// <param name="key"> The key. </param> /// <param name="r"> [out] The out R<T1> to process. </param> /// <exception cref="KeyNotFoundException"> Thrown when a Key Not Found error condition occurs. </exception> public void Get <T1>(string key, out R <T1> r) { if (!RHandler <T1> .Get(key, out r)) { throw new KeyNotFoundException(nameof(key)); } }
/// <summary> Gets. </summary> /// <typeparam name="T1"> Generic type parameter. </typeparam> /// <param name="key"> The key. </param> /// <returns> A ref T1. </returns> /// <exception cref="KeyNotFoundException"> Thrown when a Key Not Found error condition occurs. </exception> public T1 Get <T1>(string key) { if (!RHandler <T1> .Get(key, out R <T1> r)) { throw new KeyNotFoundException(nameof(key)); } return(r.Invoke()); }
/// <summary> Deregisters this object. </summary> /// <typeparam name="T1"> Generic type parameter. </typeparam> /// <param name="key"> The key. </param> /// <param name="callback"> The callback. </param> public void Unregister <T1>(string key, R <T1> callback) { RHandler <T1> .Unregister(key); }
/// <summary> Registers this object. </summary> /// <typeparam name="T1"> Generic type parameter. </typeparam> /// <param name="key"> The key. </param> /// <param name="callback"> The callback. </param> public void Register <T1>(string key, R <T1> callback) { RHandler <T1> .Register(key, callback); }