Dynamicweb.Notifications Namespace : Standard.User.OnExtranetLoginFailedArgs Class |
'Declaration
Public Class Standard.User.OnExtranetLoginFailedArgs Inherits Dynamicweb.Extensibility.NotificationArgs
public class Standard.User.OnExtranetLoginFailedArgs : Dynamicweb.Extensibility.NotificationArgs
using System; namespace Dynamicweb.Examples.CSharp.Notifications.Standard { [Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed)] public class OnExtranetLoginFailedObserver : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args) { if (args == null) return; if (!(args is Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)) return; Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)args; //Throw exception if login is incorrect if(item.Reason == Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs.FailReason.IncorrectLogin) throw new Exception("IncorrectLogin"); } } }
Imports System Namespace Notifications.Standard <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed)> _ Public Class OnExtranetLoginFailedObserver Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs) If args Is Nothing Then Return End If If Not (TypeOf args Is Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs) Then Return End If Dim item As Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs) 'Throw exception if login is incorrect If item.Reason = Global.Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs.FailReason.IncorrectLogin Then Throw New Exception("IncorrectLogin") End If End Sub End Class End Namespace
System.Object
Dynamicweb.Extensibility.NotificationArgs
Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs
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