Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:57:23+00:00 2026-05-16T17:57:23+00:00

I am developing a C# application where the majority of the code base is

  • 0

I am developing a C# application where the majority of the code base is in C# class libraries. I want the application to support saving and loading of XML based project files and be able to determine if any modifications have occurred since the last save.

My current design idea is:

  1. Each class that needs to store settings implements IXmlSerializable.

  2. The application maintains a generic list of IXmlSerializable settings objects and calls ReadXml and WriteXml to save/load the project files.

  3. Each class that stores settings also maintains a Modified flag.

  4. The application can check if the project has been modified by enumerating the generic list of IXmlSerializable objects and checking the Modified flag on each. It can also clear the Modified flag on each after saves.

Is this a good design?
Are there any better ones?
Perhaps I also need to derive my own interface from IXmlSerializable to add the Modified flag?

thanks, Andy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:57:24+00:00Added an answer on May 16, 2026 at 5:57 pm

    I think the concept you are going for is sound. I only have one concern and it might be me reading to much into your wording.

    It sounds like you expect to not execute the WriteXml method if the instance modified flag is not set. If I have understood correctly, what I think you will find is that the resulting file will then not contain the non-modified settings. XmlSerialization is an all or nothing, it cannot update certain parts of the file.

    So I think your flag is useful to determine if you need to save or not, but if you determine that you need to save the data you need to save the entire structure. In which case there is no need to implement IXmlSerializable on every class unless you have some custom serialization requirements that can’t be addressed otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am Developing Application with multiple device support. Now i want to know which
This question concerns XML schemas and files. Suppose I am developing a desktop application
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
iam developing one application.In that i need to get the music files from the
I'm developing an application on Windows, but I'd also like to support other platforms
Basically I'm developing application using asp.net and I want to write Custom validator which
Hello i am developing application for windows phone and i want to read an
I am developing application for .Epub extension file reader.I have source code available. But
I am currently developing a new WPF application and have the majority of my
I am developing application based on the NetBeans platform. I use Maven to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.