- Cambiado el formato de fechas 'mm/dd/yyyy' a 'dd/mm/yyyy'. git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.UserControl@14 970f2627-a9d2-4748-b3d4-b5283c4fe7db
75 lines
1.4 KiB
ObjectPascal
75 lines
1.4 KiB
ObjectPascal
unit UCMidasConnReg;
|
|
|
|
interface
|
|
|
|
{$I '..\..\Source\UserControl.inc'}
|
|
|
|
uses
|
|
Classes,
|
|
DesignEditors,
|
|
DesignIntf,
|
|
TypInfo;
|
|
|
|
type
|
|
TUCProviderNameProperty = class(TStringProperty)
|
|
function GetAttributes: TPropertyAttributes; override;
|
|
procedure GetValues(Proc: TGetStrProc); override;
|
|
end;
|
|
|
|
procedure Register;
|
|
|
|
implementation
|
|
|
|
uses
|
|
Midas,
|
|
UCMidasConn,
|
|
Variants;
|
|
|
|
procedure Register;
|
|
begin
|
|
RegisterComponents('UC Connectors', [TUCMidasConn]);
|
|
RegisterPropertyEditor(TypeInfo(String), TUCMidasConn, 'ProviderName', TUCProviderNameProperty);
|
|
end;
|
|
|
|
{ TUCProviderNameProperty }
|
|
|
|
function TUCProviderNameProperty.GetAttributes: TPropertyAttributes;
|
|
begin
|
|
Result := [paValueList];
|
|
end;
|
|
|
|
procedure TUCProviderNameProperty.GetValues(Proc: TGetStrProc);
|
|
var
|
|
Componente: TComponent;
|
|
Lista: variant;
|
|
I: Integer;
|
|
begin
|
|
Componente := TComponent(GetComponent(0));
|
|
|
|
if not Assigned(Componente) then
|
|
Exit;
|
|
|
|
if not (Componente is TUCMidasConn) then
|
|
Exit;
|
|
|
|
if not Assigned(TUCMidasConn(Componente).Connection) then
|
|
Exit;
|
|
|
|
with TUCMidasConn(Componente) do
|
|
begin
|
|
|
|
try
|
|
Lista := IAppServer(Connection.GetServer).AS_GetProviderNames;
|
|
except
|
|
end;
|
|
|
|
if VarIsArray(Lista) and (VarArrayDimCount(Lista) = 1) then
|
|
for I := VarArrayLowBound(Lista, 1) to VarArrayHighBound(Lista, 1) do
|
|
Proc(Lista[I]);
|
|
|
|
end;
|
|
end;
|
|
|
|
end.
|
|
|