bool GetListSymbol(out string symbol, out XFont font)
{
font = null;
symbol = null;
ParagraphFormatInfo formatInfo = (ParagraphFormatInfo)this.renderInfo.FormatInfo;
if (this.phase == Phase.Formatting)
{
ParagraphFormat format = this.paragraph.Format;
if (!format.IsNull("ListInfo"))
{
ListInfo listInfo = format.ListInfo;
double size = format.Font.Size;
XFontStyle style = FontHandler.GetXStyle(format.Font);
switch (listInfo.ListType)
{
case ListType.None:
return false;
case ListType.BulletList1:
symbol = "·";
font = new XFont("Symbol", size, style);
break;
case ListType.BulletList2:
symbol = "o";
font = new XFont("Courier New", size, style);
break;
case ListType.BulletList3:
symbol = "§";
font = new XFont("Wingdings", size, style);
break;
case ListType.NumberList1:
symbol = this.documentRenderer.NextListNumber(listInfo) + ".";
font = FontHandler.FontToXFont(format.Font, this.documentRenderer.PrivateFonts, this.gfx.MUH, this.gfx.MFEH);
break;
case ListType.NumberList2:
symbol = this.documentRenderer.NextListNumber(listInfo) + ")";
font = FontHandler.FontToXFont(format.Font, this.documentRenderer.PrivateFonts, this.gfx.MUH, this.gfx.MFEH);
break;
case ListType.NumberList3:
symbol = NumberFormatter.Format(this.documentRenderer.NextListNumber(listInfo), "alphabetic") + ")";
font = FontHandler.FontToXFont(format.Font, this.documentRenderer.PrivateFonts, this.gfx.MUH, this.gfx.MFEH);
break;
}
formatInfo.listFont = font;
formatInfo.listSymbol = symbol;
return true;
}
}
else
{
if (formatInfo.listFont != null && formatInfo.listSymbol != null)
{
font = formatInfo.listFont;
symbol = formatInfo.listSymbol;
return true;
}
}
return false;
}