/// <summary> /// Adds a new command area by cloning the first command area in the list /// </summary> public void AddNewCommandArea() { if (_commandAreas.Count != 0) { CommandArea CA = new CommandArea(PFSMapper.DeepClone(_commandAreas[0]._pfsHandle)); _commandAreas.Add(CA); _pfsHandle.AddSection(CA._pfsHandle); this.NO_AREAS++; } }
/// <summary> /// Returns a deep clone of the section. Does not clone any parents; /// </summary> /// <param name="SectionToClone"></param> /// <returns></returns> public static PFSSection DeepClone(PFSSection SectionToClone) { PFSSection ps = new PFSSection(SectionToClone.Name); int NumberOfKeywords = SectionToClone.GetKeywordsNo(); for (int i = 1; i <= NumberOfKeywords; i++) { ps.AddKeyword(PFSMapper.DeepClone(SectionToClone.GetKeyword(i))); } int NumberOfSections = SectionToClone.GetSectionsNo(); for (int i = 1; i <= NumberOfSections; i++) { ps.AddSection(PFSMapper.DeepClone(SectionToClone.GetSection(i))); } return(ps); }