473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

static classes and events

Hi!

I'm designing several different user controls in c#.net where each instance
is supposed to react to the fired events of one "data manager class". How
can I (at design-time) tell all the controls (set a DataManager-property) to
react to the same DataManager-instance?

I hope my question isn't too short-phrased; I'm rather new into c# (coming
from vb6) and it's ought to be a real basic problem.

Thanks in advance,
Mike
Nov 16 '05 #1
1 1464
Michael,

Why not pass a reference to the data manger to the controls themselves?
You definitely could have a static event, but that would limit you to one
datamanager, always.

If your design will withstand this, and never change, then I say that
this is fine. However, if you can see the need to have individual data
managers, then I would pass around the data manager.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Michael Maercker" <mi**********@ish.de> wrote in message
news:41471008@news-fe-01...
Hi!

I'm designing several different user controls in c#.net where each
instance
is supposed to react to the fired events of one "data manager class". How
can I (at design-time) tell all the controls (set a DataManager-property)
to
react to the same DataManager-instance?

I hope my question isn't too short-phrased; I'm rather new into c# (coming
from vb6) and it's ought to be a real basic problem.

Thanks in advance,
Mike

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sergey Klementiev | last post by:
Why it's impossible to have a static indexer in C#?
8
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...
15
by: RichGK | last post by:
I have an abstract class that provides the basis for SQL data access functions, with the subclasses building on this to create access to tables via select query strings. I have created the...
0
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...
6
by: Nadav | last post by:
Hi I have a control on my form, and in the code I decided to define it static. every change i make to the design of the form, this control is back to being non-static, and i have to change the...
7
by: sherifffruitfly | last post by:
Hi, I'm learning the .net Bloomberg api, and it's main class has all of its stuff static. The help then goes on to say that the class is implemented as a singleton. It's cool I guess to make...
7
by: intrader | last post by:
I have the following small classes: //----------------code--------------- using System; using System.Collections.Generic; using System.Text; namespace ValidatorsLibrary { public class...
1
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...
5
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); }
3
by: puzzlecracker | last post by:
Would you quickly remind me the difference between, regular class, static class, and nested class? Thanks
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.