Ranorex

inheritance

 
Post new topic   Reply to topic    Ranorex Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
jabelshauser



Joined: 23 Aug 2007
Posts: 16

PostPosted: Thu Aug 30, 2007 9:50 am    Post subject: inheritance
What can i do with inheritance ?
Is there an example ?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Thu Aug 30, 2007 4:19 pm    Post subject:
Inheritance is a technique to extend the functionality of an existing class. If you create a class that inherits from an existing Ranorex class, you can add additional functionality by overriding existing members or by creating new properties, methods, and events for the new class.

You can implement your application specific Control or Form classes with inheritance. You can find a simple sample in RanorexProVS2005Sample1:

Code: click into code to enlarge
public class MyForm : Ranorex.Form
{
    /// <summary>
    /// Initializes a new instance of the MyForm class.
    /// </summary>
    /// <param name="handle"></param>
    public MyForm(IntPtr handle) : base(handle)
    {
    }

    public Button FindButtons(Int32 controlId)
    {
        Button button = base.FindButton(controlId);

        if (button != null)
        {
            Console.WriteLine("FindButton OK");
            button.Enabled = false;
            Application.Sleep(1000);
            button.Enabled = true;
            Application.Sleep(1000);
            Console.WriteLine("FindButton Sleep");
        }
        return button;
    }
}

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> General Questions All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum