Click here to Skip to main content
15,918,243 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drawing Digital Signal Pin
ekynox16-Jul-07 22:41
ekynox16-Jul-07 22:41 
AnswerRe: Drawing Digital Signal Pin
Bert delaVega17-Jul-07 6:24
Bert delaVega17-Jul-07 6:24 
QuestionCopying objects by value Pin
jozsurf16-Jul-07 17:59
jozsurf16-Jul-07 17:59 
AnswerRe: Copying objects by value Pin
originSH16-Jul-07 22:09
originSH16-Jul-07 22:09 
AnswerRe: Copying objects by value Pin
Luc Pattyn16-Jul-07 22:47
sitebuilderLuc Pattyn16-Jul-07 22:47 
GeneralRe: Copying objects by value Pin
jozsurf16-Jul-07 23:42
jozsurf16-Jul-07 23:42 
GeneralRe: Copying objects by value Pin
Luc Pattyn17-Jul-07 0:20
sitebuilderLuc Pattyn17-Jul-07 0:20 
GeneralRe: Copying objects by value Pin
jozsurf17-Jul-07 15:06
jozsurf17-Jul-07 15:06 
Apologies for the lousy example. I was trying to give an 'abstract' example and was a bit rushed for time. Guess it's better to spend a bit more time giving a proper example rather then screwing about with 'abstract' (ultimately incomprehensible) examples Poke tongue | ;-P

What I need this for is to save some application settings as well as be able to load up default settings. If using simple assignment (=), which copies the reference rather then the value, we run the risk of changing the default values which should really be a static, constant value.

1. Load up default values
m_settings = SavedData.DefaultSettings;

2. Change the settings

3. Save the settings
SavedData.Settings = m_settings;

I'm sure you can see how I ended up changing both SavedData.Settings and SavedData.DefaultSettings, and indeed have made both data structures point to one and the same thing!

And so I realised that I needed to copy-by-value; which brought up my original question. I thought it would be a bit weird to do a m_settings = new SettingsClass(SavedData.DefaultSettings); everywhere I want to do a value copy; of course there is also the potential of a difference in performance (although in my case probably negligible, which is why I wanted to bring it up to check).

cheers!
GeneralRe: Copying objects by value Pin
Luc Pattyn17-Jul-07 16:45
sitebuilderLuc Pattyn17-Jul-07 16:45 
GeneralRe: Copying objects by value Pin
jozsurf17-Jul-07 16:59
jozsurf17-Jul-07 16:59 
GeneralRe: Copying objects by value [modified] Pin
Luc Pattyn17-Jul-07 17:15
sitebuilderLuc Pattyn17-Jul-07 17:15 
GeneralRe: Copying objects by value Pin
jozsurf17-Jul-07 18:07
jozsurf17-Jul-07 18:07 
GeneralRe: Copying objects by value Pin
Luc Pattyn22-Jul-07 12:00
sitebuilderLuc Pattyn22-Jul-07 12:00 
QuestionHow to set and get Windows Application's Version? Pin
Khoramdin16-Jul-07 17:21
Khoramdin16-Jul-07 17:21 
AnswerRe: How to set and get Windows Application's Version? Pin
Vikram A Punathambekar16-Jul-07 17:40
Vikram A Punathambekar16-Jul-07 17:40 
QuestionRe: How to set and get Windows Application's Version? Pin
Khoramdin16-Jul-07 19:20
Khoramdin16-Jul-07 19:20 
AnswerRe: How to set and get Windows Application's Version? Pin
Vikram A Punathambekar16-Jul-07 21:05
Vikram A Punathambekar16-Jul-07 21:05 
AnswerRe: How to set and get Windows Application's Version? Pin
originSH16-Jul-07 22:14
originSH16-Jul-07 22:14 
AnswerRe: How to set and get Windows Application's Version? Pin
ekynox17-Jul-07 13:33
ekynox17-Jul-07 13:33 
QuestionDataGrid date AND time Column[modified] Pin
swjam16-Jul-07 14:24
swjam16-Jul-07 14:24 
AnswerRe: DataGrid date AND time Column[modified] Pin
Michael Sync16-Jul-07 17:39
Michael Sync16-Jul-07 17:39 
GeneralRe: DataGrid date AND time Column[modified] Pin
swjam16-Jul-07 20:59
swjam16-Jul-07 20:59 
GeneralRe: DataGrid date AND time Column[modified] Pin
Rhys Gravell16-Jul-07 23:09
professionalRhys Gravell16-Jul-07 23:09 
Questionadd a page Pin
daku116-Jul-07 12:47
daku116-Jul-07 12:47 
AnswerRe: add a page Pin
T.EDY16-Jul-07 17:06
T.EDY16-Jul-07 17:06 

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.