Design Pattern Examples
Overview of object-oriented design patterns
TextElement Class Reference

Represents the core element that can be decorated. Note that this class implements the IRenderElement but otherwise has no knowledge of any of the decorators that might be applied. More...

Inheritance diagram for TextElement:
Inheritance graph
Collaboration diagram for TextElement:
Collaboration graph

Public Member Functions

 TextElement (string element)
 Constructor.
 
string Render ()
 Render this element as a string.
 
string Render ()
 Render this element as a string.
 

Private Attributes

string _elementText
 

Detailed Description

Represents the core element that can be decorated. Note that this class implements the IRenderElement but otherwise has no knowledge of any of the decorators that might be applied.

This class wraps a string and does nothing other than return the string. This way, this class can be decorated because it implements the IRenderElement interface.

Definition at line 182 of file Decorator_Classes.cs.

Constructor & Destructor Documentation

◆ TextElement()

TextElement ( string  element)
inline

Constructor.

Parameters
elementThe text to be rendered.

Definition at line 190 of file Decorator_Classes.cs.

References TextElement._elementText.

Member Function Documentation

◆ Render()

string Render ( )
inline

Render this element as a string.

Returns
A string containing the rendering of the element.

Implements IRenderElement.

Definition at line 201 of file Decorator_Classes.cs.

References TextElement._elementText.

Member Data Documentation

◆ _elementText

string _elementText
private

Definition at line 184 of file Decorator_Classes.cs.

Referenced by TextElement.Render(), and TextElement.TextElement().


The documentation for this class was generated from the following file: