Dynamicweb.Modules.UserManagement Namespace : ValidateUserNotificationArgs Class |
'Declaration
Public Class ValidateUserNotificationArgs Inherits Dynamicweb.Extensibility.NotificationArgs
public class ValidateUserNotificationArgs : Dynamicweb.Extensibility.NotificationArgs
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Modules.UserManagement.Notifications.UserValidated)] public class ValidateUserObserver1 : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args) { if (args == null || !(args is Dynamicweb.Modules.UserManagement.ValidateUserNotificationArgs)) return; Dynamicweb.Modules.UserManagement.ValidateUserNotificationArgs item = (Dynamicweb.Modules.UserManagement.ValidateUserNotificationArgs)args; Dynamicweb.Modules.UserManagement.User user = item.Subject; Dictionary<string, Dynamicweb.Modules.UserManagement.UMFormField> error = item.Errors; if(!Dynamicweb.Base.ValidateEmail(user.Email)) { string key = string.Format("UserManagement_Form_{0}", "Email2"); error.Add(key, new Dynamicweb.Modules.UserManagement.UMFormField(key, "Email", "The email is not valid from. Custom! ")); } } }
System.Object
Dynamicweb.Extensibility.NotificationArgs
Dynamicweb.Modules.UserManagement.ValidateUserNotificationArgs
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2