IdDsnPropEdBinding.pas 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. Rev 1.9 10/26/2004 8:45:26 PM JPMugaas
  18. Should compile.
  19. Rev 1.8 10/26/2004 8:42:58 PM JPMugaas
  20. Should be more portable with new references to TIdStrings and TIdStringList.
  21. Rev 1.7 5/19/2004 10:44:28 PM DSiders
  22. Corrected spelling for TIdIPAddress.MakeAddressObject method.
  23. Rev 1.6 2/3/2004 11:34:26 AM JPMugaas
  24. Should compile.
  25. Rev 1.5.1.0 2/3/2004 11:32:26 AM JPMugaas
  26. Should compile.
  27. Rev 1.5 2/1/2004 2:44:20 AM JPMugaas
  28. Bindings editor should be fully functional including IPv6 support.
  29. Rev 1.4 2/1/2004 1:03:34 AM JPMugaas
  30. This now work properly in both Win32 and DotNET. The behavior had to change
  31. in DotNET because of some missing functionality and because implementing that
  32. functionality creates more problems than it would solve.
  33. Rev 1.3 2003.12.31 10:42:22 PM czhower
  34. Warning removed
  35. Rev 1.2 10/15/2003 10:12:32 PM DSiders
  36. Added localization comments.
  37. Rev 1.1 2003.10.11 5:47:46 PM czhower
  38. -VCL fixes for servers
  39. -Chain suport for servers (Super core)
  40. -Scheduler upgrades
  41. -Full yarn support
  42. Rev 1.0 11/13/2002 08:43:58 AM JPMugaas
  43. }
  44. unit IdDsnPropEdBinding;
  45. {
  46. Design Note: It turns out that in DotNET, there are no services file functions and
  47. IdPorts does not work as expected in DotNET. It is probably possible to read the
  48. services file ourselves but that creates some portability problems as the placement
  49. is different in every operating system.
  50. e.g.
  51. Linux and Unix-like systems - /etc
  52. Windows 95, 98, and ME - c:\windows
  53. Windows NT systems - c:\winnt\system32\drivers\etc
  54. Thus, it will undercut whatever benefit we could get with DotNET.
  55. About the best I could think of is to use an edit control because
  56. we can't offer anything from the services file in DotNET.
  57. TODO: Maybe there might be a way to find the location in a more elegant
  58. manner than what I described.
  59. }
  60. interface
  61. {$I IdCompilerDefines.inc}
  62. {$IFDEF WIDGET_WINFORMS}
  63. {$R 'IdDsnPropEdBindingNET.TIdDsnPropEdBindingNET.resources' 'IdDsnPropEdBindingNET.resx'}
  64. {$ENDIF}
  65. uses
  66. Classes,
  67. IdSocketHandle;
  68. {
  69. Design Note: It turns out that in DotNET, there are no services file functions and IdPorts
  70. does not work as expected in DotNET. It is probably possible to read the services
  71. file ourselves but that creates some portability problems as the placement is different
  72. in every operating system.
  73. e.g.
  74. Linux and Unix-like systems - /etc
  75. Windows 95, 98, and ME - c:\windows
  76. Windows NT systems - c:\winnt\system32\drivers\etc
  77. Thus, it will undercut whatever benefit we could get with DotNET.
  78. About the best I could think of is to use an edit control because
  79. we can't offer anything from the services file in DotNET.
  80. TODO: Maybe there might be a way to find the location in a more eligant
  81. manner than what I described.
  82. }
  83. procedure FillHandleList(const AList: string; ADest: TIdSocketHandles);
  84. function GetListValues(const ASocketHandles : TIdSocketHandles) : String;
  85. implementation
  86. uses
  87. {$IFDEF WIDGET_WINFORMS}
  88. IdDsnPropEdBindingNET;
  89. {$ELSE}
  90. IdDsnPropEdBindingVCL;
  91. {$ENDIF}
  92. procedure FillHandleList(const AList: string; ADest: TIdSocketHandles);
  93. begin
  94. {$IFDEF WIDGET_WINFORMS}
  95. IdDsnPropEdBindingNET.FillHandleList(AList,ADest);
  96. {$ELSE}
  97. IdDsnPropEdBindingVCL.FillHandleList(AList,ADest);
  98. {$ENDIF}
  99. end;
  100. function GetListValues(const ASocketHandles : TIdSocketHandles) : String;
  101. begin
  102. {$IFDEF WIDGET_WINFORMS}
  103. Result := IdDsnPropEdBindingNET.GetListValues(ASocketHandles);
  104. {$ELSE}
  105. Result := IdDsnPropEdBindingVCL.GetListValues(ASocketHandles);
  106. {$ENDIF}
  107. end;
  108. end.