Exemplo n.º 1
0
        protected internal bool IsUrlAtTextPoint(int X, int Y, out string Url, bool NeedUrl)
        {
            bool flag1 = false;

            Url = string.Empty;
            if (this.HighlightUrls)
            {
                StrItem item1 = this.owner.Lines.GetItem(Y);
                if (item1 == null)
                {
                    return(flag1);
                }
                short[] numArray1 = item1.ColorData;
                flag1 = ((X >= 0) && (X < numArray1.Length)) && ((((byte)(numArray1[X] >> 8)) & 0x10) != ((byte)0));
                if (!flag1 || !NeedUrl)
                {
                    return(flag1);
                }
                int num1 = X;
                int num2 = X;
                while ((num1 > 0) && ((((byte)(numArray1[num1 - 1] >> 8)) & 0x10) != ((byte)0)))
                {
                    num1--;
                }
                while ((num2 < (numArray1.Length - 1)) && ((((byte)(numArray1[num2 + 1] >> 8)) & 0x10) != ((byte)0)))
                {
                    num2++;
                }
                Url = item1.String.Substring(num1, (num2 - num1) + 1);
            }
            return(flag1);
        }
Exemplo n.º 2
0
        public char GetCharAt(int X, int Y)
        {
            StrItem item1 = this.GetItem(Y);

            if (((item1 != null) && (X >= 0)) && (X < item1.String.Length))
            {
                return(item1.String[X]);
            }
            return('\0');
        }
Exemplo n.º 3
0
 public void InitHitTestInfo()
 {
     this.HitTest      = River.Orqa.Editor.HitTest.None;
     this.Item         = null;
     this.String       = null;
     this.Word         = null;
     this.Url          = null;
     this.GutterImage  = -1;
     this.OutlineRange = null;
     this.Page         = -1;
 }
Exemplo n.º 4
0
 public void RemoveAt(int index)
 {
     if ((index >= 0) && (index < this.Count))
     {
         this.list.RemoveAt(index);
         if (index < this.Count)
         {
             StrItem item1 = (StrItem)this.list[index];
             unchecked
             {
                 item1.State &= ((StrItemState)(-2));
             }
         }
         this.Changed(index, 0x7fffffff);
     }
 }
Exemplo n.º 5
0
 public string this[int index]
 {
     get
     {
         if ((index >= 0) && (index < this.Count))
         {
             return(((StrItem)this.list[index]).String);
         }
         return(string.Empty);
     }
     set
     {
         StrItem item1 = (StrItem)this.list[index];
         item1.String = value;
         unchecked { item1.State &= ((StrItemState)(-2)); }
         this.Changed(index);
     }
 }
Exemplo n.º 6
0
 protected internal void GetTabString(ref string String, ref short[] Data, bool NeedData)
 {
     if (((String != null) && (String != string.Empty)) && (String.IndexOf('\t') >= 0))
     {
         this.tabBuilder.Length = 0;
         int      num1       = 0;
         int      num2       = 0;
         bool     flag1      = true;
         string[] textArray1 = String.Split(this.tabArray);
         string[] textArray2 = textArray1;
         int      num6       = 0;
         while (num6 < textArray2.Length)
         {
             string text1 = textArray2[num6];
             if (flag1)
             {
                 this.tabBuilder.Append(text1);
                 flag1 = false;
                 num1  = text1.Length;
             }
             else
             {
                 num2 = this.GetTabStop(num1) - num1;
                 this.tabBuilder.Append(new string(' ', num2));
                 this.tabBuilder.Append(text1);
                 num1 += (text1.Length + num2);
             }
             num6++;
         }
         String = this.tabBuilder.ToString();
         if (NeedData)
         {
             short[] numArray1 = new short[String.Length];
             num1 = 0;
             int num3 = 0;
             num2       = 0;
             flag1      = true;
             textArray2 = textArray1;
             for (num6 = 0; num6 < textArray2.Length; num6++)
             {
                 string text2 = textArray2[num6];
                 if (flag1)
                 {
                     flag1 = false;
                     num1  = text2.Length;
                     num3  = num1;
                     if (num1 != 0)
                     {
                         Array.Copy(Data, 0, numArray1, 0, num1);
                     }
                 }
                 else
                 {
                     num2 = this.GetTabStop(num1) - num1;
                     for (int num5 = num1; num5 < (num1 + num2); num5++)
                     {
                         numArray1[num5] = Data[num3];
                     }
                     StrItem.SetColorFlag(ref numArray1, num1 + (num2 / 2), 1, 2, true);
                     int num4 = text2.Length;
                     Array.Copy(Data, (int)(num3 + 1), numArray1, (int)(num1 + num2), num4);
                     num1 += (num4 + num2);
                     num3 += (num4 + 1);
                 }
             }
             Data = numArray1;
         }
     }
 }