DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

40
kicks
published 7 months, 24 days ago, submitted by manovich 7 months, 25 days ago

dotnettipoftheday.org — Small example of how to use Action delegate to perform some action on all elements of a collection.

Add a comment 9 comments | category: | Views: 14 | Get KickIt image code
tags: , , , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
wow crazy tip. good post!
posted by bladefist 7 months, 24 days ago
Cool stuff! I like it!
posted by JudahGabriel JudahGabriel 7 months, 24 days ago
You don't even need a delegate to do this sort of thing. Just use a method that has the same signature. For example, I use Regex' IsMatch method all the time with the Filter<T> method of Array.

Regex foo = new Regex(".*Lol.*");

string[] linesThatContainLol = Array.Filter<string>(sourceArray, foo.IsMatch);
posted by yesthatmcgurk yesthatmcgurk 7 months, 24 days ago
1) The tip doesn't specifically cast to the Action delegate, which is what I was implying above
2) I hate emoticons. They must die. Die emoticons die.
posted by yesthatmcgurk yesthatmcgurk 7 months, 24 days ago
@yesthatmcgurk: Nice one. I am kinda amazed this level of tips gets that many kicks but fair enough, the comments make up for it. Here's another one...

string[] a = { "1", "2" };
int[] b = Array.ConvertAll<string,int>(a, int.Parse);
posted by fquednau fquednau 7 months, 24 days ago
To have automatic emoticon functionality where code may be potentially posted is indeed very wrong.
posted by fquednau fquednau 7 months, 24 days ago
We're working on this.
posted by simoneb simoneb 7 months, 24 days ago
the following code cures cancer
:D=):););(:(:,(;):D
posted by bladefist 7 months, 23 days ago
@bladefist: LOL
posted by jesse 7 months, 23 days ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge