private void GetSortImage(GdiWriter writer, out Bitmap image, out SortOrder nextOrder)
        {
            string key = null;

            nextOrder = SortOrder.Descending;
            switch (((RPLTextBoxProps)InstanceProperties).SortState)
            {
            case RPLFormat.SortOptions.None:
                nextOrder = SortOrder.Ascending;
                key       = "unsorted";
                break;

            case RPLFormat.SortOptions.Ascending:
                key = "sortAsc";
                break;

            case RPLFormat.SortOptions.Descending:
                nextOrder = SortOrder.Ascending;
                key       = "sortDesc";
                break;
            }
            image = GdiContext.ImageResources[key];
            float num  = writer.ConvertToMillimeters(image.Width);
            float num2 = writer.ConvertToMillimeters(image.Height);

            if (m_sortRectangleMM == RectangleF.Empty)
            {
                float num3 = Math.Max(TextPosition.Right - num, TextPosition.X) - 0.34f;
                float num4 = TextPosition.Y + 0.34f;
                if (TextPosition.Height < num2 + 0.34f)
                {
                    num2  = TextPosition.Height;
                    num4 -= 0.34f;
                }
                if (TextPosition.Width < num + 0.34f)
                {
                    num   = TextPosition.Width;
                    num3 += 0.34f;
                }
                m_sortRectangleMM = new RectangleF(num3, num4, num, num2);
            }
        }
        private void GetToggleImage(GdiWriter writer, out Bitmap image)
        {
            image = GdiContext.ImageResources[((RPLTextBoxProps)InstanceProperties).ToggleState ? "toggleMinus" : "togglePlus"];
            float num  = writer.ConvertToMillimeters(image.Width);
            float num2 = writer.ConvertToMillimeters(image.Height);

            if (m_toggleRectangleMM == RectangleF.Empty)
            {
                float num3 = TextPosition.X + 1f;
                float num4 = TextPosition.Y + 1f;
                if (TextPosition.Height < num2 + 1f)
                {
                    num2  = TextPosition.Height;
                    num4 -= 1f;
                }
                if (TextPosition.Width < num + 1f)
                {
                    num   = TextPosition.Width;
                    num3 -= 1f;
                }
                m_toggleRectangleMM = new RectangleF(num3, num4, num, num2);
            }
        }