CodePlexProject Hosting for Open Source Software
I'm sure most of us have been there: you're eating a sandwhich, and suddenly you ask yourself: is it possible to prevent a shape from rendering based on a certain condition? Just as if you put "-" or "Nowhere" in placement.info
for that particular shape, only this time you want the shape to either render or not based on some application specific condition. For example:
public class SubtitleFieldShapeAlteration : ShapeDisplayEvents {
public override void Displaying(ShapeDisplayingContext context) {
if (context.Shape.ContentField.Name == "MyFieldName")
{
if (aCertainCondition == True) {
// Somehow instruct the shape or the display manager to *not* render the shape
}
}
}
}
Now I could easily add some code to the shape template to not render a thing, but since that template can be overridden in a theme, I don't want to have the theme developer to duplicate my logic that decides wether or not the shape should be displayed.
I should add that I do not create this shape myself: it's a shape created by some TextFieldDriver.
Sure, send it to a zone that never gets rendered for example.
Oh yes, thanks! That's why I didn't think of it myself: too simple a solution :)
Are you sure you want to delete this post? You will not be able to recover it later.
Are you sure you want to delete this thread? You will not be able to recover it later.