/// <summary> /// Creates the stack levels. /// </summary> private void createStackLevels() { int localLevel = -1; bool isLocalLevelFound = false; foreach (var context in sourceSnapshots) { foreach (var stack in context.Structure.Readonly.ReadonlyStackContexts) { if (!targetStructure.ContainsStackWithLevel(stack.StackLevel)) { writeableTargetStructure.AddStackLevel(stack.StackLevel); } } if (localLevel != context.Structure.Readonly.CallLevel) { if (!isLocalLevelFound) { localLevel = context.Structure.Readonly.CallLevel; isLocalLevelFound = true; } else { localLevel = Snapshot.GLOBAL_CALL_LEVEL; } } } writeableTargetStructure.SetLocalStackLevelNumber(localLevel); writeableTargetStructure.WriteableChangeTracker.SetCallLevel(localLevel); }