0

My XML file will contain some geometric objects. Like Square or Ellipse.

My question is, if I modify the XML file how can I update those integrated objects without do it myself?

It's kinda like a template.

If you need more information, don't hesitate to ask.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364

1 Answers1

0

If you want to call specific code when a file is modified, you can use FileSystemWatcher.

Simply set its Path property to your file directory's path, its Filter property to your file's name, and implement its Changed event, in which you'll reload your shapes.

Edit: do note that there might be some issues (mainly with remote files, local ones appear to be watched fine) with this class; you may have to replace or complete it with a manual polling of the desired file to watch.

Community
  • 1
  • 1
Kilazur
  • 3,089
  • 1
  • 22
  • 48