Get RepoItemInfo from RepoItem

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
QaTester
Posts: 11
Joined: Fri Nov 08, 2013 8:03 pm

Get RepoItemInfo from RepoItem

Post by QaTester » Fri Feb 28, 2014 9:11 pm

Is there a way to instantiate an instance of a RepoItemInfo with the actual repo item itself.

Say for instance I have a repo item:
var repo = myRepo.Instance;
var table = repo.Table;
Is there anyway to derive the tableInfo object from the table object?

Right now I'm getting the RepoItemInfo like this:
var tableInfo = repo.TableInfo;
which is fine in this example, but our actual Repo is very deep with folders so I would like to avoid having to instantiate it that way every time.

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Get RepoItemInfo from RepoItem

Post by Swisside » Mon Mar 03, 2014 11:06 am

Hello

Does something like table.SelfInfo work for you?


Regards
A simple thank you always does wonders !

QaTester
Posts: 11
Joined: Fri Nov 08, 2013 8:03 pm

Re: Get RepoItemInfo from RepoItem

Post by QaTester » Mon Mar 03, 2014 8:21 pm

Unfortunately it does not.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Get RepoItemInfo from RepoItem

Post by Support Team » Wed Mar 05, 2014 10:34 am

Hi QaTester,
I’m not sure if I understand your issue correctly but I would suggest to simple instantiate the folder which holds the desired “ElementInfo” object in order to overcome the issue with the deep path.
E.g.:
var folder = repo.a.b.c.d;
var ElementInfo = folder.ElementInfo;
Regards,
Robert

QaTester
Posts: 11
Joined: Fri Nov 08, 2013 8:03 pm

Re: Get RepoItemInfo from RepoItem

Post by QaTester » Thu Mar 06, 2014 7:36 pm

My issue is that I would like to achieve what Swisside was talking about, wherein I am able to get to an object's Info through the actual object.

so something like..
var table = repo.table
var tableInfo = table.Info

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Get RepoItemInfo from RepoItem

Post by Support Team » Fri Mar 07, 2014 3:38 pm

Hi,

Unfortunately it is not possible to create an info object out of a repo item but you it works the other way round. :)
You can create an adapter out of the info object.
var elementInfo = repo.ElementInfo;
var element = elementInfo.CreateAdapter<Unknown>(false);
Regards,
Robert