Page 1 of 1

use centralized code/function as user code without delegatio

Posted: Thu Jul 04, 2013 10:52 am
by reiniuny
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();
        }

    }
}

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

Posted: Fri Jul 05, 2013 10:10 am
by Support Team
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)

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

Posted: Fri Jul 05, 2013 10:44 am
by reiniuny
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.

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

Posted: Tue Jul 09, 2013 10:55 am
by Support Team
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)