I have "MyProject.Commons.frmMessageBox"
if I wanna create it, doing this,
using (MyProject.Commons.frmMessageBox xFrm = new
MyProject.Commons.frmMessageBox())
{
xFrm.ShowDialog();
}
if I do not know "MyProject.Commons.frmMessageBox" is available or not and
want to handle this situation like this
if (Available("MyProject.Commons.frmMessageBox"))
{
ShowCustomDialog("MyProject.Commons.frmMessageBox" );
}
This is possible ? 5 1091
Why would it not be available? If it not referenced by your project, you will
get a compiler error and visual studio, you will get a compiler warning.
--
Ciaran O''Donnell http://wannabedeveloper.spaces.live.com
"Diego Armando Maradona" wrote:
I have "MyProject.Commons.frmMessageBox"
if I wanna create it, doing this,
using (MyProject.Commons.frmMessageBox xFrm = new
MyProject.Commons.frmMessageBox())
{
xFrm.ShowDialog();
}
if I do not know "MyProject.Commons.frmMessageBox" is available or not and
want to handle this situation like this
if (Available("MyProject.Commons.frmMessageBox"))
{
ShowCustomDialog("MyProject.Commons.frmMessageBox" );
}
This is possible ?
Yes, you could probably do something funky with reflection and exception
handling to do this. However I agree with the above poster, if you're trying
to do this you've probably made an incorrect design decision somewhere else.
"Diego Armando Maradona" wrote:
I have "MyProject.Commons.frmMessageBox"
if I wanna create it, doing this,
using (MyProject.Commons.frmMessageBox xFrm = new
MyProject.Commons.frmMessageBox())
{
xFrm.ShowDialog();
}
if I do not know "MyProject.Commons.frmMessageBox" is available or not and
want to handle this situation like this
if (Available("MyProject.Commons.frmMessageBox"))
{
ShowCustomDialog("MyProject.Commons.frmMessageBox" );
}
This is possible ?
Ciaran O''Donnell wrote:
Why would it not be available? If it not referenced by your project, you will
get a compiler error and visual studio, you will get a compiler warning.
An assembly containing the referenced class could be replaced later (at
runtime) - just guessing: maybe .NET will display an 'Open File' Dialog
in this case and friendly ask the user to locate a file which contains
the class "MyProject.Commons.frmMessageBox" ...
Error messages are so medieval ;-)
Best Regards
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform http://www.mikejustin.com - http://www.betabeans.de
The runtime will through an error if the assembly containing the type has
been replaced with a version that doesnt contain it. There is sadly no nice
OpenFileDialog.
--
Ciaran O''Donnell http://wannabedeveloper.spaces.live.com
"Michael Justin" wrote:
Ciaran O''Donnell wrote:
Why would it not be available? If it not referenced by your project, you will
get a compiler error and visual studio, you will get a compiler warning.
An assembly containing the referenced class could be replaced later (at
runtime) - just guessing: maybe .NET will display an 'Open File' Dialog
in this case and friendly ask the user to locate a file which contains
the class "MyProject.Commons.frmMessageBox" ...
Error messages are so medieval ;-)
Best Regards
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform http://www.mikejustin.com - http://www.betabeans.de
Diego Armando Maradona wrote:
I have "MyProject.Commons.frmMessageBox"
if I wanna create it, doing this,
using (MyProject.Commons.frmMessageBox xFrm = new
MyProject.Commons.frmMessageBox())
{
xFrm.ShowDialog();
}
if I do not know "MyProject.Commons.frmMessageBox" is available or not
and want to handle this situation like this
if (Available("MyProject.Commons.frmMessageBox"))
{
ShowCustomDialog("MyProject.Commons.frmMessageBox" );
}
This is possible ?
I think what you want in this case is a plugin architecture with a
default fallback that just shows a normal messagebox.
You would have to load the assembly dynamically if it exists.
Google c# plugin and you should see how you could do it.
JB This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michele Simionato |
last post by:
So far, I have not installed Prothon, nor I have experience with Io, Self
or other prototype-based languages. Still, from the discussion on the
mailing list, I have got the strong impression that...
|
by: Jay |
last post by:
Everywhere I go (read/browse) I see these parameters....
ByVal sender As Object, ByVal e As System.EventArgs
Yet I never see them used within the function/method.
Could someone tell me what they...
|
by: Xah Lee |
last post by:
in March, i posted a essay “What is Expressiveness in a Computer
Language”, archived at:
http://xahlee.org/perl-python/what_is_expresiveness.html
I was informed then that there is a academic...
|
by: John Doe |
last post by:
Hi,
I wrote a small class to enumerate available networks on a smartphone :
class CNetwork
{
public:
CNetwork() {};
CNetwork(CString& netName, GUID netguid):
_netname(netName),...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |