Hi,
I have once scenario where I want to pass parameter as below
Call Method(repo.organizer);
Call Method1(repo.Start)
Method(RepoScanConsoleFolders.OrganizerViewFolder seg1)
{
// some peice of code
}
Method1(RepoScanConsoleFolders.StartFolder seg2)
{
// some peice of code
}
I want to generalize the called method so that i can pass any repository type data rather calling method(), method1() separately.
Can you please help me out.
How to generalize the repository content
How to generalize the repository content
Last edited by subodh4u7 on Wed Oct 28, 2015 6:41 am, edited 1 time in total.
Regards,
Subodh
Subodh
Re: How to generalize the repository content
I don't know the best approach to this, but what I have been doing is to pass in the RepoItemInfo and creating an adapter from it. From there, you will interact with the adapter.
Hope this helps.
Code: Select all
Method(Ranorex.Core.Repository.RepoItemInfo myRepoItemInfo)
{
Ranorex.Adapter myAdapter;
if (myRepoItemInfo.Exist())
myAdapter = myRepoItemInfo.CreateAdapter<Ranorex.Adapter>();
else
return someErrorState;
// code to do something with myAdapter
}