Ejemplo n.º 1
0
        private static BPITEM _findBpItemByFileName(string filename, bool bCreateIfNotExist)
        {
            BPITEM item = null;

            if (breakpoints != null)
            {
                var hash = GetFilenameHash(filename);
                if (breakpoints.ContainsKey(hash))
                {
                    item = breakpoints[hash];
                }
            }

            if (item == null && bCreateIfNotExist)
            {
                item = new BPITEM(filename);
                if (breakpoints == null)
                {
                    breakpoints = new Dictionary <int, BPITEM>();
                }
                breakpoints.Add(item.hash, item);
            }

            __saveCurFileId(item);

            return(item);
        }
Ejemplo n.º 2
0
        //Read BP List log
        public static void ReadBpListLog(string s)
        {
            try {
                m_bpList = new List <BPITEM>();

                //01234567
                //[BPLIST:
                var ns     = s.Substring(8);
                var tokens = ns.Split('|');
                foreach (var t in tokens)
                {
                    var m     = t.Trim('[', ']');
                    var ms    = m.Split(':');
                    var file  = ms[0];
                    var lines = ms[1].Split(',');

                    var item = new BPITEM();
                    item.file  = file;
                    item.lines = new List <int>();
                    Array.ForEach(lines, i => item.lines.Add(int.Parse(i) - 1));

                    m_bpList.Add(item);
                }
            }
            catch
            {
                m_bpList = new List <BPITEM>();
            }
        }
Ejemplo n.º 3
0
 private static void __saveCurFileId(BPITEM item)
 {
     cur_file_id = 0;
     try {
         if (item != null)
         {
             cur_file_id = m_filelist.files.FindIndex(i => i.filename == item.filename);
         }
     } catch { }
     return;
 }