On j2i. net, I saw this article making designer friendly controls. The original Article is Simon Hart's writing designer friendly controls for Windows Mobile.
In the original article, when designing friendly controls for Windows Mobile, you must determine whether your code is running in the correct design, that is, whether your code is running on the desktop. If your mobile program runs on the desktop, you cannot call the DLL on the device.
"One thing that you sometimes need when writing Visual Studio designer friendly controls for Windows Mobile, is knowing if your code is running in design time-which is essential running on the desktop or not. you need to know this because if you are running on the desktop (design time) You don't want to call device specific DLLs."
The followingCodeYou can obtain the current mode:
DesignMode Public Static Class DesignMode
{
Private Static Byte _ Mode = 255 ;
Public Static Bool Istrue
{
Get
{
If (_ Mode = 255 )
_ Mode = Appdomain. currentdomain. friendlyname. Contains ( " Defaultdomain " ) ? ( Byte ) 1 :( Byte ) 0 ;
Return _ Mode = 1 ;
}
}
}
You can call
If (DesignMode. istrue)
{
// Don't call coredll. dll
}
Else
{
// Call coredll. dll
}