Author Topic: How to apply multiple stereotypes to one element  (Read 1528 times)

bilon

  • EA User
  • **
  • Posts: 55
  • Karma: +0/-0
    • View Profile
How to apply multiple stereotypes to one element
« on: May 28, 2015, 01:59:41 am »
Does anybody now?

qwerty

  • EA Guru
  • *****
  • Posts: 9838
  • Karma: +190/-155
  • I'm no guru at all
    • View Profile
Re: How to apply multiple stereotypes to one eleme
« Reply #1 on: May 28, 2015, 02:08:41 am »
Use the ellipsis button right to the stereotype properties field. Or use a comma to separate them textually on entry.

q.
« Last Edit: May 28, 2015, 02:09:14 am by qwerty »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2549
  • Karma: +34/-2
    • View Profile
Re: How to apply multiple stereotypes to one eleme
« Reply #2 on: May 28, 2015, 09:05:13 am »
...or drag from the Toolbox onto a stereotyped element on a diagram and choose "Apply" when asked
The Sparx Team
support@sparxsystems.com

bilon

  • EA User
  • **
  • Posts: 55
  • Karma: +0/-0
    • View Profile
Re: How to apply multiple stereotypes to one eleme
« Reply #3 on: May 28, 2015, 08:36:11 pm »
Thansks for your reply, but this not what I've asked about. I want to know, how to accomplish this in scripting. It means, I'm looking for methods in EA object model, that support this.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8623
  • Karma: +211/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to apply multiple stereotypes to one eleme
« Reply #4 on: May 28, 2015, 08:58:40 pm »
Quote
Thansks for your reply, but this not what I've asked about. I want to know, how to accomplish this in scripting. It means, I'm looking for methods in EA object model, that support this.
It was in fact an answer to your question, but probably not what you wanted to know.

Here's the code from the wrapper on EA.Element I use to manage stereotypes

Code: [Select]
       /// <summary>
        /// returns a list of all stereotypes
        /// </summary>
        /// <returns>a list of stereotypes</returns>
        public override List<string> stereotypes
        {
            get
            {
                List<string> stereotypeList = new List<string>();
                string stereotypeSingle = this.wrappedElement.Stereotype;
                if (string.IsNullOrEmpty(this.wrappedElement.StereotypeEx))
                {
                    if (!string.IsNullOrEmpty(stereotypeSingle))
                    {
                        stereotypeList.Add(stereotypeSingle);
                    }
                }
                else
                {
                    string stereotypes = this.wrappedElement.StereotypeEx;
                    stereotypeList.AddRange(stereotypes.Split(new char[] { ',' }));
                }
                return stereotypeList;
            }
            set
            {
                this.wrappedElement.StereotypeEx = string.Join(",", value.ToArray());
            }
        }

Geert