Book a Demo

Author Topic: model watcher  (Read 3173 times)

rvaldes

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
model watcher
« on: July 09, 2010, 02:51:38 am »
Hi, can you put here an example of creating an instance of modelwatcher in c#?

alesliehughes

  • EA Administrator
  • EA User
  • *****
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: model watcher
« Reply #1 on: July 09, 2010, 03:01:34 pm »
EA.ModelWatcher eaModelWatcher = Repository.CreateModelWatcher();

// Example of use.
string sItem;
if (Convert.ToBoolean(eaModelWatcher .GetRefreshXMI(out sItem)))
{
    if (!string.IsNullOrEmpty(sItem))
    {
        XmlElement node;
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(sItem);

        switch (xmlDoc.DocumentElement.GetAttribute("RefreshType"))
        {
        case "Element":
        ....
        case "Package":
        ....
        case "Model":
        ....
       }
     }

Hope it helps.

rvaldes

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: model watcher
« Reply #2 on: July 09, 2010, 05:30:37 pm »
It helps a lot, thank you