private static void VerifyTypeIndexes(ITypeDataCollection typeDatas, FunctionData functionData) { if (functionData?.ClassType == null) { if (null != functionData) { functionData.ClassTypeIndex = Constants.UnverifiedTypeIndex; } return; } int index = typeDatas.IndexOf(functionData.ClassType); if (-1 == index) { index = typeDatas.Count; typeDatas.Add(functionData.ClassType); } functionData.ClassTypeIndex = index; foreach (IArgument argument in functionData.ParameterType) { VerifyTypeIndexes(typeDatas, argument as Argument); } VerifyTypeIndexes(typeDatas, functionData.ReturnType as Argument); }
private static void RefreshTypeIndex(ISequence sequence, ITypeDataCollection typeDataCollection) { foreach (IVariable variable in sequence.Variables) { Variable variableObj = (variable as Variable); variableObj.TypeIndex = typeDataCollection.IndexOf(variableObj.Type); } foreach (ISequenceStep sequenceStep in sequence.Steps) { RefreshTypeIndex(sequenceStep, typeDataCollection); } }
private static void VerifyTypeIndexes(ITypeDataCollection typeDatas, Argument argument) { if (null == argument.Type || VariableType.Undefined == argument.VariableType) { argument.TypeIndex = Constants.UnverifiedTypeIndex; return; } int index = typeDatas.IndexOf(argument.Type); if (-1 == index) { index = typeDatas.Count; typeDatas.Add(argument.Type); } argument.TypeIndex = index; }
private static void VerifyTypeIndexes(ITypeDataCollection typeDatas, Variable variable) { if (null == variable.Type || VariableType.Undefined == variable.VariableType) { variable.TypeIndex = Constants.UnverifiedTypeIndex; return; } int index = typeDatas.IndexOf(variable.Type); if (-1 == index) { index = typeDatas.Count; typeDatas.Add(variable.Type); } variable.TypeIndex = index; }
private static void RefreshTypeIndex(ISequenceStep sequenceStep, ITypeDataCollection typeDataCollection) { if (sequenceStep.HasSubSteps) { foreach (ISequenceStep subStep in sequenceStep.SubSteps) { RefreshTypeIndex(subStep, typeDataCollection); } } else { FunctionData functionData = sequenceStep.Function as FunctionData; functionData.ClassTypeIndex = typeDataCollection.IndexOf(functionData.ClassType); foreach (IArgument argument in functionData.ParameterType) { RefreshTypeIndex(argument, typeDataCollection); } RefreshTypeIndex(functionData.ReturnType, typeDataCollection); } }
private static void RefreshTypeIndex(IArgument argument, ITypeDataCollection typeDataCollection) { Argument argumentObj = argument as Argument; argumentObj.TypeIndex = typeDataCollection.IndexOf(argumentObj.Type); }