Home > Developing Using CodeFluent Entities > CodeFluent Entities: Member Format Expressions (Part 2)

CodeFluent Entities: Member Format Expressions (Part 2)

In the previous post, we’ve seen that we could define expressions such as “{Name}” to display the property name, “{#Name}” to display the decamelized property name, and mix values and literals in expressions to do stuff such as “{#Name} (IsKey={IsKey})”.

In this post we’re going to go a little further by introducing “tags”. Three tags are supported in expressions:

  • Font: use it to define styles in your expression,
  • If: use it to define conditions,
  • Else: same as if.

For instance specify the following expression:

<font color=”blue”>{#Name}</font>

Will display all properties in blue:


We could also combine the tags to display key properties in red and the other ones in blue:

<if condition=IsKey><font color=”red”>{#Name}</font><else/><font color=”blue”>{#Name}</font></if>

Note: the value in the condition attribute is automatically evaluated, no need to wrap the property path between curly brackets.

And here’s the result:


So expressions don’t get too long the <font> tag also has a condition attribute so you don’t necessarily have to wrap it in a <if> tag. Therefore, you could get the same result using this expression:

<font condition=IsKey color=”red”>{#Name}<else/><font color=”blue”>{#Name}</font></font>

The <font> tag supports the following attributes:

Here’s another expression displaying the property type name in a light purple (Alpha=DD, Red=6E, Green=14, Blue=FF):

{#Name} : <font color=”#DD6E14FF”>{#DisplayTypeName}</font>

And here’s the result:


Once again use member format expressions with caution as they’ll be evaluated for all property names, so the lighter they are, the better performances will be and vice versa.

Carl Anderson

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s