コード例 #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="owner">Parent window.</param>
        /// <param name="omfFile">OMF file object.</param>
        /// <param name="omfSeg">Segment to view.  Must be part of omfFile.</param>
        /// <param name="formatter">Text formatter.</param>
        public OmfSegmentViewer(Window owner, OmfFile omfFile, OmfSegment omfSeg,
                                Formatter formatter)
        {
            InitializeComponent();
            Owner       = owner;
            DataContext = this;

            //mOmfFile = omfFile;
            mOmfSeg    = omfSeg;
            mFormatter = formatter;

            string fmt = (string)FindResource("str_FileOffsetLenFmt");

            FileOffsetLenStr = string.Format(fmt,
                                             mFormatter.FormatOffset24(omfSeg.FileOffset),
                                             omfSeg.FileLength,
                                             mFormatter.FormatHexValue(omfSeg.FileLength, 4));

            GenerateHeaderItems();

            RecordItems = omfSeg.Records;
            RelocItems  = new List <RelocItem>(omfSeg.Relocs.Count);
            foreach (OmfReloc omfRel in omfSeg.Relocs)
            {
                RelocItems.Add(new RelocItem(omfRel, formatter));
            }
            RelocItems.Sort(delegate(RelocItem a, RelocItem b) {
                return(a.RelocRef.Offset - b.RelocRef.Offset);
            });

            fmt             = (string)FindResource("str_RecordHeaderFmt");
            RecordHeaderStr = string.Format(fmt, RecordItems.Count);
            fmt             = (string)FindResource("str_RelocHeaderFmt");
            RelocHeaderStr  = string.Format(fmt, RelocItems.Count);
        }
コード例 #2
0
ファイル: OmfViewer.xaml.cs プロジェクト: retroric/6502bench
 public SegmentListItem(OmfSegment omfSeg) {
     OmfSeg = omfSeg;
 }