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 3285396
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:15:45+00:00 2026-05-17T20:15:45+00:00

I am currently writing a Particle System using XNA. What I’d like to do

  • 0

I am currently writing a Particle System using XNA. What I’d like to do is use an external file (XML for example) and be able to modify this file, whilst the application is running, and once saved, the changes will be reflected in the Particle System.

My original proposal:
Use a FileWatcher (can’t remember the exact class name) to monitor the particle effect file and when the date changes, reload the file thus causing the changes to be made.

Any help would be appreciated.

  • 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-17T20:15:46+00:00Added an answer on May 17, 2026 at 8:15 pm

    You are on the right track.

    Create a System.IO.FileSystemWatcher.
    Subscribe to the Changed event.
    
    When the Changed event occurs
       If the path/file extension corresponds to a buildable resource type
          Either
             Directly create and invoke a content importer and processor. (Xna 4.0)
          Or
             Use MSBuild to build a dummy content project.
          
          Replace references to the existing resource with the newly built resource
          Dispose of the old resource if necessary
    

    Notes:

    • The FileSystemWatcher sometimes
      generates multiple change events for
      a single change. Also, some
      programs, like photoshop save to a
      temporary file, then delete the
      original and rename the temporary
      file to the original name. My system
      buffers file system events and
      combines them into single events
      where possible. Because they are
      buffered this also allows me to apply
      the events to the content at an
      appropriate point in the program. If
      you don’t buffer these events could
      trigger while the resource you are
      trying to replace is in use.

    • Shawn Hargreaves has written about Effect compilation and Content Pipeline automation in XNA Game Studio 4.0.

    • AppHub has a Code Snippet WinForms Series 2: Content Loading which shows how to use MSBuild to build content dynamically. I have found this method is slower than invoking the importer and processor directly.

    • In my system, all references to dynamic resources are indirect references. These indirect references are allocated and tracked by a resource manager. When a resource is dynamically built the resource manager replaces the actual reference inside the indirect reference. A resource changed event is generated through the indirect reference so clients can take action if required.

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

Sidebar

Related Questions

I am currently writing a distributed system using hazelcast. I have a few questions
Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to
I'm currently writing a simple .sh script to parse an Exim log file for
The application I'm currently writing is using MVVM with the ViewModel-first pattern. I have
I'm currently writing a small script using pygame, but I don't believe this question
I'm currently writing a tag cloud system. So I wrote the following sql schema
Im currently writing a database for a school project. Im using MySQL on xampp
I'm currently writing a Django template template tag, and I would like to be
I am currently writing a project where I make a heavy use of ListT
I'm currently writing a twitter client using javascript, then found out many people reminded

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.