Still not working

Here is my code :
-------------------------------------
Repository repo = new Repository();
repo.ShowWindow(1);
boolean b = repo.OpenFile("mytest.eap");
Collection<Package> c = repo.GetModels();
Package pkg = c.GetAt((short)0);
String modelName = pkg.GetName();
Package p = (Package) pkg.GetPackages().AddNew("MyPkgName", "Nothing");
pkg.GetElements().Refresh();
pkg.Update();
repo.CloseFile();
repo.Exit();
-----------------------------------------------
The first line (call of "new Repository()") launches the "Evaluation Version of Entreprise Architect" window. I click "Continue Trial"
The second line (repo.ShowWindow(1)) does nothing
b is true : seems ok
modelName is the name of my model : seems ok
the new package I create seems ok
But at the end of the program nothing has changed : my model has not been changed.