Click here to Skip to main content
15,902,634 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:34
rattlerrFx31-Dec-14 12:34 
GeneralRe: C# Database Image Manager Pin
SledgeHammer0131-Dec-14 12:45
SledgeHammer0131-Dec-14 12:45 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:55
rattlerrFx31-Dec-14 12:55 
GeneralRe: C# Database Image Manager Pin
SledgeHammer0131-Dec-14 14:21
SledgeHammer0131-Dec-14 14:21 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 19:22
rattlerrFx31-Dec-14 19:22 
GeneralRe: C# Database Image Manager Pin
SledgeHammer011-Jan-15 6:48
SledgeHammer011-Jan-15 6:48 
GeneralRe: C# Database Image Manager Pin
rattlerrFx1-Jan-15 7:17
rattlerrFx1-Jan-15 7:17 
Question(solved) an interesting "edge case" in use of Action as Value in generic Dictionary: C# language discussion Pin
BillWoodruff31-Dec-14 0:40
professionalBillWoodruff31-Dec-14 0:40 
Time for one last post before going out for New Year (it's only five-and-half-hours away here).

I find it interesting that if you define a Dictionary:
C#
private Dictionary<int, Action<int>> IntKeyValueCode = new Dictionary<int, Action<int>>();

// and a method like this:

private void Method1(int someInt, string someString, double someDouble)
{
    MessageBox.Show(string.Format("Method1: int: {0} string: {1} double: {2}", someInt, someString, someDouble));
}

// You can then do something like this:

private string someString = "a string";
private double someDouble = 199.994;

// test
private void TestCodeInDictinary()
{
    IntKeyValueCode.Add(1, value => Method1(value, someString, someDouble));  
    IntKeyValueCode[1](100);
}
What is of interest to me is that this appears to "defy" what I believe to be the requirement that a Type declaration of Action<int> would allow only the assignment to it of a pointer to a method body with one-and-only one parameter ... of Type 'int.

Thoughts ?
«A man will be imprisoned in a room with a door that's unlocked and opens inwards ... as long as it does not occur to him to pull rather than push»  Wittgenstein


modified 2-Jan-15 8:49am.

AnswerRe: an interesting "edge case" in use of Action as Value in generic Dictionary: C# language discussion Pin
Kornfeld Eliyahu Peter31-Dec-14 3:53
professionalKornfeld Eliyahu Peter31-Dec-14 3:53 
AnswerRe: an interesting "edge case" in use of Action as Value in generic Dictionary: C# language discussion Pin
Dave Kreskowiak31-Dec-14 4:11
mveDave Kreskowiak31-Dec-14 4:11 
GeneralRe: an interesting "edge case" in use of Action as Value in generic Dictionary: C# language discussion Pin
Kornfeld Eliyahu Peter31-Dec-14 6:08
professionalKornfeld Eliyahu Peter31-Dec-14 6:08 
Questioncreating internet explorer toolbar that extract all the elements from the active tab Pin
csgan9730-Dec-14 14:54
csgan9730-Dec-14 14:54 
AnswerRe: creating internet explorer toolbar that extract all the elements from the active tab Pin
Dave Kreskowiak30-Dec-14 18:18
mveDave Kreskowiak30-Dec-14 18:18 
AnswerRe: creating internet explorer toolbar that extract all the elements from the active tab Pin
Hamid_RT31-Dec-14 20:49
Hamid_RT31-Dec-14 20:49 
Questionjava.security.PrivateKey Pin
bindupv29-Dec-14 23:18
bindupv29-Dec-14 23:18 
AnswerRe: java.security.PrivateKey Pin
Richard MacCutchan30-Dec-14 0:54
mveRichard MacCutchan30-Dec-14 0:54 
QuestionI can not apply Drag Drop in this case Pin
VisualLive29-Dec-14 23:14
VisualLive29-Dec-14 23:14 
AnswerRe: I can not apply Drag Drop in this case Pin
Richard MacCutchan30-Dec-14 0:53
mveRichard MacCutchan30-Dec-14 0:53 
GeneralRe: I can not apply Drag Drop in this case Pin
VisualLive30-Dec-14 14:59
VisualLive30-Dec-14 14:59 
QuestionHow to organize this data Pin
turbosupramk329-Dec-14 8:14
turbosupramk329-Dec-14 8:14 
AnswerRe: How to organize this data Pin
Pete O'Hanlon29-Dec-14 8:53
mvePete O'Hanlon29-Dec-14 8:53 
GeneralRe: How to organize this data Pin
PIEBALDconsult29-Dec-14 9:07
mvePIEBALDconsult29-Dec-14 9:07 
AnswerRe: How to organize this data Pin
BillWoodruff29-Dec-14 9:20
professionalBillWoodruff29-Dec-14 9:20 
GeneralRe: How to organize this data Pin
PIEBALDconsult29-Dec-14 10:04
mvePIEBALDconsult29-Dec-14 10:04 
GeneralRe: How to organize this data Pin
BillWoodruff29-Dec-14 12:12
professionalBillWoodruff29-Dec-14 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.