Book a Demo

Author Topic: Add user control form in Enterprise Architecture  (Read 5518 times)

alexander komakula

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Add user control form in Enterprise Architecture
« on: April 08, 2011, 09:13:16 pm »
Hi,
i want to add user control form in EA using visual c#.i have created a usercontrol and the code for accesing it is below.FVGusercontrol is the control name.

private FVGUserControl _uiControl = new FVGUserControl();
 if (_uiControl == null)
                {
                    _uiControl = (FVGUserControl)Repository.AddTab(FVGUserControl.ControlTabName, FVGUserControl.ControlIdentifier);
                    if (_uiControl == null) log.Error("Could not create a tab.");
                }

here repository.AddTab was returning null.


Kindly reply if any one knows how to solve the problem

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: Add user control form in Enterprise Architectu
« Reply #1 on: April 09, 2011, 02:32:57 am »
i actually dont know what you want to achieve.
what is the method repository.addTab doing?
For my Addin i only use my own C# Forms to manipulate EA data.

alexander komakula

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Add user control form in Enterprise Architectu
« Reply #2 on: April 11, 2011, 04:50:39 pm »
i want the user control to be viewed in new tab of Enterprise architecture.here Repository.AddTab should return the user control but its not returning.i must have done some mistake in code so kindly help if any one knows

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Add user control form in Enterprise Architectu
« Reply #3 on: April 12, 2011, 12:07:08 am »
I once tried that, but long ago. AFAIR it worked once upon a time. Now I tested once again. The window is created, but the return value is nil. Probably you should report that as a bug to Sparx.

N.B. Somehow it must work as (at least one) add-in provider is using it.

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Add user control form in Enterprise Architectu
« Reply #4 on: April 12, 2011, 09:29:29 am »
Most likely EA has not been able to create the control based on the name you have passed to AddTab.  Can you confirm the exact value of the second parameter being passed to AddTab?

The ControlID value should typically be like [project name].[control name].

For an example, see:
http://www.sparxsystems.com/enterprise_architect_user_guide/8.0/automation_and_scripts/creatingacustomview.html
« Last Edit: April 12, 2011, 09:29:57 am by AaronB »