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 Owner = this.Owner }; 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); }
private void InitializeInstanceFields() { _applierState = new ApplierState(this); }