Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralEditing Images on the fly... Pin
Verdant1239-Mar-04 7:08
Verdant1239-Mar-04 7:08 
GeneralRe: Editing Images on the fly... Pin
Heath Stewart9-Mar-04 8:34
protectorHeath Stewart9-Mar-04 8:34 
QuestionHow to convert html file to pdf Pin
Inam9-Mar-04 7:07
Inam9-Mar-04 7:07 
AnswerRe: How to convert html file to pdf Pin
Heath Stewart9-Mar-04 8:40
protectorHeath Stewart9-Mar-04 8:40 
GeneralMultiple Classes and Functions/Methods Pin
thewebmonster9-Mar-04 6:47
thewebmonster9-Mar-04 6:47 
GeneralRe: Multiple Classes and Functions/Methods Pin
LongRange.Shooter9-Mar-04 6:57
LongRange.Shooter9-Mar-04 6:57 
GeneralRe: Multiple Classes and Functions/Methods Pin
Heath Stewart9-Mar-04 7:02
protectorHeath Stewart9-Mar-04 7:02 
Generalserializing a delegate to a non-public method Pin
Judah Gabriel Himango9-Mar-04 6:11
sponsorJudah Gabriel Himango9-Mar-04 6:11 
I posted this question late last night, didn't get a satisfactory answer, and now all the experts can't see the post. So I will post one more time. Smile | :)

I have a class with a private event/delegate model.

[Serializable]
public class MyClass
{
   private SomeCollection collection = new SomeCollection();
   public MyClass()
   {
      this.collection.Changed += new EventHandler(this.SomePrivateMethod);
   }

   private void SomePrivateMethod(object sender, EventArgs e)
   {
   }
}


I can serialize the above class without problem, however, upon deserialization, I recieve an exception telling me "delegates to non-public methods cannot be deserialized." If I change the accessor of SomePrivateMethod to public the whole things works. But I really don't want to have to expose SomePrivateMethod as public.

So what do I do here, how can I serialize and deserialize the above class without SomePrivateMethod having a public accessor?


---------------------------
He who knows that enough is enough will always have enough.

-Lao Tsu

GeneralRe: serializing a delegate to a non-public method Pin
LongRange.Shooter9-Mar-04 6:35
LongRange.Shooter9-Mar-04 6:35 
GeneralRe: serializing a delegate to a non-public method Pin
Judah Gabriel Himango9-Mar-04 9:17
sponsorJudah Gabriel Himango9-Mar-04 9:17 
GeneralRe: serializing a delegate to a non-public method Pin
LongRange.Shooter9-Mar-04 9:50
LongRange.Shooter9-Mar-04 9:50 
GeneralRe: serializing a delegate to a non-public method Pin
LongRange.Shooter9-Mar-04 6:40
LongRange.Shooter9-Mar-04 6:40 
GeneralBrush that does not mix with the background color Pin
Manobal9-Mar-04 6:08
Manobal9-Mar-04 6:08 
GeneralRe: Brush that does not mix with the background color Pin
Heath Stewart9-Mar-04 6:25
protectorHeath Stewart9-Mar-04 6:25 
GeneralRe: Brush that does not mix with the background color Pin
Manobal9-Mar-04 6:33
Manobal9-Mar-04 6:33 
QuestionChanging permission on a folder from C#? Pin
Xiangyang Liu 刘向阳9-Mar-04 2:45
Xiangyang Liu 刘向阳9-Mar-04 2:45 
AnswerRe: Changing permission on a folder from C#? Pin
Matthew Hazlett9-Mar-04 5:12
Matthew Hazlett9-Mar-04 5:12 
GeneralRe: Changing permission on a folder from C#? Pin
Xiangyang Liu 刘向阳9-Mar-04 5:27
Xiangyang Liu 刘向阳9-Mar-04 5:27 
GeneralRe: Changing permission on a folder from C#? Pin
Heath Stewart9-Mar-04 5:34
protectorHeath Stewart9-Mar-04 5:34 
AnswerRe: Changing permission on a folder from C#? Pin
Heath Stewart9-Mar-04 6:30
protectorHeath Stewart9-Mar-04 6:30 
GeneralRe: Changing permission on a folder from C#? Pin
Nick Parker9-Mar-04 6:34
protectorNick Parker9-Mar-04 6:34 
GeneralRe: Changing permission on a folder from C#? Pin
Heath Stewart9-Mar-04 6:47
protectorHeath Stewart9-Mar-04 6:47 
GeneralRe: Changing permission on a folder from C#? Pin
Nick Parker9-Mar-04 7:07
protectorNick Parker9-Mar-04 7:07 
GeneralRe: Changing permission on a folder from C#? Pin
Xiangyang Liu 刘向阳9-Mar-04 7:24
Xiangyang Liu 刘向阳9-Mar-04 7:24 
GeneralRe: Changing permission on a folder from C#? Pin
Heath Stewart9-Mar-04 9:02
protectorHeath Stewart9-Mar-04 9:02 

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.