本文整理汇总了C#中Sector.ApplyStylesheet方法的典型用法代码示例。如果您正苦于以下问题:C# Sector.ApplyStylesheet方法的具体用法?C# Sector.ApplyStylesheet怎么用?C# Sector.ApplyStylesheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector.ApplyStylesheet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteRoute
private void WriteRoute(Route route, Sector sector)
{
writer.Write("route ");
if (route.StartOffsetX != 0 || route.StartOffsetY != 0)
{
writer.Write(route.StartOffsetX.ToString(CultureInfo.InvariantCulture));
writer.Write(" ");
writer.Write(route.StartOffsetY.ToString(CultureInfo.InvariantCulture));
writer.Write(" ");
}
writer.Write(route.StartHex);
writer.Write(" ");
if (route.EndOffsetX != 0 || route.EndOffsetY != 0)
{
writer.Write(route.EndOffsetX.ToString(CultureInfo.InvariantCulture));
writer.Write(" ");
writer.Write(route.EndOffsetY.ToString(CultureInfo.InvariantCulture));
writer.Write(" ");
}
writer.Write(route.EndHex);
SectorStylesheet.StyleResult ssr = sector.ApplyStylesheet("route", route.Allegiance);
Color? color = route.Color ?? ssr.GetColor("color");
if (color.HasValue)
{
writer.Write(" ");
writer.Write(ColorTranslator.ToHtml(color.Value).ToLowerInvariant());
}
writer.WriteLine();
}
示例2: WriteBorder
private void WriteBorder(Border border, Allegiance alleg, Sector sector)
{
if (border.ShowLabel && (border.Label != null || alleg != null))
{
writer.Write("label ");
writer.Write(border.LabelPositionHex);
writer.Write(" ");
writer.Write(border.Label ?? alleg.Name);
writer.WriteLine();
}
writer.Write("border ");
writer.Write(border.PathString);
SectorStylesheet.StyleResult ssr = sector.ApplyStylesheet("border", alleg == null ? null : alleg.T5Code);
Color? color = border.Color ?? ssr.GetColor("color");
if (color.HasValue)
{
writer.Write(" ");
writer.Write(ColorTranslator.ToHtml(color.Value).ToLowerInvariant());
}
writer.WriteLine();
}