public override void Preparation(MHEngine engine) { if (AvailabilityStatus) { return; // Already prepared } // Set up the internal attributes. m_nLineWidth = m_nOriginalLineWidth; m_LineStyle = m_OriginalLineStyle; if (m_OrigLineColour.IsSet()) { m_LineColour.Copy(m_OrigLineColour); } else { m_LineColour.SetFromString("\u0000\u0000\u0000\u0000"); // Default is black } if (m_OrigFillColour.IsSet()) { m_FillColour.Copy(m_OrigFillColour); } else { m_FillColour.SetFromString("\u0000\u0000\u0000\u00FF"); // Default is transparent } base.Preparation(engine); // Prepare the base class. }
public override void Perform(MHEngine engine) { MHObjectRef target = new MHObjectRef(); m_Target.GetValue(target, engine); // Get the item to set. MHColour newColour = new MHColour(); switch (m_ColourType) { case CT_None: { // If the colour is not specified use "transparent". newColour.SetFromString("\u0000\u0000\u0000\u00FF"); break; } case CT_Absolute: { MHOctetString colour = new MHOctetString(); m_Absolute.GetValue(colour, engine); newColour.ColStr.Copy(colour); break; } case CT_Indexed: newColour.SetFromIndex(m_Indexed.GetValue(engine)); break; } SetColour(newColour, engine); // Set the colour of the appropriate portion of the visible }