Page 1 of 1

Get RepoItemInfo from RepoItem

Posted: Fri Feb 28, 2014 9:11 pm
by QaTester
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.

Re: Get RepoItemInfo from RepoItem

Posted: Mon Mar 03, 2014 11:06 am
by Swisside
Hello

Does something like table.SelfInfo work for you?


Regards

Re: Get RepoItemInfo from RepoItem

Posted: Mon Mar 03, 2014 8:21 pm
by QaTester
Unfortunately it does not.

Re: Get RepoItemInfo from RepoItem

Posted: Wed Mar 05, 2014 10:34 am
by Support Team
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

Re: Get RepoItemInfo from RepoItem

Posted: Thu Mar 06, 2014 7:36 pm
by QaTester
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

Re: Get RepoItemInfo from RepoItem

Posted: Fri Mar 07, 2014 3:38 pm
by Support Team
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