Hello,

I have some code that I have written from a tutorial. Even though I understand what the code is doing. I don't understand some of the coding itself.

Meaning this:
Code:
IDeviceEmulatorManager emulatorManager;
and this:
Code:
emulatorManager = new DeviceEmulatorManagerClass();
I can understand that is creating a object of the DeviceEmulatorManagerClass so you can you its methods and properties etc. But I am not sure of why you need the interface?

Many thanks for any advice,

Steve

The complete code is listed below.
Code:
IDeviceEmulatorManager emulatorManager;
        private void Form1_Load(object sender, EventArgs e)
        {
            emulatorManager = new DeviceEmulatorManagerClass();

        }

        private void btnPopulate_Click(object sender, EventArgs e)
        {
            this.ListDEMAllMembers();
        }

        void ListDEMAllMembers()
        {
            string categoryName;
            this.lstDisplay.Items.Clear();
            emulatorManager.Reset();

                while (true)
                {
                    categoryName = emulatorManager.get_Name();
                    lstDisplay.Items.Add(categoryName);

                    emulatorManager.MoveNext();

                }
            
        }