unit LBDSystem;
interface
uses
classes;
type
TLBDSystem = class
private
FBusyBy: String;
FCurrentUser: String;
FGSMNumber: String;
FDirection: Integer;
FBusy: boolean;
FOnAfterChangeBusy: TNotifyEvent;
FOnBeforeChangeBusy: TNotifyEvent;
FOnBeforeReadBusy: TNotifyEvent;
FOnAfterReadBusy: TNotifyEvent;
function GetBusy: boolean;
procedure SetBusy(const Value: boolean);
procedure SetOnAfterChangeBusy(const Value: TNotifyEvent);
procedure SetOnBeforeChangeBusy(const Value: TNotifyEvent);
procedure SetOnAfterReadBusy(const Value: TNotifyEvent);
procedure SetOnBeforeReadBusy(const Value: TNotifyEvent);
public
{Directions are
0 : No Direction
1 : Incoming GSM to Skype (In route list)
2 : Incoming GSM to Skype (Out of route list)
3 : All Incoming are transfer to one Skype account
11: Skype -> GSM (User sent DIAL command}
property Direction: Integer read FDirection write FDirection;
property GSMNumber: String read FGSMNumber write FGSMNumber;
property CurrentUser: String read FCurrentUser write FCurrentUser;
property BusyBy: String read FBusyBy write FBusyBy;
property Busy: boolean read GetBusy write SetBusy;
property OnBeforeChangeBusy: TNotifyEvent read FOnBeforeChangeBusy
write SetOnBeforeChangeBusy; // перед изменением
property OnAfterChangeBusy: TNotifyEvent read FOnAfterChangeBusy
write SetOnAfterChangeBusy; // после изменения
property OnBeforeReadBusy: TNotifyEvent read FOnBeforeReadBusy
write SetOnBeforeReadBusy; // перед чтением
property OnAfterReadBusy: TNotifyEvent read FOnAfterReadBusy
write SetOnAfterReadBusy; // после чтения
end;
implementation
{ TLBDSystem }
function TLBDSystem.GetBusy: boolean;
begin
if Assigned(FOnBeforeReadBusy) then
FOnBeforeReadBusy(Self);
Result := FBusy;
if Assigned(FOnAfterReadBusy) then
FOnAfterReadBusy(Self);
end;
procedure TLBDSystem.SetBusy(const Value: boolean);
begin
if Assigned(FOnBeforeChangeBusy) then
FOnBeforeChangeBusy(Self);
if FBusy <> Value then
begin
FBusy := Value;
if Assigned(FOnAfterChangeBusy) then
FOnAfterChangeBusy(Self);
end;
end;
procedure TLBDSystem.SetOnAfterChangeBusy(const Value: TNotifyEvent);
begin
FOnAfterChangeBusy := Value;
end;
procedure TLBDSystem.SetOnAfterReadBusy(const Value: TNotifyEvent);
begin
FOnAfterReadBusy := Value;
end;
procedure TLBDSystem.SetOnBeforeChangeBusy(const Value: TNotifyEvent);
begin
FOnBeforeChangeBusy := Value;
end;
procedure TLBDSystem.SetOnBeforeReadBusy(const Value: TNotifyEvent);
begin
FOnBeforeReadBusy := Value;
end;
end.