Author Topic: Can we sort a collection?  (Read 2623 times)

pH

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Can we sort a collection?
« on: September 24, 2010, 09:47:02 pm »
Hi,
Can we sort a collection of element properties with in addin code?
I see many scenarios where sorting is required like sorting some elements in specific order or ordering attributes or operations,pre-conditions/ post-conditions or basic/alternate path, or the packages itself.

Thanks,
pH
<a href="http://webuml.org"><img src="http://webuml.org/images/webuml-badge.png" alt="Set UML Free!" style="border-width:0"></a>

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can we sort a collection?
« Reply #1 on: September 27, 2010, 03:39:04 pm »
pH,

You can, but not by trying to sort the actual EA.Collection. (if you have suicidal tendencies, then by all means go ahead and try to sort the EA.Collection :-X)
Each of those elements has its own sorting property. Attributes and Operations can be sorted using their Pos attribute.
For Elements within a package use TreePos, ...

Geert