@@ -24,11 +24,11 @@ namespace ActiveUp.Net.Mail
2424 /// <summary>
2525 /// EventHandler to be used with the Authenticating event.
2626 /// </summary>
27- public delegate void AuthenticatingEventHandler ( object sender , AuthenticatingEventArgs e ) ;
27+ public delegate void AuthenticatingEventHandler ( object sender , AuthenticatingEventArgsBase e ) ;
2828 /// <summary>
2929 /// EventHandler to be used with the Authenticated event.
3030 /// </summary>
31- public delegate void AuthenticatedEventHandler ( object sender , AuthenticatedEventArgs e ) ;
31+ public delegate void AuthenticatedEventHandler ( object sender , AuthenticatedEventArgsBase e ) ;
3232 /// <summary>
3333 /// EventHandler to be used with the Nooping event.
3434 /// </summary>
@@ -559,10 +559,49 @@ public string Response
559559#if ! PocketPC
560560 [ System . Serializable ]
561561#endif
562- public class AuthenticatedEventArgs : System . EventArgs
562+
563+
564+ public class AuthenticatedEventArgsBase : System . EventArgs
563565 {
564- string _username , _password , _host , _serverResponse ;
566+ protected string _username , _password , _host , _serverResponse ;
567+ /// <summary>
568+ /// The username used to authenticate the user.
569+ /// </summary>
565570
571+ public string Username
572+ {
573+ get
574+ {
575+ return _username ;
576+ }
577+ }
578+
579+ /// <summary>
580+ /// The address of the remote server.
581+ /// </summary>
582+ public string Host
583+ {
584+ get
585+ {
586+ return _host ;
587+ }
588+ }
589+
590+ /// <summary>
591+ /// The server's response
592+ /// </summary>
593+ public string ServerResponse
594+ {
595+ get
596+ {
597+ return _serverResponse ;
598+ }
599+ }
600+ }
601+
602+ public class AuthenticatedEventArgs : AuthenticatedEventArgsBase
603+ {
604+
566605 /// <summary>
567606 /// Constructor.
568607 /// </summary>
@@ -591,56 +630,84 @@ public AuthenticatedEventArgs(string username, string password, string serverRes
591630 _serverResponse = serverResponse ;
592631 }
593632 /// <summary>
594- /// The username used to authenticate the user.
633+ /// The password used to authenticate the user.
595634 /// </summary>
596- public string Username
635+ public string Password
597636 {
598637 get
599638 {
600- return _username ;
639+ return _password ;
601640 }
602641 }
642+
643+ }
644+
645+ public class AuthenticatedOAuth2EventArgs : AuthenticatedEventArgsBase
646+ {
603647 /// <summary>
604- /// The password used to authenticate the user .
648+ /// Constructor .
605649 /// </summary>
606- public string Password
650+ /// <param name="username">Username used to authenticate the user.</param>
651+ /// <param name="host">Address of the remote server.</param>
652+ /// <param name="serverResponse">The server response to the PASS command.</param>
653+ public AuthenticatedOAuth2EventArgs ( string username , string host , string serverResponse )
607654 {
608- get
609- {
610- return _password ;
611- }
655+ _username = username ;
656+ _host = host ;
657+ _serverResponse = serverResponse ;
612658 }
613659 /// <summary>
614- /// The address of the remote server .
660+ /// Constructor .
615661 /// </summary>
616- public string Host
662+ /// <param name="username">Username used to authenticate the user.</param>
663+ /// <param name="serverResponse">The server response to the PASS command.</param>
664+ public AuthenticatedOAuth2EventArgs ( string username , string serverResponse )
665+ {
666+ _username = username ;
667+ _host = "unknown" ;
668+ _serverResponse = serverResponse ;
669+ }
670+
671+ }
672+ /// <summary>
673+ /// Represents a future authentication process.
674+ /// </summary>
675+ #if ! PocketPC
676+ [ System . Serializable ]
677+ #endif
678+
679+
680+ public class AuthenticatingEventArgsBase : System . EventArgs
681+ {
682+ protected string _username , _host ;
683+
684+ /// <summary>
685+ /// The username used to authenticate the user.
686+ /// </summary>
687+ public string Username
617688 {
618689 get
619690 {
620- return _host ;
691+ return _username ;
621692 }
622693 }
694+
623695 /// <summary>
624- /// The server's response
696+ /// The address of the remote server.
625697 /// </summary>
626- public string ServerResponse
698+ public string Host
627699 {
628700 get
629701 {
630- return _serverResponse ;
702+ return _host ;
631703 }
632704 }
705+
633706 }
634707
635- /// <summary>
636- /// Represents a future authentication process.
637- /// </summary>
638- #if ! PocketPC
639- [ System . Serializable ]
640- #endif
641- public class AuthenticatingEventArgs : System . EventArgs
708+ public class AuthenticatingEventArgs : AuthenticatingEventArgsBase
642709 {
643- string _username , _password , _host ;
710+ string _password ;
644711
645712 /// <summary>
646713 /// Constructor.
@@ -665,37 +732,45 @@ public AuthenticatingEventArgs(string username, string password)
665732 _password = password ;
666733 _host = "unkwown" ;
667734 }
735+
668736 /// <summary>
669- /// The username used to authenticate the user.
737+ /// The password used to authenticate the user.
670738 /// </summary>
671- public string Username
739+ public string Password
672740 {
673741 get
674742 {
675- return _username ;
743+ return _password ;
676744 }
677745 }
746+ }
747+
748+ public class AuthenticatingOAuth2EventArgs : AuthenticatingEventArgsBase
749+ {
678750 /// <summary>
679- /// The password used to authenticate the user .
751+ /// Constructor .
680752 /// </summary>
681- public string Password
753+ /// <param name="username">Username used to authenticate the user.</param>
754+ /// <param name="token">Password used to authenticate the user.</param>
755+ /// <param name="host">Address of the remote server.</param>
756+ public AuthenticatingOAuth2EventArgs ( string username , string host )
682757 {
683- get
684- {
685- return _password ;
686- }
758+ _username = username ;
759+ _host = host ;
687760 }
761+
688762 /// <summary>
689- /// The address of the remote server .
763+ /// Constructor .
690764 /// </summary>
691- public string Host
765+ /// <param name="username">Username used to authenticate the user.</param>
766+ /// <param name="token">Password used to authenticate the user.</param>
767+ public AuthenticatingOAuth2EventArgs ( string username )
692768 {
693- get
694- {
695- return _host ;
696- }
769+ _username = username ;
770+ _host = "unkwown" ;
697771 }
698772 }
773+
699774 /*/// <summary>
700775 /// EventArgs used by the ArticleRetrieved event.
701776 /// </summary>
0 commit comments