internal AnnotationModel AddAnnotation(string text, Guid id)
{
var selectedNodes = this.Nodes == null ? null:this.Nodes.Where(s => s.IsSelected);
var selectedNotes = this.Notes == null ? null: this.Notes.Where(s => s.IsSelected);
if (!CheckIfModelExistsInSameGroup(selectedNodes, selectedNotes))
{
var annotationModel = new AnnotationModel(selectedNodes, selectedNotes)
{
GUID = id,
AnnotationText = text
};
annotationModel.ModelBaseRequested += annotationModel_GetModelBase;
annotationModel.Disposed += (_) => annotationModel.ModelBaseRequested -= annotationModel_GetModelBase;
AddNewAnnotation(annotationModel);
HasUnsavedChanges = true;
return annotationModel;
}
return null;
}