Know when in development mode

Inside the class library, I would like to know if there is access to it during development mode, as opposed to normal runtime.

I tried using System.ComponentModel.LicenseManager.UsageMode, but it seemed to have a Runtime value even when I edited the form.

UPDATE: To clarify, I want to know if I am in development mode not from within the component, but rather from a separate class that is called by other elements from the form or control. I have a Utility class, which is called indirectly from a control, and is there anything I need to know if I am in development mode or not.

+5
source share
4 answers

I do not think that Component.DesignMode will help in this case. What should I do if the component or control is not loaded into the form designer? What you can try in this case, create an enumeration that sets only one value during normal startup, which still remains a different default value. Now you can check the value of the enum instance and decide whether it is development time or runtime.

+3
source

Component.DesignMode, . , false , . . .


:

, LicenseMananger, , , ( Component.DesignMode DesignerProperties.IsInDesignMode), . , , , "" , , .

, .

, :

  • (..: Component DependencyObject), . , , , .
  • "" "devenv" - ​​ , Visual Studio, .. , , , , .
+3

Is it possible to use the Component.DesignMode property?

+1
source

Here is some information about using attributes to get design-specific behavior: http://msdn.microsoft.com/en-us/library/37899azc.aspx

0
source

All Articles