summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-08-29 16:57:20 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2008-08-29 16:57:20 -0700
commit7232aaceb87d34e4538354c840adb46afd07bfc7 (patch)
treeda40c60963c3e4bbcffbef7459d64b8d9f3eb681 /src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs
parente0101d0c3f578b2e12e96c03740102634aa96289 (diff)
downloadDotNetOpenAuth-7232aaceb87d34e4538354c840adb46afd07bfc7.zip
DotNetOpenAuth-7232aaceb87d34e4538354c840adb46afd07bfc7.tar.gz
DotNetOpenAuth-7232aaceb87d34e4538354c840adb46afd07bfc7.tar.bz2
Touching up API and documentation.
Diffstat (limited to 'src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs')
-rw-r--r--src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs b/src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs
index e331e1c..d5fa243 100644
--- a/src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs
+++ b/src/DotNetOpenId/RelyingParty/OpenIdAjaxTextBox.cs
@@ -335,28 +335,30 @@ namespace DotNetOpenId.RelyingParty {
#endregion
- Dictionary<IClientScriptExtension, string> clientScriptExtensions = new Dictionary<IClientScriptExtension, string>();
+ Dictionary<Type, string> clientScriptExtensions = new Dictionary<Type, string>();
/// <summary>
/// Allows an OpenID extension to read data out of an unverified positive authentication assertion
/// and send it down to the client browser so that Javascript running on the page can perform
/// some preprocessing on the extension data.
/// </summary>
- /// <param name="extension">The extension that will read data from the assertion.</param>
+ /// <typeparam name="T">The extension <i>response</i> type that will read data from the assertion.</typeparam>
/// <param name="propertyName">The property name on the openid_identifier input box object that will be used to store the extension data. For example: sreg</param>
- public void RegisterClientScriptExtension(IClientScriptExtension extension, string propertyName) {
- if (extension == null) throw new ArgumentNullException("extension");
+ /// <remarks>
+ /// This method should be called from the <see cref="UnconfirmedPositiveAssertion"/> event handler.
+ /// </remarks>
+ public void RegisterClientScriptExtension<T>(string propertyName) where T : IClientScriptExtensionResponse {
if (String.IsNullOrEmpty(propertyName)) throw new ArgumentNullException("propertyName");
if (clientScriptExtensions.ContainsValue(propertyName)) {
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture,
Strings.ClientScriptExtensionPropertyNameCollision, propertyName), "propertyName");
}
- foreach (IClientScriptExtension ext in clientScriptExtensions.Keys) {
- if (ext.TypeUri == extension.TypeUri) {
+ foreach (var ext in clientScriptExtensions.Keys) {
+ if (ext == typeof(T)) {
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture,
- Strings.ClientScriptExtensionTypeUriCollision, extension.TypeUri), "extension");
+ Strings.ClientScriptExtensionTypeCollision, typeof(T).FullName));
}
}
- clientScriptExtensions.Add(extension, propertyName);
+ clientScriptExtensions.Add(typeof(T), propertyName);
}
/// <summary>