use centralized code/function as user code without delegatio

Ranorex Spy, Recorder, and Studio.
reiniuny
Posts: 23
Joined: Thu Jul 04, 2013 10:48 am

use centralized code/function as user code without delegatio

Post by reiniuny » Thu Jul 04, 2013 10:52 am

Hello!
I've written a class where I'm managing many functions I need in different tests.

To call these functions in a recording module, I've to create a UserCode function and delegate the call to the centralized function/class.


Is there a way to implement the centralized functions somewhere to make them available for all recording modules without the need for delegation?


Here's an example of the UserCode I'd like to avoid copying into each UserCode file:

Code: Select all

namespace Tests
{
    public partial class Create_Test
    {
        /// <summary>
        /// This method gets called right after the recording has been started.
        /// It can be used to execute recording specific initialization code.
        /// </summary>
        private void Init()
        {
            // Your recording specific initialization code goes here.
        }

        public void DoButtonClickAndWait()
        {
        	ToolsModule.DoButtonClickAndWait();
        }

    }
}

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: use centralized code/function as user code without delegatio

Post by Support Team » Fri Jul 05, 2013 10:10 am

Hello,

Would it be an option for you to inherit the methods of ToolsModule in your Recording?
Then, you could simply call these methods inside your Recording.
You would need to inherit each Recording User Code class.

Regards,
Markus (T)
.
Image

reiniuny
Posts: 23
Joined: Thu Jul 04, 2013 10:48 am

Re: use centralized code/function as user code without delegatio

Post by reiniuny » Fri Jul 05, 2013 10:44 am

If there is no other, more centralized way, this would be an acceptable solution for me.

But maybe you could plan such a feature for a future release?

Thank you very much for your support.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: use centralized code/function as user code without delegatio

Post by Support Team » Tue Jul 09, 2013 10:55 am

Hello,

I have forwarded your feature request to our development team.
I will keep you informed about any news on this.

Thank you.

Regards,
Markus (T)
.
Image