public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Deletable=" + Deletable.ToString()); sb.AppendLine("Editable=" + Editable.ToString()); sb.AppendLine("Renamable=" + Renamable.ToString()); return(sb.ToString()); }
public override void Delete(TEntity entityToDelete) { if (entityToDelete is ISoftDeletable Deletable) { Deletable.Delete(); if (context.Entry(entityToDelete).State == EntityState.Detached) { dbSet.Attach(entityToDelete); } } }
/// <summary> /// Validates a <see cref="Deletable" /> instance. /// </summary> /// <param name="deletable">The <see cref="Deletable" /> instance to validate.</param> public static void Validate(Deletable deletable) { if (deletable == null) { throw new ArgumentNullException(nameof(deletable)); } if (string.IsNullOrWhiteSpace(deletable.Queue)) { throw new MissingQueueException("Deletable"); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (Inline != null) { hashCode = hashCode * 59 + Inline.GetHashCode(); } if (Moveable != null) { hashCode = hashCode * 59 + Moveable.GetHashCode(); } if (Disabled != null) { hashCode = hashCode * 59 + Disabled.GetHashCode(); } if (Deletable != null) { hashCode = hashCode * 59 + Deletable.GetHashCode(); } if (Editable != null) { hashCode = hashCode * 59 + Editable.GetHashCode(); } if (Comment != null) { hashCode = hashCode * 59 + Comment.GetHashCode(); } if (Mutation != null) { hashCode = hashCode * 59 + Mutation.GetHashCode(); } if (Children != null) { hashCode = hashCode * 59 + Children.GetHashCode(); } if (Fields != null) { hashCode = hashCode * 59 + Fields.GetHashCode(); } if (Next != null) { hashCode = hashCode * 59 + Next.GetHashCode(); } return(hashCode); } }
public void Deselect() { if (selected) { GameObject deselected = selected.gameObject; selected.Deselect(); Deletable deletable = selected.GetComponent <Deletable>(); if (deletable) { deletable.OnDelete -= Deselect; } selected = null; if (OnDeselect != null) { OnDeselect(deselected); } } }
public void Select(Selectable target) { Deselect(); target.Select(); selected = target; Deletable deletable = target.GetComponent <Deletable>(); if (deletable) { deletable.OnDelete += Deselect; } if (OnSelect != null) { OnSelect(selected.gameObject); } }
public override bool Equals(object o) { if (!(o is Properties)) { return(false); } Properties v = o as Properties; if (!Deletable.Equals(v.Deletable)) { return(false); } if (!IsShared.Equals(v.IsShared)) { return(false); } if (!Renamable.Equals(v.Renamable)) { return(false); } return(true); }
public override bool Equals(object o) { if (!(o is Properties)) { return(false); } var v = o as Properties; if (!Deletable.Equals(v.Deletable)) { return(false); } if (!Editable.Equals(v.Editable)) { return(false); } if (!Renamable.Equals(v.Renamable)) { return(false); } return(true); }
public void AddTestData() { Creatables.Add(new TestCreatable { Id = Guid.Empty }); Modifiables.Add(new TestModifiable { Id = Guid.Empty }); Deletable.Add(new TestDeletable { Id = Guid.Empty }); Effectable.Add(new TestEffectable { Id = Guid.Empty }); Ownable.Add(new TestOwnable { Id = Guid.Empty }); SaveChanges(); }
public void StoreValues(Data data, string path) { data.SetValue(@"" + path + @"Deletable", Deletable.ToString()); data.SetValue(@"" + path + @"Editable", Editable.ToString()); data.SetValue(@"" + path + @"Renamable", Renamable.ToString()); }
public Task <DeleteResponse> Delete(Deletable deletable, CancellationToken cancellationToken = default) { throw new NotImplementedException(); }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Icon.Length != 0) { hash ^= Icon.GetHashCode(); } if (Prefab.Length != 0) { hash ^= Prefab.GetHashCode(); } if (Rarity != 0L) { hash ^= Rarity.GetHashCode(); } if (Description.Length != 0) { hash ^= Description.GetHashCode(); } if (ShowInVaultItemMenu != false) { hash ^= ShowInVaultItemMenu.GetHashCode(); } if (Deletable != false) { hash ^= Deletable.GetHashCode(); } if (ShowInRewardsFlow != false) { hash ^= ShowInRewardsFlow.GetHashCode(); } if (color_ != null) { hash ^= Color.GetHashCode(); } if (Background.Length != 0) { hash ^= Background.GetHashCode(); } if (Ordering != 0) { hash ^= Ordering.GetHashCode(); } if (rewardSound_ != null) { hash ^= RewardSound.GetHashCode(); } if (RewardSoundPriority != 0) { hash ^= RewardSoundPriority.GetHashCode(); } if (SpineAnimatedIcon.Length != 0) { hash ^= SpineAnimatedIcon.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// Casts a deletable into the type required by the provider. /// </summary> /// <param name="deletable">The deletable to cast and validate.</param> /// <param name="validationCriteria">The validation criteria.</param> /// <returns>The casted deletable.</returns> protected TDeletable CastAndValidate( Deletable deletable, params Func <TDeletable, (bool success, string attributeName)>[] validationCriteria
/// <inheritdoc /> public abstract Task <DeleteResponse> Delete( Deletable deletable, CancellationToken cancellationToken = default );
public Task <DeleteResponse> Delete(Deletable deletable, CancellationToken cancellationToken = default) { DeletedMessages.Add(deletable); return(Task.FromResult(new DeleteResponse())); }
/// <summary> /// Returns true if DesignerBlockBean instances are equal /// </summary> /// <param name="input">Instance of DesignerBlockBean to be compared</param> /// <returns>Boolean</returns> public bool Equals(DesignerBlockBean input) { if (input == null) { return(false); } return (( Type == input.Type || (Type != null && Type.Equals(input.Type)) ) && ( Inline == input.Inline || (Inline != null && Inline.Equals(input.Inline)) ) && ( Moveable == input.Moveable || (Moveable != null && Moveable.Equals(input.Moveable)) ) && ( Disabled == input.Disabled || (Disabled != null && Disabled.Equals(input.Disabled)) ) && ( Deletable == input.Deletable || (Deletable != null && Deletable.Equals(input.Deletable)) ) && ( Editable == input.Editable || (Editable != null && Editable.Equals(input.Editable)) ) && ( Comment == input.Comment || (Comment != null && Comment.Equals(input.Comment)) ) && ( Mutation == input.Mutation || Mutation != null && Mutation.SequenceEqual(input.Mutation) ) && ( Children == input.Children || Children != null && Children.SequenceEqual(input.Children) ) && ( Fields == input.Fields || Fields != null && Fields.SequenceEqual(input.Fields) ) && ( Next == input.Next || (Next != null && Next.Equals(input.Next)) )); }