CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2010
    Posts
    5

    marking a class as serializable dynamically!

    Hi,

    I'm working on a ASN1 decoding project. I've faced a problem that I could't figure out! The problem is ASN1C program is creating classes for me to use them for decoding process. But after decoding process I need to be able to serialize that class. But the problem is those classes (which are about 6000 classes)are being created without serializable attribute. So I need to add them attributes "serializable".
    Is there any way to do this dynamically?

    I'll appreciate any help.

    Thanks in advance

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: marking a class as serializable dynamically!

    1) Modify the ASN1C program program to add the attribute for you
    or
    2) Perform some post processing that adds the attribute (after the ANS1C program has run).

  3. #3
    Join Date
    Oct 2010
    Posts
    5

    Re: marking a class as serializable dynamically!

    Quote Originally Posted by Arjay View Post
    1) Modify the ASN1C program program to add the attribute for you
    or
    2) Perform some post processing that adds the attribute (after the ANS1C program has run).

    1) I can't modify the program it is an external program (Qt Assistant Version 4.6.2).

    2 ) Can you give me an example or link about it?

  4. #4
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: marking a class as serializable dynamically!

    Quote Originally Posted by kubi081 View Post
    2 ) Can you give me an example or link about it?
    Look at PostSharp, that's his job.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured