Author Topic: EA_OnPostInitialized: call openFile.. before  (Read 3714 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13084
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
EA_OnPostInitialized: call openFile.. before
« on: November 27, 2010, 01:45:57 am »
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
Code: [Select]
       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

alesliehughes

  • EA Administrator
  • EA User
  • *****
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: EA_OnPostInitialized: call openFile.. before
« Reply #1 on: November 29, 2010, 10:36:56 am »
Hi Geert,

I can confirm it as an issue.

Alistair

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13084
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA_OnPostInitialized: call openFile.. before
« Reply #2 on: November 29, 2010, 02:38:02 pm »
Allright, thanks, I'll have to work around it for the moment then.

Geert