Click here to Skip to main content
15,913,186 members
Home / Discussions / C#
   

C#

 
AnswerRe: return value Pin
Colin Angus Mackay2-Mar-07 6:34
Colin Angus Mackay2-Mar-07 6:34 
QuestionSending mail through gmail Pin
sharpiesharpie2-Mar-07 1:37
sharpiesharpie2-Mar-07 1:37 
AnswerRe: Sending mail through gmail Pin
Frank Kerrigan2-Mar-07 2:25
Frank Kerrigan2-Mar-07 2:25 
GeneralRe: Sending mail through gmail Pin
sharpiesharpie2-Mar-07 3:41
sharpiesharpie2-Mar-07 3:41 
GeneralRe: Sending mail through gmail Pin
Colin Angus Mackay2-Mar-07 5:34
Colin Angus Mackay2-Mar-07 5:34 
QuestionCopying Dictionaries [modified] Pin
AmorphisOne2-Mar-07 1:28
AmorphisOne2-Mar-07 1:28 
AnswerRe: Copying Dictionaries Pin
kubben2-Mar-07 1:55
kubben2-Mar-07 1:55 
AnswerRe: Copying Dictionaries Pin
Andrew Rissing2-Mar-07 3:17
Andrew Rissing2-Mar-07 3:17 
You can like the other poster create your own class and add the ICloneable interface to it.

But if you're wanting a way to perform a copy of a dictionary with out deriving a new class, you can do this as well...


For dictionaries that contain ICloneable objects:

Dictionary<KeyType, ValueType> dctSource, dctClone;<br />
<br />
dctSource = new Dictionary<KeyType, ValueType>();<br />
dctClone = new Dictionary<KeyType, ValueType>();<br />
<br />
foreach (KeyType key in dctSource.Keys)<br />
  dctClone[key] = dctSource[key].Clone();


For dictionaries that contain strings like in your example:

dctSource = new Dictionary<string, string>();<br />
dctClone = new Dictionary<string, string>();<br />
<br />
foreach (string key in dctSource.Keys)<br />
  dctClone[key] = dctSource[key];


(You don't have to clone the strings as they are immutable.)
GeneralRe: Copying Dictionaries Pin
AmorphisOne2-Mar-07 4:05
AmorphisOne2-Mar-07 4:05 
Questionconvert protected Audio files into unprotected audio files. Pin
Balakrish2-Mar-07 0:36
Balakrish2-Mar-07 0:36 
AnswerRe: convert protected Audio files into unprotected audio files. Pin
sharpiesharpie2-Mar-07 1:41
sharpiesharpie2-Mar-07 1:41 
AnswerRe: convert protected Audio files into unprotected audio files. Pin
iqueiroz2-Mar-07 2:26
iqueiroz2-Mar-07 2:26 
GeneralRe: convert protected Audio files into unprotected audio files. Pin
Balakrish4-Mar-07 22:21
Balakrish4-Mar-07 22:21 
QuestionCombo box -- Locking Pin
Biswajit Ghosh2-Mar-07 0:21
Biswajit Ghosh2-Mar-07 0:21 
AnswerRe: Combo box -- Locking Pin
stancrm2-Mar-07 0:31
stancrm2-Mar-07 0:31 
GeneralRe: Combo box -- Locking Pin
Biswajit Ghosh2-Mar-07 0:52
Biswajit Ghosh2-Mar-07 0:52 
GeneralRe: Combo box -- Locking Pin
sharpiesharpie2-Mar-07 1:02
sharpiesharpie2-Mar-07 1:02 
Questionnumeric textbox Pin
vijayashanthi2-Mar-07 0:20
vijayashanthi2-Mar-07 0:20 
AnswerRe: numeric textbox Pin
Stefan Troschuetz2-Mar-07 0:29
Stefan Troschuetz2-Mar-07 0:29 
AnswerRe: numeric textbox Pin
Frank Kerrigan2-Mar-07 2:26
Frank Kerrigan2-Mar-07 2:26 
Questionhelp regarding .NET Remoting Pin
Zuhair Rizvi1-Mar-07 23:07
Zuhair Rizvi1-Mar-07 23:07 
QuestionHelp regarding XML Pin
anu811-Mar-07 22:48
anu811-Mar-07 22:48 
QuestionTry Catch 101 Pin
Ian Uy1-Mar-07 22:23
Ian Uy1-Mar-07 22:23 
AnswerRe: Try Catch 101 Pin
Guffa1-Mar-07 22:30
Guffa1-Mar-07 22:30 
AnswerRe: Try Catch 101 Pin
Russell Jones1-Mar-07 23:42
Russell Jones1-Mar-07 23:42 

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.