Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to use Fmodce.dll API Pin
Pete O'Hanlon20-Aug-13 23:02
mvePete O'Hanlon20-Aug-13 23:02 
GeneralRe: How to use Fmodce.dll API Pin
sxrenren200621-Aug-13 4:44
sxrenren200621-Aug-13 4:44 
GeneralRe: How to use Fmodce.dll API Pin
Pete O'Hanlon21-Aug-13 4:53
mvePete O'Hanlon21-Aug-13 4:53 
GeneralRe: How to use Fmodce.dll API Pin
sxrenren200622-Aug-13 15:19
sxrenren200622-Aug-13 15:19 
GeneralRe: How to use Fmodce.dll API Pin
NotPolitcallyCorrect21-Aug-13 4:57
NotPolitcallyCorrect21-Aug-13 4:57 
GeneralRe: How to use Fmodce.dll API Pin
sxrenren200622-Aug-13 15:23
sxrenren200622-Aug-13 15:23 
QuestionBlocking application from starting from a wpf-client Pin
Oscar Andersson20-Aug-13 21:14
Oscar Andersson20-Aug-13 21:14 
AnswerRe: Blocking application from starting from a wpf-client Pin
Eddy Vluggen21-Aug-13 1:52
professionalEddy Vluggen21-Aug-13 1:52 
GeneralRe: Blocking application from starting from a wpf-client Pin
Oscar Andersson21-Aug-13 20:38
Oscar Andersson21-Aug-13 20:38 
AnswerRe: Blocking application from starting from a wpf-client Pin
Oscar Andersson21-Aug-13 20:40
Oscar Andersson21-Aug-13 20:40 
AnswerRe: Blocking application from starting from a wpf-client Pin
Bernhard Hiller21-Aug-13 21:59
Bernhard Hiller21-Aug-13 21:59 
GeneralRe: Blocking application from starting from a wpf-client Pin
Oscar Andersson21-Aug-13 22:17
Oscar Andersson21-Aug-13 22:17 
QuestionBlock webbrowser from accessing webpages in C# Pin
Oscar Andersson20-Aug-13 21:13
Oscar Andersson20-Aug-13 21:13 
GeneralRe: Block webbrowser from accessing webpages in C# Pin
Richard MacCutchan20-Aug-13 23:25
mveRichard MacCutchan20-Aug-13 23:25 
AnswerRe: Block webbrowser from accessing webpages in C# Pin
Eddy Vluggen21-Aug-13 1:51
professionalEddy Vluggen21-Aug-13 1:51 
AnswerRe: Block webbrowser from accessing webpages in C# Pin
Dave Kreskowiak21-Aug-13 4:19
mveDave Kreskowiak21-Aug-13 4:19 
GeneralRe: Block webbrowser from accessing webpages in C# Pin
Oscar Andersson21-Aug-13 20:48
Oscar Andersson21-Aug-13 20:48 
GeneralRe: Block webbrowser from accessing webpages in C# Pin
Eddy Vluggen22-Aug-13 5:13
professionalEddy Vluggen22-Aug-13 5:13 
GeneralRe: Block webbrowser from accessing webpages in C# Pin
Oscar Andersson22-Aug-13 20:43
Oscar Andersson22-Aug-13 20:43 
GeneralRe: Block webbrowser from accessing webpages in C# Pin
Dave Kreskowiak22-Aug-13 6:21
mveDave Kreskowiak22-Aug-13 6:21 
AnswerRe: Block webbrowser from accessing webpages in C# Pin
Bernhard Hiller21-Aug-13 21:55
Bernhard Hiller21-Aug-13 21:55 
QuestionBluetooth Pairing Problem Win8 Pin
LearnTheCoding20-Aug-13 20:50
LearnTheCoding20-Aug-13 20:50 
QuestionCollection with unique key by property Pin
Elfin Darkglow20-Aug-13 17:51
Elfin Darkglow20-Aug-13 17:51 
AnswerRe: Collection with unique key by property Pin
BillWoodruff20-Aug-13 19:14
professionalBillWoodruff20-Aug-13 19:14 
If your collection has only two Properties in it, and you wish to make sure that one of those Properties is never a duplicate: you have an easy solution.

Create a Dictionary where the Property you don't want to allow duplicates of is the Key, and the other Property is the Value:
XML
private Dictionary<string, int> Pets = new Dictionary<string, int>();
To use this, somewhere in your code do something like this:
C#
Pets.Add("Ares", 3);
Pets.Add("Mike", 6);

// let's pull out a specific KeyValuePair
string keyToGet = "Ares";

var testKVP = Pets.FirstOrDefault(kvp => kvp.Key == keyToGet);

// if we didn't find that one, quit
if (testKVP.Key == null) return;

// proof #1: that you can't change Key
// testKVP.Key = "AnotherMike";
// fail:
// Property or indexer
// 'System.Collections.Generic.KeyValuePair<string,int>.Key'
// cannot be assigned to -- it is read only

// proof #2: that you can't create
// a new entry with the same Key
// Pets.Add("Ares", 9);
// fail:
// An item with the same key has already been added.


~
“This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal

AnswerRe: Collection with unique key by property Pin
Bernhard Hiller20-Aug-13 21:12
Bernhard Hiller20-Aug-13 21: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.