get_Layer().set_Mask(null);
return;
}
RectangleF bounds = get_Bounds();
CAShapeLayer maskLayer = new CAShapeLayer();
// draw four rectangles surrounding the area we want to hide, and create a mask out of it.
CGPath path = new CGPath();
// top
path.AddRect(new RectangleF(0, 0, bounds.get_Width(), _hidden.get_Top()));
// bottom
path.AddRect(new RectangleF(0, _hidden.get_Bottom(), bounds.get_Width(),
bounds.get_Bottom() - _hidden.get_Bottom()));
// left
path.AddRect(new RectangleF(0, _hidden.get_Top(), _hidden.get_Left(), _hidden.get_Height()));
// right
path.AddRect(new RectangleF(_hidden.get_Right(), _hidden.get_Top(), bounds.get_Right()
- _hidden.get_Right(), _hidden.get_Height()));
maskLayer.set_Path(path);
get_Layer().set_Mask(maskLayer);
}