protected override void XmlSerializeChildren(CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters) { // Get the code segments CIElementList <CICodeSeg> codeSegs = aParameters.Container.ChildrenByType <CICodeSeg>(CIElement.TChildSearchType.EEntireHierarchy); // Sort them Comparison <CICodeSeg> comparer = delegate(CICodeSeg aLeft, CICodeSeg aRight) { return(string.Compare(aLeft.Name, aRight.Name, true)); }; codeSegs.Sort(comparer); // List them foreach (CICodeSeg codeSeg in codeSegs) { CXmlCodeSeg xmlCodeSeg = new CXmlCodeSeg(codeSeg); xmlCodeSeg.XmlSerialize(aParameters); } }
internal void AddCodeSegments(CIContainer aContainer) { // Get the code segments CIElementList <CICodeSeg> codeSegs = aContainer.ChildrenByType <CICodeSeg>(CIElement.TChildSearchType.EEntireHierarchy); // Sort them Comparison <CICodeSeg> comparer = delegate(CICodeSeg aLeft, CICodeSeg aRight) { return(string.Compare(aLeft.Name, aRight.Name, true)); }; codeSegs.Sort(comparer); // List them foreach (CICodeSeg codeSeg in codeSegs) { uint start = codeSeg.Range.Min; uint end = codeSeg.Range.Max; string name = codeSeg.Name; CXmlCodeSegItem ciCodeSeg = new CXmlCodeSegItem(start, end, name); iCodeSegs.Add(ciCodeSeg); } }