Click here to Skip to main content
15,923,087 members
Home / Discussions / C#
   

C#

 
Question[Solved]C# Database Image Manager Pin
rattlerrFx31-Dec-14 10:44
rattlerrFx31-Dec-14 10:44 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 11:13
professionalRichard Andrew x6431-Dec-14 11:13 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 11:25
rattlerrFx31-Dec-14 11:25 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 11:27
professionalRichard Andrew x6431-Dec-14 11:27 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 11:36
rattlerrFx31-Dec-14 11:36 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 11:39
professionalRichard Andrew x6431-Dec-14 11:39 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 11:45
rattlerrFx31-Dec-14 11:45 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:00
professionalRichard Andrew x6431-Dec-14 12:00 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:08
rattlerrFx31-Dec-14 12:08 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:11
professionalRichard Andrew x6431-Dec-14 12:11 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:20
rattlerrFx31-Dec-14 12:20 
GeneralRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:24
professionalRichard Andrew x6431-Dec-14 12:24 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:24
rattlerrFx31-Dec-14 12:24 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:27
professionalRichard Andrew x6431-Dec-14 12:27 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:29
rattlerrFx31-Dec-14 12:29 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:42
rattlerrFx31-Dec-14 12:42 
GeneralRe: C# Database Image Manager Pin
SledgeHammer0131-Dec-14 12:30
SledgeHammer0131-Dec-14 12:30 
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.

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.