SPContext.IsDesignTime property
SharePoint 2013
Gets a Boolean value that indicates whether the Web request is operating in a design-time configuration.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Property value
Type: System.BooleanIf the value is true, then the Web request is operating in a design-time configuration; otherwise, the value is false.