public ResolvedAttribute Copy() { ResolveOptions resOpt = this.ResolvedTraits.ResOpt; // use the options from the traits ResolvedAttribute copy = new ResolvedAttribute(resOpt, this.Target, this._resolvedName, null) { PreviousResolvedName = this.PreviousResolvedName, ResolvedName = this.ResolvedName, ResolvedAttributeCount = this.ResolvedAttributeCount, ResolvedTraits = this.ResolvedTraits.ShallowCopy(), InsertOrder = this.InsertOrder, Arc = this.Arc, AttCtx = this.AttCtx // set here instead of constructor to avoid setting lineage for this copy }; if (copy.Target is ResolvedAttributeSet) { // deep copy when set contains sets. this copies the resolved att set and the context, etc. copy.Target = copy.Target.Copy(); } if (ApplierState != null) { copy.ApplierState = ApplierState.Copy(); } return(copy); }
public ResolvedAttribute Copy() { ResolveOptions resOpt = this.ResolvedTraits.ResOpt; // use the options from the traits ResolvedAttribute copy = new ResolvedAttribute(resOpt, this.Target, this._resolvedName, this.AttCtx) { ResolvedName = this.ResolvedName, ResolvedTraits = this.ResolvedTraits.ShallowCopy(), InsertOrder = this.InsertOrder, Arc = this.Arc }; if (ApplierState != null) { copy.ApplierState = ApplierState.Copy(); } return(copy); }