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

C#

 
GeneralRe: QOYesterday Pin
SimonS3-Jul-02 21:55
SimonS3-Jul-02 21:55 
GeneralNeed easy way to write plugin Pin
leppie3-Jul-02 7:49
leppie3-Jul-02 7:49 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson3-Jul-02 9:52
James T. Johnson3-Jul-02 9:52 
GeneralRe: Need easy way to write plugin Pin
leppie3-Jul-02 10:39
leppie3-Jul-02 10:39 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson3-Jul-02 22:33
James T. Johnson3-Jul-02 22:33 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 0:16
leppie4-Jul-02 0:16 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 2:19
leppie4-Jul-02 2:19 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson4-Jul-02 4:20
James T. Johnson4-Jul-02 4:20 
leppie wrote:
If I have an method e.g. Init(object sender) specified in the interface, does "sender" get passed by value or by reference?

In this particular case, it will be passed by reference.

Everything is always passed by reference unless the type inherits from ValueType somewhere in the hierarchy. As a general rule if its a class it will be passed by reference; if it is a struct or a intrisnic type (int, float, bool) it will be passed by value. Though string is an intrisnic type it violates this rule by being a class; so it is passed by reference and not by value.

leppie wrote:
Or should I maybe define it as e.g. Init(ref object sender)?

Doing this means that you can change the value that the variable references; so that it is referencing something different. Generally you would want to leave the original variable referencing the same thing.

leppie wrote:
do I need to deregister them when I "unload" the assembly or will they get "destroyed" automatically?

I would unregister them just to be safe Smile | :) When dealing with finalizers you have no idea in what order or when things will happen. Unregistering them yourself would guarantee that it gets done.

leppie wrote:
And how does the "assembly" get disposed of? When the interface goes out of scope?

This is where Eric's article is superior to mine, and why I referred you to his instead of mine in the first place Smile | :)

Once an assembly is loaded into an AppDomain with the Assembly.Load* methods it stays there until the AppDomain is unloaded. The problem is that in my article all assemblies are loaded into the default AppDomain created when you execute a .NET program. So the only way to unload the assembly is to quit the program.

HTH,

James
"Java is free - and worth every penny." - Christian Graus
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 5:54
leppie4-Jul-02 5:54 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 10:41
leppie4-Jul-02 10:41 
GeneralRe: Need easy way to write plugin Pin
James T. Johnson4-Jul-02 14:46
James T. Johnson4-Jul-02 14:46 
GeneralRe: Need easy way to write plugin Pin
leppie4-Jul-02 20:22
leppie4-Jul-02 20:22 
GeneralRe: Need easy way to write plugin Pin
leppie5-Jul-02 3:13
leppie5-Jul-02 3:13 
GeneralEUREKA I HAVE FOUND IT Pin
leppie5-Jul-02 4:45
leppie5-Jul-02 4:45 
QuestionResources... how??? Pin
3-Jul-02 7:43
suss3-Jul-02 7:43 
AnswerRe: Resources... how??? Pin
James T. Johnson3-Jul-02 10:28
James T. Johnson3-Jul-02 10:28 
GeneralMouseLeave Pin
SHaroz3-Jul-02 7:38
SHaroz3-Jul-02 7:38 
GeneralRe: MouseLeave Pin
NormDroid6-Jul-02 2:13
professionalNormDroid6-Jul-02 2:13 
GeneralListing Items Alphabetically in TreeView Pin
cAptHiDDeN3-Jul-02 4:48
cAptHiDDeN3-Jul-02 4:48 
GeneralTransparent User Controls Pin
2-Jul-02 11:21
suss2-Jul-02 11:21 
GeneralLocalization in ASP.NET Pin
2-Jul-02 5:08
suss2-Jul-02 5:08 
GeneralTEXTBOX Pin
vikramlinux2-Jul-02 3:32
vikramlinux2-Jul-02 3:32 
GeneralRe: TEXTBOX Pin
Chris Rickard2-Jul-02 4:11
Chris Rickard2-Jul-02 4:11 
GeneralRe: TEXTBOX Pin
vikramlinux2-Jul-02 5:48
vikramlinux2-Jul-02 5:48 
GeneralRe: TEXTBOX Pin
Sorin Comanescu3-Jul-02 22:42
Sorin Comanescu3-Jul-02 22: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.