|
by: Sergey Klementiev |
last post by:
Why it's impossible to have a static indexer in C#?
|
by: Colin Cashman |
last post by:
In a program I'm writing, I have a class that generates a certain
event. However, there may be dozens or even hundreds of instances
of this particular class, which makes adding and removing handlers
to each instance a pain. Rather than go down that route, I was
thinking of making the event static, so I would only need to add my
handlers once, to the static event, which I can then trigger from
inside my class.
That leaves me with two...
|
by: Kirk Marple |
last post by:
Just want to see if this is 'by design' or a bug...
I have a common List<T> defined in a base class, and the base class has a
static property to expose this list.
I wanted the derived class to add items to this list, but have the base
class hold the data and expose the property.
Problem is, however, that the derived class' static constructor doesn't get
called when DerivedClass.MyList is accessed, so the list has no members. If
|
by: superseed |
last post by:
Hi,
I'm pretty new to C#, and I'm quite stuck on the following problem.
I would like to add to my application a Windows.Form (singleton) on
which I could display a message of one of the following type :
Exception, Error, Warning, Infos (with differents colors, etc).
I would like to use it like the Console.WriteLine("My Message"); on
everywhere in my application.
|
by: Dave L |
last post by:
I just upgraded from VS .NET 2002 to 2003. Everything built okay, but
strange bugs started appearing.
Apparently there is a bug in the managed C++ compiler in regards to handling
of static __events. In short, every new instance of the class clears all
existing listening registered delegates. It should, of course, preserve all
delegates since its static, but it does not according to this:
"The real problem is the instance constructor...
|
|
by: Superfox il Volpone |
last post by:
I read in the glibc documentation that using 'static' in a function can
save the content of a variable.
So I want to use it to write a function that return the number of days
in one month. Since the days on one month are even the some, it could
be better to compute the array only one time. And so I did :
int nDaysOnMonth(int month, int year){
static int i_dmonths;
i_dmonths = i_dmonths = i_dmonths = i_dmonths =
i_dmonths = i_dmonths =...
|
by: =?Utf-8?B?TkVXMi5ORVQ=?= |
last post by:
I have a static event declared in a C++ ref class, that can then be handled
in a VB app. I'm trying to expose the static event through the interface
that the C++ ref class implements so the VB app can use the interface as
preferred. How do you expose a static event through an interface?
In the example below as coded, in a VB app I can access and use the general
method (MyMethod) if I declare my handle variable as an IMyInterface type....
|
by: BLUE |
last post by:
I know it's a stupid question but...
I want to use a class that represents the current user of my application,
another one that reads position from a GPS receiver and another one that
reads RFID tags from a reader.
I don't want to create a new user each time a log in appens (only one login
at a time: mobile device) and I do not want to create a new object each time
I read position or a tag, so it's right to use static classes and to update...
|
by: BLUE |
last post by:
I have a static class, so I've declared all variables static and also the
event.
This is the OnEvent method:
{
if (EventName != null)
{
// Invokes the delegates
EventName(this, e);
}
|
by: Dave |
last post by:
I have a global.asax file with Application_Start defined and create some
static data there and in another module used in the asp.net application and
I realize that static data is shared amongst child apps of an IIS
application and can be used by multiple users during the application life
cycle and for multiple page loads for the same or different page under a
root application.
What I don't understand and need to know is whether that...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|