Click here to Skip to main content
15,867,686 members
Home / Discussions / C#
   

C#

 
GeneralRe: Static Analysis tools? Pin
James T. Johnson19-Sep-02 0:18
James T. Johnson19-Sep-02 0:18 
GeneralRe: Static Analysis tools? Pin
leppie19-Sep-02 0:27
leppie19-Sep-02 0:27 
GeneralRe: Static Analysis tools? Pin
James T. Johnson19-Sep-02 0:42
James T. Johnson19-Sep-02 0:42 
GeneralRe: Static Analysis tools? Pin
James T. Johnson19-Sep-02 4:17
James T. Johnson19-Sep-02 4:17 
GeneralRe: Static Analysis tools? Pin
leppie19-Sep-02 5:24
leppie19-Sep-02 5:24 
GeneralRe: Static Analysis tools? Pin
James T. Johnson18-Sep-02 23:53
James T. Johnson18-Sep-02 23:53 
GeneralRe: Static Analysis tools? Pin
leppie19-Sep-02 0:17
leppie19-Sep-02 0:17 
GeneralRe: Static Analysis tools? Pin
James T. Johnson19-Sep-02 0:38
James T. Johnson19-Sep-02 0:38 
leppie wrote:
I prefer to steer clear as (like this example) value types dont seem to work...

The reason this doesn't work with value types is because you are making changes to copies of what the first two properties hold.

This is a hard problem to wrap your head around because what happens is that every time a get is called on a value type based property a copy of what is stored is returned. So when you chain them together you wind up with (using your example):

myobject.(get)User.(get)Name.(set)Surname

So you've made a change to a copy of the Name type which was a copy of the User type.

When you don't use properties you are accessing the values directly, so no copies are made at all.

leppie wrote:
Isnt that what the whole IDisposable issue is about?

No; IDisposable addresses managed code using unmanaged objects; the issue that I think is at hand is unmanaged code using managed objects (roles are switched).

When unmanaged code has a reference to a managed object the GC has no idea what happens to it; if additional references are made or if it doesn't even use it. That is why you use GC.KeepAlive, so that even if your code doesn't maintain a reference to the object, the GC will.

Note that I haven't looked at the code in question so I'm not sure why you had that issue reported; I just assumed the common case Wink | ;)

leppie wrote:
But why do I need to sign/strong name my application?

Mainly security.

Its not a strong form of security; it only ensures that the assembly hasn't been modified since it was signed. But if you know the Public Key token of the person who signed the assembly you can use that as a means of verifying that it was signed by the same person; assuming the private/public key pair hasn't been stolen.

If you browse to %WINDOWSDIR%\assembly on your computer you should see the contents of the global assembly cache; which thanks to the Fusion shell extension also displays among other things the public key token. You can also see that most of the assemblies from Microsoft have the same public key token.

James
"And we are all men; apart from the females." - Colin Davies
GeneralRe: Static Analysis tools? Pin
leppie19-Sep-02 1:09
leppie19-Sep-02 1:09 
GeneralPopup menu Pin
Mazdak17-Sep-02 21:17
Mazdak17-Sep-02 21:17 
GeneralRe: Popup menu Pin
Stephane Rodriguez.17-Sep-02 21:45
Stephane Rodriguez.17-Sep-02 21:45 
GeneralRe: Popup menu Pin
Mazdak17-Sep-02 21:51
Mazdak17-Sep-02 21:51 
QuestionAuto-updater? Pin
floydboy5817-Sep-02 18:27
floydboy5817-Sep-02 18:27 
AnswerRe: Auto-updater? Pin
Philip Fitzsimons18-Sep-02 1:16
Philip Fitzsimons18-Sep-02 1:16 
GeneralRe: Auto-updater? Pin
floydboy5818-Sep-02 1:52
floydboy5818-Sep-02 1:52 
GeneralRe: Auto-updater? Pin
Philip Fitzsimons18-Sep-02 1:55
Philip Fitzsimons18-Sep-02 1:55 
GeneralRe: Auto-updater? Pin
floydboy5818-Sep-02 2:01
floydboy5818-Sep-02 2:01 
GeneralRe: Auto-updater? Pin
Philip Fitzsimons18-Sep-02 3:19
Philip Fitzsimons18-Sep-02 3:19 
GeneralRe: Auto-updater? Pin
leppie18-Sep-02 3:58
leppie18-Sep-02 3:58 
GeneralRe: Auto-updater? Pin
Ray Cassick18-Sep-02 5:16
Ray Cassick18-Sep-02 5:16 
GeneralRe: Auto-updater? Pin
User 988518-Sep-02 5:44
User 988518-Sep-02 5:44 
AnswerRe: Auto-updater? Pin
Andy Smith18-Sep-02 4:55
Andy Smith18-Sep-02 4:55 
Questionhelp? Pin
imran_rafique17-Sep-02 15:33
imran_rafique17-Sep-02 15:33 
Generalgetting a HANDLE Pin
Nnamdi Onyeyiri17-Sep-02 9:29
Nnamdi Onyeyiri17-Sep-02 9:29 
GeneralRe: getting a HANDLE Pin
leppie17-Sep-02 10:08
leppie17-Sep-02 10:08 

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.