Hey guys, I have an application which consists of a baseclass (MacroCommand), three subclasses of MacroCommand (Resize, Rotate, Colour), and another class which does not inherit anything (Image) and then another class (Macro) which holds a list of MacroCommands
class Macro
{
List<MacroCommand> macroCommandList = new List<MacroCommand>();
}
Basically, when I create my MacroCommand objects in the Form class, I need to then add them to the MacroCommand list, however, I keep getting errors when I try to do this:
macroCommandList.Add(colourObject);
macroCommandList.Add(rotateFlipObject);
macroCommandList.Add(resizeObject);
(this is in the Form class)
Any help would be appreciated, thanks guys.
EDIT: Errors:
Error 2 The name 'colourObject' does not exist in the current context C:\Users\Ari\Desktop\Assignment 3\Assignment 3\Assignment 3\Form1.cs 134 42 Assignment 3 Error 3 The name 'macroCommandList' does not exist in the current context C:\Users\Ari\Desktop\Assignment 3\Assignment 3\Assignment 3\Form1.cs 135 21 Assignment 3
It's just these errors but for each different line
colourObject,rotateFlipObject, andresizeObject?macroCommandList.Addinside theMacroclass, since you're accessing a private member.