public ISequenceDataContainer Clone() { SequenceStepParameterCollection subStepParameters = null; if (null != this.SubStepParameters) { subStepParameters = new SequenceStepParameterCollection(); ModuleUtils.CloneDataCollection(this.SubStepParameters, subStepParameters); } ParameterDataCollection dataCollection = null; if (null != Parameters) { dataCollection = new ParameterDataCollection(); ModuleUtils.CloneCollection(Parameters, dataCollection); } SequenceStepParameter stepParameter = new SequenceStepParameter() { Index = Constants.UnverifiedIndex, SubStepParameters = subStepParameters, Parameters = dataCollection, Instance = string.Empty, Return = string.Empty }; return(stepParameter); }
public IFunctionData Clone() { ArgumentCollection parameterType = new ArgumentCollection(); ModuleUtils.CloneCollection(ParameterType, parameterType); ParameterDataCollection parameters = null; if (Parameters != null) { parameters = new ParameterDataCollection(); ModuleUtils.CloneCollection(Parameters, parameters); } FunctionData functionData = new FunctionData() { Type = this.Type, MethodName = this.MethodName, ClassType = this.ClassType, ClassTypeIndex = this.ClassTypeIndex, ParameterType = parameterType, Parameters = parameters, Instance = this.Instance, Return = this.Return, ReturnType = this.ReturnType?.Clone(), Description = this.Description }; return(functionData); }
ISequenceFlowContainer ICloneableClass <ISequenceFlowContainer> .Clone() { AssemblyInfoCollection assemblies = new AssemblyInfoCollection(); foreach (IAssemblyInfo assemblyInfo in this.Assemblies) { assemblies.Add(assemblyInfo); } TypeDataCollection typeDatas = new TypeDataCollection(); foreach (ITypeData typeData in TypeDatas) { typeDatas.Add(typeData); } ArgumentCollection arguments = new ArgumentCollection(); ModuleUtils.CloneCollection(this.Arguments, arguments); VariableCollection variables = new VariableCollection(); ModuleUtils.CloneFlowCollection(this.Variables, variables); // SequenceGroupParameter只在序列化时使用 // Parameters只有在序列化时才会生成,在加载完成后会被删除 ISequenceGroupParameter parameters = (null == Parameters) ? null : this.Parameters.Clone() as ISequenceGroupParameter; SequenceCollection sequenceCollection = new SequenceCollection(); ModuleUtils.CloneFlowCollection(this.Sequences, sequenceCollection); SequenceGroup sequenceGroup = new SequenceGroup() { Name = this.Name + Constants.CopyPostfix, Description = this.Description, Parent = this.Parent, Info = this.Info.Clone(), Assemblies = assemblies, TypeDatas = typeDatas, Arguments = arguments, Variables = variables, Parameters = parameters, ExecutionModel = this.ExecutionModel, SetUp = this.SetUp.Clone() as ISequence, Sequences = sequenceCollection, TearDown = this.TearDown.Clone() as ISequence }; sequenceGroup.SetUp.Index = CommonConst.SetupIndex; sequenceGroup.TearDown.Index = CommonConst.TeardownIndex; sequenceGroup.RefreshSignature(); return(sequenceGroup); }