GenericIdentity.cs 974 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // System.Security.Principal.GenericIdentity.cs
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. namespace System.Security.Principal {
  10. [Serializable]
  11. public class GenericIdentity : IIdentity {
  12. string user_name;
  13. string authentication_type;
  14. public GenericIdentity (string user_name, string authentication_type)
  15. {
  16. if (user_name == null)
  17. throw new ArgumentNullException ("user_name");
  18. if (authentication_type == null)
  19. throw new ArgumentNullException ("authentication_type");
  20. this.user_name = user_name;
  21. this.authentication_type = authentication_type;
  22. }
  23. public GenericIdentity (string name) : this (name, "")
  24. {
  25. }
  26. public virtual string AuthenticationType {
  27. get {
  28. return authentication_type;
  29. }
  30. }
  31. public virtual string Name {
  32. get {
  33. return user_name;
  34. }
  35. }
  36. public virtual bool IsAuthenticated {
  37. get {
  38. return (user_name != "");
  39. }
  40. }
  41. }
  42. }