473,386 Members | 1,924 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,386 software developers and data experts.

Ienumberable<T> / Event Handler design question...

As an example supposing I have an object:

public class myClass
{
public List<byte[]listOfBytes;
public int X;
public int Y;
}

and a method ("op()") whose signature is:

public delegate void ByteOp(byte[] b, int x, int y);
How would I go about creating an Event Handler to execute what
is essentially the inner workings of a foreach similar too:

foreach (byte[] b in listOfBytes)
{
operation(b,x,y); // Do this once per published event
}
??
Mar 30 '07 #1
2 1459
Jamie,

Can you be more specific? From what I understand, you just want a
method that will take your delegate, and then execute it for every iteration
of the loop (which, btw, you have to define b as a byte, not byte[])?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jamie Risk" <risk.#.@intectus.comwrote in message
news:eP**************@TK2MSFTNGP06.phx.gbl...
As an example supposing I have an object:

public class myClass
{
public List<byte[]listOfBytes;
public int X;
public int Y;
}

and a method ("op()") whose signature is:

public delegate void ByteOp(byte[] b, int x, int y);
How would I go about creating an Event Handler to execute what is
essentially the inner workings of a foreach similar too:

foreach (byte[] b in listOfBytes)
{
operation(b,x,y); // Do this once per published event
}
??


Mar 30 '07 #2
Nicholas Paldino [.NET/C# MVP] wrote:
Jamie,

Can you be more specific?
At the time I couldn't, but now there's no need. As is usual,
this question too came from a lack of understanding about the
language and the underlying CLR.

I figured it out.
Mar 30 '07 #3

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

Similar topics

3
by: cody | last post by:
Hi! It's great that Arrays and List<Tsupport functions that use predicates like TrueForAll(), ConvertAll(), Foreach() and so on. But why are there no such methods for IEnumerable<T>? The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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:
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.