Example #1
0
 private void markLinepositions()
 {
     try
     {
         string[] temp = prog.Split('\n');
         m_user.Clear();
         for (int i = 0; i < temp.Length && i < editedNum.Keys.Count; i++)
         {
             userhighlight u = new userhighlight();
             int length = 0;
             int x = 0;
             int[] keys = new int[editedNum.Count];
             editedNum.Keys.CopyTo(keys, 0);
             for (int j = 0; j < keys[i]; j++)
             {
                 if (temp[j].IndexOf('\r') != -1)
                     length += temp[j].Substring(0, temp[j].IndexOf('\r')).Length;
                 else
                     length += temp[j].Length;
             }
             u.start = length + (i) * 4 + 2;
             u.name = (string)editedNum[i];
             if (temp[i].IndexOf('\r') != -1)
             {
                 u.size = temp[i].Substring(0, temp[i].IndexOf('\r')).Length;
                 m_user.Add(u);
             }
         }
         userformat();
         //syntax();
     }
     catch (Exception except)
     {
         //System.Windows.MessageBox.Show("Exception in Marking line position"+except.StackTrace);
     }
 }
Example #2
0
        private void markLinepositions()
        {
            if (prog != "")
            {
                string[] temp = prog.Split('\n');
                m_user.Clear();
                for (int i = 0; i < editedNum.Keys.Count; i++)
                {
                    userhighlight u = new userhighlight();

                    int length = 0;
                    int x = 0;
                    for (int j = 0; j < i; j++)
                    {
                        if (temp[j].IndexOf('\r') != -1)
                            length += temp[j].Substring(0, temp[j].IndexOf('\r')).Length;
                        else
                            length += temp[j].Length;
                    }
                    u.start = length + (i) * 4 + 2;
                    u.name = (string)editedNum[i];
                    if (temp[i].IndexOf('\r') != -1)
                    {
                        u.size = temp[i].Substring(0, temp[i].IndexOf('\r')).Length;
                        m_user.Add(u);
                    }
                }
                userformat();
            }
        }