Пример #1
0
        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);
        }
Пример #2
0
 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);
     }
 }
Пример #3
0
        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;
        }
Пример #4
0
        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;
        }
Пример #5
0
 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);
     }
 }
Пример #6
0
        private static void RefreshTypeIndex(IArgument argument, ITypeDataCollection typeDataCollection)
        {
            Argument argumentObj = argument as Argument;

            argumentObj.TypeIndex = typeDataCollection.IndexOf(argumentObj.Type);
        }