public ModelChangedEventArgsImpl(List<ModelItem> itemsAdded, List<ModelItem> itemsRemoved, List<ModelProperty> propertiesChanged, ModelChangeInfo modelChangeInfo)
 {
     this.itemsAdded = itemsAdded;
     this.itemsRemoved = itemsRemoved;
     this.propertiesChanged = propertiesChanged;
     this.modelChangeInfo = modelChangeInfo;
 }
 internal void OnModelItemRemoved(ModelItem modelItem, ModelChangeInfo changInfo)
 {
     Fx.Assert(modelItem != null, "modelItem should not be null");
     if (ModelChanged != null)
     {
         List<ModelItem> modelItemsRemoved = new List<ModelItem>(1);
         modelItemsRemoved.Add(modelItem);
         ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, modelItemsRemoved, null, changInfo));
         modelTreeManager.SyncModelAndText();
     }
 }
 internal void OnModelItemAdded(ModelItem modelItem, ModelChangeInfo changeInfo)
 {
     Fx.Assert(modelItem != null, "modelItem should not be null");
     if (ModelChanged != null)
     {
         Fx.Assert(modelItem != null, "trying to add empty model item");
         List<ModelItem> modelItemsAdded = new List<ModelItem>(1);
         modelItemsAdded.Add(modelItem);
         ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(modelItemsAdded, null, null, changeInfo));
         modelTreeManager.SyncModelAndText();
     }
 }
        internal void EmitModelChangeInfo(ModelChangeInfo changInfo)
        {
            Fx.Assert(changInfo != null, "changInfo should not be null");

            if (ModelChanged != null)
            {
                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, null, null, changInfo));
                modelTreeManager.SyncModelAndText();
            }
        }
        internal void OnModelPropertyChanged(ModelProperty property, ModelChangeInfo changeInfo)
        {
            Fx.Assert(property != null, "property cannot be null");
            Fx.Assert(changeInfo != null, "changeInfo cannot be null");

            if (ModelChanged != null)
            {
                List<ModelProperty> propertiesChanged = new List<ModelProperty>(1);
                propertiesChanged.Add(property);
                ModelChanged.Invoke(this, new ModelChangedEventArgsImpl(null, null, propertiesChanged, changeInfo));
                modelTreeManager.SyncModelAndText();
            }
        }