Beispiel #1
0
        private string makeText()
        {
            string acc = "";

            foreach (Tuple <int, byte[]> data in accessedData)
            {
                acc += "offset: " + HexTools.intToOffset(data.Item1) + "\r\ndata: \r\n" +
                       HexTools.dataToPrettyString(data.Item2) + "\r\n";
            }
            return(acc);
        }
        private void refreshList()
        {
            string acc = "";
            ReadOnlyCollection <Tuple <int, int> > ranges = owner.freeRanges;
            List <Tuple <int, int> > ranges_mutable       = new List <Tuple <int, int> >(ranges);

            if (offsetSort)
            {
                ranges_mutable.Sort(delegate(Tuple <int, int> first, Tuple <int, int> second)
                {
                    if (first.Item1 == second.Item1)
                    {
                        return(0);
                    }
                    else if (first.Item1 < second.Item1)
                    {
                        return(-1);
                    }
                    else
                    {
                        return(1);
                    }
                });
            }
            else
            {
                ranges_mutable.Sort(delegate(Tuple <int, int> first, Tuple <int, int> second)
                {
                    int firstLen  = first.Item2 - first.Item1;
                    int secondLen = second.Item2 - second.Item1;
                    if (firstLen == secondLen)
                    {
                        return(0);
                    }
                    else if (firstLen < secondLen)
                    {
                        return(-1);
                    }
                    else
                    {
                        return(1);
                    }
                });
            }

            foreach (Tuple <int, int> aRange in ranges_mutable)
            {
                acc += "Start: " + HexTools.intToOffset(aRange.Item1) + "  End: " + HexTools.intToOffset(aRange.Item2) + "\r\nLength: "
                       + HexTools.intToOffset(aRange.Item2 - aRange.Item1) + "\r\n\r\n";
            }
            freespaceListing.Text = acc;
        }