Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r555 -r556 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 555) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 556) @@ -14,7 +14,7 @@ // - UserServerService type - TUserServerServiceContext = class(TSubject) + TUserContext = class(TSubject) private FSessionKey: string; FGebruikersNaam: string; @@ -23,34 +23,59 @@ FErrorMessage: string; FInternalErrorMessage: string; public - procedure Changed(); + procedure NotifyChanged(); property SessionKey: string read FSessionKey write FSessionKey; property GebruikersNaam: string read FGebruikersNaam write FGebruikersNaam; property IsOK: Boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; end; + TProductsContext = class(TSubject) + private + FSessionKey: string; + FDataSet: TObject; + + FIsOK: Boolean; + FErrorMessage: string; + FInternalErrorMessage: string; + public + procedure NotifyChanged(); + property DataSet: TObject read FDataSet write FDataSet; + + property IsOK: Boolean read FIsOK write FIsOK; + property ErrorMessage: string read FErrorMessage write FErrorMessage; + property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; + end; + // APPLICATION CONTEXT // Application context bevat alle sub-contexts TApplicationContext = class private - FUserServerServiceContext: TUserServerServiceContext; + FUserContext: TUserContext; + FProductsContext: TProductsContext; public constructor Create(); - property UserServerServiceContext: TUserServerServiceContext read FUserServerServiceContext write FUserServerServiceContext; + property UserContext: TUserContext read FUserContext write FUserContext; + property ProductsContext: TProductsContext read FProductsContext write FProductsContext; end; implementation -procedure TUserServerServiceContext.Changed(); +procedure TUserContext.NotifyChanged(); begin self.Change(); end; +procedure TProductsContext.NotifyChanged(); +begin + self.Change(); +end; + constructor TApplicationContext.Create(); begin - FUserServerServiceContext := TUserServerServiceContext.Create(); + FUserContext := TUserContext.Create(); + FProductsContext := TProductsContext.Create(); end; end.