Example #1
0
 public bool DeepEquals(InventoryItemEquippingBlock other)
 {
     return(other != null &&
            GearsetItem.DeepEquals(other.GearsetItem) &&
            AmmoType == other.AmmoType &&
            Attributes == other.Attributes &&
            DisplayStrings.DeepEqualsReadOnlySimpleCollection(other.DisplayStrings) &&
            EquipmentSlotType.DeepEquals(other.EquipmentSlotType) &&
            EquippingSoundHash == other.EquippingSoundHash &&
            HornSoundHash == other.HornSoundHash &&
            UniqueLabel == other.UniqueLabel &&
            UniqueLabelHash == other.UniqueLabelHash);
 }
Example #2
0
        protected virtual void WriteContent()
        {
            bool flag1 = this.owner.Source.Lexer != null;

            if (flag1)
            {
                this.owner.Source.ParseToString(this.owner.Lines.Count - 1);
            }
            string text1 = string.Empty;

            short[]        numArray1 = null;
            DisplayStrings strings1  = (DisplayStrings)this.owner.DisplayLines;

            this.firstLine = true;
            for (int num5 = 0; num5 < strings1.Lines.Count; num5++)
            {
                strings1.GetString(num5, ref text1, ref numArray1, flag1, false);
                int num4 = text1.Length;
                this.StartLine();
                this.firstLine = false;
                if (flag1 && (text1 != string.Empty))
                {
                    int num1 = numArray1[0];
                    int num2 = num1;
                    int num3 = 0;
                    for (int num6 = 1; num6 < num4; num6++)
                    {
                        num1 = numArray1[num6];
                        if ((num1 != num2) && !((SyntaxEdit)this.owner).EqualStyles(num2, num1, true))
                        {
                            this.WriteLine(text1, num2, num3, num6 - 1);
                            num2 = num1;
                            num3 = num6;
                        }
                    }
                    if (num3 < num4)
                    {
                        this.WriteLine(text1, num2, num3, num4 - 1);
                    }
                }
                else
                {
                    this.WriteLine(text1, -1, 0, num4 - 1);
                }
                this.EndLine();
            }
        }
Example #3
0
 protected internal bool IsMouseOnOutlineImage(int X, int Y)
 {
     if (this.AllowOutlining())
     {
         DisplayStrings strings1 = (DisplayStrings)this.owner.DisplayLines;
         Point          point1   = this.owner.ScreenToDisplay(X, Y);
         int            num1     = point1.Y;
         point1 = strings1.DisplayPointToPoint(point1);
         this.owner.Outlining.GetOutlineRanges(this.ranges, point1.Y);
         Point point2 = strings1.DisplayPointToPoint(0x7fffffff, num1, true, false, false);
         bool  flag1  = false;
         foreach (IOutlineRange range1 in this.ranges)
         {
             if (this.CompareRange(range1.StartPoint, point1, point2) == 0)
             {
                 flag1 = true;
                 break;
             }
         }
         if (flag1)
         {
             int num2 = this.GetOutlineLeft() + this.Rect.Left;
             int num3 = this.owner.Painter.FontHeight;
             point1 = this.ScreenToClient(X, Y);
             int num4 = this.Rect.Top;
             int num5 = (num3 == 0) ? point1.Y : (num4 + (((point1.Y - num4) / num3) * num3));
             int num6 = EditConsts.DefaultCollasedImageWidth;
             this.CenterOutlineRect(ref num2, ref num5, num3);
             if (((point1.X >= (num2 - 1)) && (point1.X <= ((num2 + num6) + 1))) && (point1.Y >= (num5 - 1)))
             {
                 return(point1.Y <= ((num5 + num6) + 1));
             }
             return(false);
         }
     }
     return(false);
 }
Example #4
0
        private void DrawGutter(ITextPainter Painter, Rectangle Rect, bool CalcIndex, int Line, int ImageX, ref int ImageIndex)
        {
            int       num1  = Rect.Top;
            int       num2  = this.owner.Painter.FontHeight;
            bool      flag1 = (this.owner.Outlining.OutlineOptions & OutlineOptions.DrawLines) != OutlineOptions.None;
            bool      flag2 = this.owner.Outlining.AllowOutlining;
            bool      flag3 = (this.options & GutterOptions.PaintLinesBeyondEof) != GutterOptions.None;
            bool      flag4 = this.NeedLineNumbers();
            bool      flag5 = (this.options & GutterOptions.PaintBookMarks) != GutterOptions.None;
            bool      flag6 = flag4 && (this.visible & ((this.options & GutterOptions.PaintLinesOnGutter) != GutterOptions.None));
            int       num3  = this.GetLineNumbersLeft(true);
            int       num4  = this.GetLineNumbersRight(true);
            int       num5  = this.GetOutlineLeft();
            int       num6  = Rect.Left + this.GetPaintWidth(false);
            int       num7  = this.owner.DisplayLines.GetCount();
            ArrayList list1 = new ArrayList();

            while ((num1 < Rect.Bottom) || CalcIndex)
            {
                Point point1 = this.owner.DisplayLines.DisplayPointToPoint(0, Line);
                if ((Line >= num7) && (!flag4 || !flag3))
                {
                    break;
                }
                if (flag4 && !CalcIndex)
                {
                    if (point1.X == 0)
                    {
                        this.DrawLineNumber(Painter, point1.Y, num3, num1, flag6);
                    }
                    else if (!this.Transparent)
                    {
                        Color color1 = Painter.BkColor;
                        try
                        {
                            Painter.BkColor = flag6 ? this.BrushColor : this.lineNumbersBackColor;
                            Painter.FillRectangle(num3, num1, num4 - num3, num2);
                        }
                        finally
                        {
                            Painter.BkColor = color1;
                        }
                    }
                }
                if (Line < num7)
                {
                    int num8 = 0;
                    if (this.Visible)
                    {
                        if ((this.owner.WordWrap && (point1.X != 0)) && ((this.wrapImageIndex >= 0) && this.CanDrawImage(this.wrapImageIndex, num8, num6)))
                        {
                            if ((CalcIndex && (ImageX >= num8)) && (ImageX < (num8 + this.Images.ImageSize.Width)))
                            {
                                ImageIndex = this.wrapImageIndex;
                                return;
                            }
                            num8 = this.DrawImage(Painter, this.wrapImageIndex, point1.Y, num8, num1, num6, !CalcIndex, this.Transparent || ((num8 >= num3) && ((num8 + this.Images.ImageSize.Width) <= num4)));
                        }
                        if (num1 >= (Rect.Top - this.Images.ImageSize.Height))
                        {
                            if (point1.X == 0)
                            {
                                int num9 = ((LineStyles)this.owner.Source.LineStyles).GetLineStyle(point1.Y);
                                if (((num9 >= 0) && (num9 < this.owner.LineStyles.Count)) && (!this.owner.Outlining.AllowOutlining || this.owner.Outlining.IsVisible(point1.Y)))
                                {
                                    num9 = ((LineStylesEx)this.owner.LineStyles).GetStyle(num9).ImageIndex;
                                    if (this.CanDrawImage(num9, num8, num6))
                                    {
                                        if ((CalcIndex && (ImageX >= num8)) && (ImageX < (num8 + this.Images.ImageSize.Width)))
                                        {
                                            ImageIndex = num9;
                                            return;
                                        }
                                        num8 += this.DrawImage(Painter, num9, point1.Y, num8, num1, num6, !CalcIndex, this.Transparent || ((num8 >= num3) && ((num8 + this.Images.ImageSize.Width) <= num4)));
                                    }
                                }
                            }
                            if (flag5)
                            {
                                Point point2 = ((DisplayStrings)this.owner.DisplayLines).DisplayPointToPoint(0x7fffffff, Line, true, false, false);
                                this.owner.Source.BookMarks.GetBookMarks(point1, point2, list1);
                                foreach (IBookMark mark1 in list1)
                                {
                                    if (this.owner.Outlining.AllowOutlining && !this.owner.Outlining.IsVisible(new Point(mark1.Char, mark1.Line)))
                                    {
                                        continue;
                                    }
                                    int num10 = mark1.Index;
                                    if (num10 == 0x7fffffff)
                                    {
                                        num10 = this.bookMarkImageIndex;
                                    }
                                    if (this.CanDrawImage(num10, num8, num6))
                                    {
                                        if ((CalcIndex && (ImageX >= num8)) && (ImageX < (num8 + this.Images.ImageSize.Width)))
                                        {
                                            ImageIndex = num10;
                                            return;
                                        }
                                        this.DrawImage(Painter, num10, point1.Y, num8, num1, num6, !CalcIndex, this.Transparent || ((num8 >= num3) && ((num8 + this.Images.ImageSize.Width) <= num4)));
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if (flag2 && !CalcIndex)
                    {
                        this.owner.Outlining.GetOutlineRanges(this.ranges, point1.Y);
                        DisplayStrings strings1 = (DisplayStrings)this.owner.DisplayLines;
                        Point          point3   = strings1.DisplayPointToPoint(0x7fffffff, Line, true, false, false);
                        bool           flag7    = false;
                        bool           flag8    = true;
                        foreach (IOutlineRange range1 in this.ranges)
                        {
                            if (this.CompareRange(range1.StartPoint, point1, point3) == 0)
                            {
                                flag8 &= range1.Visible;
                                flag7  = true;
                            }
                        }
                        if (flag7)
                        {
                            IRange range2 = (IRange)this.ranges[0];
                            this.DrawOutlineButton(Painter, point1.Y, num5, num1, num2, flag1, flag8, this.CompareRange(range2.StartPoint, point1, point3) > 0, this.CompareRange(range2.EndPoint, point1, point3) < 0);
                        }
                        if (!flag7 && flag1)
                        {
                            bool flag9  = false;
                            bool flag10 = false;
                            foreach (IOutlineRange range3 in this.ranges)
                            {
                                int num11 = this.CompareRange(range3.StartPoint, point1, point3);
                                int num12 = this.CompareRange(range3.EndPoint, point1, point3);
                                flag9  |= ((num11 > 0) && (num12 <= 0));
                                flag10 |= (num12 == 0);
                            }
                            if (flag9)
                            {
                                this.DrawOutline(Painter, point1.Y, num5, num1, num2, flag10);
                            }
                        }
                    }
                }
                if (CalcIndex)
                {
                    break;
                }
                num1 += num2;
                Line++;
            }
            if ((flag4 && !this.Transparent) && ((num1 > Rect.Top) && (num4 > num3)))
            {
                Painter.ExcludeClipRect(num3, Rect.Top, num4 - num3, num1 - Rect.Top);
            }
        }
Example #5
0
 public void FixupReferences(DisplayStrings Owner)
 {
     this.owner        = Owner;
     this.WordWrap     = this.wordWrap;
     this.WrapAtMargin = this.wrapAtMargin;
 }
Example #6
0
 public XmlDisplayStringsInfo(DisplayStrings Owner) : this()
 {
     this.owner = Owner;
 }
Example #7
0
 // Methods
 public OutlineList(DisplayStrings Owner)
 {
     this.owner         = Owner;
     this.collapsedList = new CollapsedList();
 }