コード例 #1
0
ファイル: Sequence.cs プロジェクト: spartajet/Testflow
        public void Initialize(ISequenceFlowContainer parent)
        {
            SequenceGroup sequenceGroup = parent as SequenceGroup;

            this.Description = string.Empty;
            this.Parent      = parent;
            this.Variables   = new VariableCollection();
            this.Steps       = new SequenceStepCollection();
            ModuleUtils.SetElementName(this, sequenceGroup.Sequences);
        }
コード例 #2
0
 public void RefreshSignature(SequenceGroup parent)
 {
     this.Info.Hash = parent.Info.Hash;
     this.Info.Version = parent.Info.Version;
     if (Info.Modified)
     {
         this.Info.Modified = false;
         this.Info.ModifiedTime = DateTime.Now;
     }
 }
コード例 #3
0
ファイル: SequenceGroup.cs プロジェクト: spartajet/Testflow
        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);
        }