Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dave_Bullet

Pages: 1 ... 18 19 [20]
286
I know Repository.GetElementsByQuery returns an EA.Collection - but what types of objects are returned and how can I access their properties?

I'm pretty rusty at programming and learning C#.  I can't for the life of me figure out how to inspect the returned collection to find the underlying object types returned.

The collection contains a count of 5 after the method call and objecttype = otCollection.  What I want to know is what type of objects are contained in the collection so I can cast and use them appropriately.

Thanks,
David.

287
Thanks Paolo,

I'll give it a try, however I think the DB error will be returned to EA (and not the add-in) which in most cases when you monkey with the EA database in ways EA doesn't expect, EA crashes (it uses a lot of "select *" in embedded SQL, rather than named columns in result sets - or even better, SPs).

Thanks,
David.

288
Has anyone got any ideas to help me here please?

What I need is a consistent way of detecting the addition of a duplicate element, and prevent (or delete post creation).

Thanks,
David.

289
I'm trying to write an add-in to detect when a user creates a duplicate element (ie. same stereotype / type and name).

There are 2 ways a user can create an element - drag/drop from the toolbox onto a diagram or adding to a package via the project browser.

I can use the EA_OnPreNewElement event from the project browser as that fires after the prompt for the new element name.  I can check for a duplicate, prompt the user and cancel and the element is not created.

Problem is when an element is created via the toolbox - drag & drop to a diagram.  In this case, the "Pre" event is created before the element is created - but this is no use as it uses EA default element name.  The "Post" even then fires, and then the dialog is displayed to the user to get the element name.  No further events fire.

I need to be able to either prevent the creation of a duplicate element via the toolbox - or do a retrospective delete on the duplicate.  Problem is - no further events fire that I can capture / use (short of a workaround like posting an asynchronous call or monitoring windows level messages...)

Any ideas?  Or could this be a feature request to Sparx to implement the event calling order consistently between the two ways of adding the element (especially the post event - which happens in one case (projetc browser) after the dialog to edit element details, and in the other case before)(toolbox drag / drop).

Thanks,
David.

290
If you are a registered user, simply login and you'll see the Visio beta link under the second heading "Beta products released".  Yes - it appears the Visio add-in is still beta.  (I can't find it anywhere in the EA download section)

Cheers,
David.

Pages: 1 ... 18 19 [20]