I'm creating an addin to prevent accidental stereotype creation, and the moment the model is loaded I want to create a list of the defined stereotypes.
I thought it would be a good idea to put it in the event EA_OnPostInitialized because it says the model is fully loaded at that moment, but I get an error:
EA_OnPostInitialized: Call OpenFile() or OpenFile2() before accessing other Repository members.
So if I cant use the repository yet, whats the point of this event?
Here's the code I'm using on 8.0.862
public void EA_OnPostInitialized(EA.Repository Repository)
{
//make sure the list is empty when connecting
existingStereotypes = new Dictionary<string, EA.Stereotype>();
foreach (EA.Stereotype stereotype in Repository.Stereotypes)
{
existingStereotypes.Add(stereotype.StereotypeGUID, stereotype);
}
}
Anyone who successfully used the EA_OnPostInitialized operation?
Geert