Guest User

Untitled

a guest
Nov 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. IResourcePolicy irp(instantiated interface)
  2. irp.WrmVersion = "10.4";
  3.  
  4. public interface IResourcePolicy
  5. {
  6. string Version
  7. {
  8. get;
  9. set;
  10. }
  11. }
  12.  
  13. public interface IResourcePolicy
  14. {
  15. string Version { get; set; }
  16. }
  17.  
  18. public class ResourcePolicy : IResourcePolicy
  19. {
  20. public string Version { get; set; }
  21. }
  22.  
  23. class MyResourcePolicy : IResourcePolicy {
  24. private string version;
  25.  
  26. public string Version {
  27. get {
  28. return this.version;
  29. }
  30. set {
  31. this.version = value;
  32. }
  33. }
  34. }
  35.  
  36. using System;
  37. interface IName
  38. {
  39. string Name { get; set; }
  40. }
  41.  
  42. class Employee : IName
  43. {
  44. public string Name { get; set; }
  45. }
  46.  
  47. class Company : IName
  48. {
  49. private string _company { get; set; }
  50. public string Name
  51. {
  52. get
  53. {
  54. return _company;
  55. }
  56. set
  57. {
  58. _company = value;
  59. }
  60. }
  61. }
  62.  
  63. class Client
  64. {
  65. static void Main(string[] args)
  66. {
  67. IName e = new Employee();
  68. e.Name = "Tim Bridges";
  69.  
  70. IName c = new Company();
  71. c.Name = "Inforsoft";
  72.  
  73. Console.WriteLine("{0} from {1}.", e.Name, c.Name);
  74. Console.ReadKey();
  75. }
  76. }
  77. /*output:
  78. Tim Bridges from Inforsoft.
  79. */
  80.  
  81. private string version = "10.4';
Add Comment
Please, Sign In to add comment