/// <summary> /// Assign property values and state flags from given <paramref name="entity"/>. /// </summary> /// <param name="entity">Source entity.</param> public virtual void Assign(object entity) { Guard.ArgumentNotNull(entity, "entity"); TikEntityBase castedEntity = entity as TikEntityBase; if (castedEntity == null) { throw new ArgumentException("Given entity is not of TikEntityBase type.", "entity"); } //assign flags isMarkedDeleted = castedEntity.isMarkedDeleted; isMarkedNew = castedEntity.isMarkedNew; //assign property values properties = castedEntity.Properties; //not very clear ... there should be better solution for value-copy process! }
/// <summary> /// Determines whether is data-equal with the specified <paramref name="tikPropertyList"/>. /// </summary> /// <param name="tikPropertyList">The tik property list to compare.</param> /// <returns> /// <c>true</c> if is data-equal with the specified <paramref name="tikPropertyList"/>; otherwise, <c>false</c>. /// </returns> public bool IsDataEqual(TikPropertyList tikPropertyList) { foreach (KeyValuePair <string, TikPropertyItem> pair in items) { TikPropertyItem item2; if (!tikPropertyList.items.TryGetValue(pair.Key, out item2)) { return(false); } else { if (!pair.Value.IsDataEqual(item2)) { return(false); } } } return(true); }
/// <summary> /// Determines whether is data-equal with the specified <paramref name="tikPropertyList"/>. /// </summary> /// <param name="tikPropertyList">The tik property list to compare.</param> /// <returns> /// <c>true</c> if is data-equal with the specified <paramref name="tikPropertyList"/>; otherwise, <c>false</c>. /// </returns> public bool IsDataEqual(TikPropertyList tikPropertyList) { foreach (KeyValuePair<string, TikPropertyItem> pair in items) { TikPropertyItem item2; if (!tikPropertyList.items.TryGetValue(pair.Key, out item2)) return false; else { if (!pair.Value.IsDataEqual(item2)) return false; } } return true; }
/// <summary> /// Assign property values and state flags from given <paramref name="entity"/>. /// </summary> /// <param name="entity">Source entity.</param> public virtual void Assign(object entity) { Guard.ArgumentNotNull(entity, "entity"); TikEntityBase castedEntity = entity as TikEntityBase; if (castedEntity == null) throw new ArgumentException("Given entity is not of TikEntityBase type.", "entity"); //assign flags isMarkedDeleted = castedEntity.isMarkedDeleted; isMarkedNew = castedEntity.isMarkedNew; //assign property values properties = castedEntity.Properties; //not very clear ... there should be better solution for value-copy process! }