Book a Demo

Author Topic: Set connector.Direction  (Read 3554 times)

Lilleberg

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Set connector.Direction
« on: October 03, 2008, 11:54:23 pm »
Hi!

I have tried to set the value of the connector.Direction to "Source -> Destination" without any success. The connector.Stereotypes are "send" or "Received by" in these cases.

It might be a bug. Here's my code:

EA.Connector connector = null;
connector = m_Repository.GetConnectorByID(dLink.ConnectorID);

if (connector.Stereotype.ToString() == "Sends" || connector.Stereotype.ToString() == "Received by")
{
  connector.Direction = "Source -> Destination";

  if (!connector.Update())
  {
       MessageBox.Show("Error thrown during the update of the  Connector in the function CreateDirectionToConnectors: " + connector.GetLastError().ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  }
}


Please let me know if the is a bug or not.
Thanks!
/Johannes

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Set connector.Direction
« Reply #1 on: October 04, 2008, 09:50:58 am »
Try updating the connector before you query the stereotype. I suspect without proof that the error is happening before you even attempt to assign the direction.
No, you can't have it!

Lilleberg

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Set connector.Direction
« Reply #2 on: October 10, 2008, 11:17:12 pm »
Thanks. Your solution solved my problem!