Detect, in code behind, that i'm in the designer

Hi, i'd like to know if there is a way to detect if i'm running the report from the designer.
For example, using a preprocessor directives:
#if DESIGNER
// Initialize some variables to default value
// Show some message boxes
#endif

or maybe there is a static variable.
Is there a way?
Thank you very much.

Comments

  • edited 6:18PM
    It was very simple, just some reflection:
    if (System.Reflection.Assembly.GetEntryAssembly().GetName().Name == "Designer")
    {
       MessageBox.Show("Inside the designer");
    }
    
    capedica wrote: »
    Hi, i'd like to know if there is a way to detect if i'm running the report from the designer.
    For example, using a preprocessor directives:
    #if DESIGNER
    // Initialize some variables to default value
    // Show some message boxes
    #endif

    or maybe there is a static variable.
    Is there a way?
    Thank you very much.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.