/// <summary>
/// Verificam daca procesul care ruleaza codul este VisualStudio si ignoram ca sa nu ne crape in Designerul VS.
/// </summary>
public static bool DesignMode
{
get { return (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"); }
}
Method Nr. 2:
using System.ComponentModel;
public static bool DesignModeLicUsage
{
get
{
return (LicenseUsageMode.Designtime == LicenseUsageMode.Designtime);
}
}
No comments:
Post a Comment