/// <summary> /// Copies all known values from one instance to another. Helper method for instance cloning. /// </summary> protected static void CloneFromTo([NotNull] Element from, [NotNull] Element to) { #region Sanity checks if (from == null) { throw new ArgumentNullException(nameof(@from)); } if (to == null) { throw new ArgumentNullException(nameof(to)); } #endregion TargetBase.CloneFromTo(from, to); to.Version = from.Version; to.VersionModifier = from.VersionModifier; to.Released = from.Released; to.ReleasedVerbatim = from.ReleasedVerbatim; to.Stability = from.Stability; to.License = from.License; to.Main = from.Main; to.SelfTest = from.SelfTest; to.DocDir = from.DocDir; to.Commands.AddRange(from.Commands.CloneElements()); to.Dependencies.AddRange(from.Dependencies.CloneElements()); to.Restrictions.AddRange(from.Restrictions.CloneElements()); to.Bindings.AddRange(from.Bindings.CloneElements()); }
/// <inheritdoc/> protected bool Equals(TargetBase other) { if (other == null) { return(false); } return(base.Equals(other) && _languages.SetEquals(other._languages) && other.Architecture == Architecture); }
/// <summary> /// Copies all known values from one instance to another. Helper method for instance cloning. /// </summary> protected static void CloneFromTo([NotNull] TargetBase from, [NotNull] TargetBase to) { #region Sanity checks if (from == null) { throw new ArgumentNullException(nameof(@from)); } if (to == null) { throw new ArgumentNullException(nameof(to)); } #endregion to.UnknownElements = from.UnknownElements; to.UnknownAttributes = from.UnknownAttributes; to.Languages.Clear(); to.Languages = new LanguageSet(from.Languages); to.ArchitectureString = from.ArchitectureString; }
/// <inheritdoc/> protected bool Equals(TargetBase other) { if (other == null) return false; return base.Equals(other) && _languages.SetEquals(other._languages) && other.Architecture == Architecture; }