public async void CheckForChanges()
        {
            DataContract.FileInfo info = FileInfo;
            //check the fileinfo data
            if (info == null)
            {
                return;
            }
            //If the file exists
            if (!File.Exists(info.Filename))
            {
                return;
            }
            //If the file was modified after the last modification date
            if (File.GetLastWriteTime(info.Filename) <= info.LastModifiedDate)
            {
                return;
            }
            //Then we can show a message
            MessageDialogResult Result = await new ViewModelLocator()
                                         .Main.ShowFileChangedDialog();

            if (Result == MessageDialogResult.Affirmative)
            {
                string oldText            = FocusTreeParser.ParseTreeForCompare(this);
                string newText            = FocusTreeParser.ParseTreeScriptForCompare(info.Filename);
                SideBySideDiffModel model = new SideBySideDiffBuilder(
                    new Differ()).BuildDiffModel(oldText, newText);
                new ViewModelLocator().CodeComparator.DiffModel = model;
                new CompareCode().ShowDialog();
            }
        }
 public EventTabModel(EventTabModel model)
 {
     UniqueID       = Guid.NewGuid();
     eventNamespace = model.EventNamespace;
     fileInfo       = model.FileInfo;
     EventList      = new ObservableCollection <EventModel>();
     foreach (EventModel item in model.EventList)
     {
         EventList.Add(new EventModel(item));
     }
     EventList.CollectionChanged += EventList_CollectionChanged;
     SetupCommons();
 }
 public EventTabModel(EventContainer container)
 {
     UniqueID       = container.IdentifierID;
     visbleName     = container.ContainerID;
     eventNamespace = container.EventNamespace;
     fileInfo       = container.FileInfo;
     EventList      = new ObservableCollection <EventModel>();
     foreach (Event item in container.EventList)
     {
         EventList.Add(new EventModel(item));
     }
     EventList.CollectionChanged += EventList_CollectionChanged;
     SetupCommons();
 }