Skip to content

Instantly share code, notes, and snippets.

View edgesmash's full-sized avatar

Ed Schwehm edgesmash

View GitHub Profile
@edgesmash
edgesmash / elseall.cs
Last active August 29, 2015 13:56
A case for needing else-all
public override void RenderContent(DataContext dataContext)
{
// Note: Given the framework/tech, I don't have full control over all of this. Maybe I should refactor?
var dataItem = this.GetDataItem(dataContext);
// If we're right-aligned, either set a new data item or don't do anything
if (this.IsRightAligned)
{
var rightAlignedDataItem = GetRightAlignedDataItem(dataContext, currentItemDetails, mediaList);
if (rightAlignedDataItem == null)