public override ILazinator CloneLazinator(IncludeChildrenMode includeChildrenMode = IncludeChildrenMode.IncludeAllChildren, CloneBufferOptions cloneBufferOptions = CloneBufferOptions.IndependentBuffers) { ExampleChildInherited clone; if (cloneBufferOptions == CloneBufferOptions.NoBuffer) { clone = new ExampleChildInherited(includeChildrenMode); clone.LazinatorObjectVersion = LazinatorObjectVersion; clone = (ExampleChildInherited)AssignCloneProperties(clone, includeChildrenMode); } else { LazinatorMemory bytes = EncodeOrRecycleToNewBuffer(includeChildrenMode, OriginalIncludeChildrenMode, IsDirty, DescendantIsDirty, false, LazinatorMemoryStorage, this); clone = new ExampleChildInherited(bytes); } return(clone); }
protected override ILazinator AssignCloneProperties(ILazinator clone, IncludeChildrenMode includeChildrenMode) { base.AssignCloneProperties(clone, includeChildrenMode); ExampleChildInherited typedClone = (ExampleChildInherited)clone; typedClone.MyInt = MyInt; if (includeChildrenMode != IncludeChildrenMode.ExcludeAllChildren && includeChildrenMode != IncludeChildrenMode.IncludeOnlyIncludableChildren) { if (MyGrandchildInInherited == null) { typedClone.MyGrandchildInInherited = null; } else { typedClone.MyGrandchildInInherited = (ExampleGrandchild)MyGrandchildInInherited.CloneLazinator(includeChildrenMode, CloneBufferOptions.NoBuffer); } } return(typedClone); }