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
Maybe I'm missing something really basic in the help...

I can add a "Date retired" attribute to my stereotype in my UML profile of type "date".  How do I enforce users to only enter a date (ie. dd/mm/yyyy) in the tagged value window when creating a new element based on my stereotype (from my UML profile?)

Thanks,
DAvid.

287
Thanks David,

I missed that method.  Looks like a much better approach.  I'll change both the user's EA SQL search and my code to call the same stored proc.

Cheers,
David.

288
Hi there,

Can Repository.GetElementsByQuery() run custom (ie. SQL) searches?

If not - can this facility be added?  It would be quite useful to utilise custom searches already defined in the EA interface (especially SQL ones).  The other option is have both the add-in and the custom search call the same stored procedure

David.

289
Hi David,

Thanks for your reply.  I tried casting one of the objects in the collection to an Element via adding a watch in Visual Studio during debuggin and Visual Studio barfed, ie:

result = rep.GetElementsByQuery("Simple", "<search term>");
(Element)(result.GetAt(0));

I'll try running in code incase it is a syntax issue with my casting or a runtime issue calling GetAt() within the watch window.

Cheers,
David.

290
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.

291
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.

292
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.

293
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.

294
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]