Author Topic: How to find out if a project is loaded?  (Read 6017 times)

Kobus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • In complete darkness we are all the same!
    • View Profile
How to find out if a project is loaded?
« on: January 11, 2005, 01:29:15 pm »
If no project is loaded/opened in EA, I want to disable some menu items in my add-in. Is there anyway to find out if a project is loaded or not?

Best regards,

Kobus.
Thanx and best regards,

Kobus.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: How to find out if a project is loaded?
« Reply #1 on: January 11, 2005, 01:56:01 pm »
Repository.ConnectionString will hold the name of the model that's open. If none, it will be a zero-length string.
The Sparx Team
[email protected]

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: How to find out if any project is loaded?
« Reply #2 on: January 11, 2005, 03:53:57 pm »
Just want to change the subject of this (I know I'll be looking for it in 3 mths time  ;) )
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Kobus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • In complete darkness we are all the same!
    • View Profile
Re: How to find out if a project is loaded?
« Reply #3 on: January 12, 2005, 12:29:54 am »
I'm using EA 4.0 and it seems the Repository interface doesn't have a ConnectionString property!

Any other thoughts or am I missing something?
Thanx and best regards,

Kobus.

Kobus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • In complete darkness we are all the same!
    • View Profile
Re: How to find out if a project is loaded?
« Reply #4 on: January 12, 2005, 08:15:35 am »
As a workaround I now check if IRepository.GetTreeSelectedPackage is assigned.

It seems that this function always returns a value <> nil when a project is loaded, and nil if not.
Thanx and best regards,

Kobus.