public override void CheckIn() { if (IsDirty && !IsDeleted) { _EventFrameController.Update(_Connection, this); if (_EventFrames != null) { foreach (AFEventFrame frame in _EventFrames.Where(x => x.IsNew || x.IsDeleted)) { if (frame.IsNew) { _EventFrameController.CreateEventFrame(_Connection, WebID, frame); } else if (frame.IsDeleted) { frame.Delete(); frame.CheckIn(); } } } if (_Attributes != null) { foreach (AFAttribute attr in _Attributes.Where(x => x.IsDeleted)) { AFAttribute.Delete(_Connection, attr.WebID); } } ResetState(); } }
private void AttributesChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) { AFAttribute.Create(_Connection, this._ID, (AFAttribute)sender); } else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) { AFAttribute obj = (AFAttribute)sender; AFAttribute.Delete(_Connection, obj.ID); } else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace) { throw new NotImplementedException("Replace is not supported by LazyPI."); } else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset) { throw new NotImplementedException("Reset is not supported by LazyPI."); } else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Move) { throw new NotImplementedException("Move is not supported by LazyPI."); } }