本文整理汇总了C#中BorderType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# BorderType.ToString方法的具体用法?C# BorderType.ToString怎么用?C# BorderType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BorderType
的用法示例。
在下文中一共展示了BorderType.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasBorder
/// <summary>
/// Determines whether a particular border exists.
/// </summary>
public bool HasBorder(BorderType type)
{
if (!Enum.IsDefined(typeof(BorderType), type))
throw new InvalidEnumArgumentException("type");
return !(this.IsNull(type.ToString()));
}
示例2: GetBorderReadOnly
internal Border GetBorderReadOnly(BorderType type)
{
switch (type)
{
case BorderType.Bottom:
return _bottom;
case BorderType.DiagonalDown:
return _diagonalDown;
case BorderType.DiagonalUp:
return _diagonalUp;
case BorderType.Horizontal:
case BorderType.Vertical:
return (Border)GetValue(type.ToString(), GV.GetNull);
case BorderType.Left:
return _left;
case BorderType.Right:
return _right;
case BorderType.Top:
return _top;
}
if (!Enum.IsDefined(typeof(BorderType), type))
throw new /*InvalidEnum*/ArgumentException(DomSR.InvalidEnumValue(type), "type");
return null;
}
示例3: GetEffectiveBorderWidth
/// <summary>
/// Returns the width of the border at the specified position.
/// </summary>
private Unit GetEffectiveBorderWidth(Borders borders, BorderType type)
{
if (borders == null)
return 0;
Border border = borders.GetValue(type.ToString(), GV.GetNull) as Border;
DocumentObject relevantDocObj = border;
if (relevantDocObj == null || relevantDocObj.IsNull("Width"))
relevantDocObj = borders;
object visible = relevantDocObj.GetValue("visible", GV.GetNull);
object style = relevantDocObj.GetValue("style", GV.GetNull);
object width = relevantDocObj.GetValue("width", GV.GetNull);
object color = relevantDocObj.GetValue("color", GV.GetNull);
if (visible != null || style != null || width != null || color != null)
{
if (visible != null && !(bool)visible)
return 0;
if (width != null)
return (Unit)width;
return 0.5;
}
return 0;
}
示例4: GetBorderFromBorders
/// <summary>
/// Returns the border of the given borders-object of the specified type (top, bottom, ...).
/// If that border doesn't exist, it returns a new border object that inherits all properties from the given borders object
/// </summary>
private Border GetBorderFromBorders(Borders borders, BorderType type)
{
Border returnBorder = borders.GetValue(type.ToString(), GV.ReadOnly) as Border;
if (returnBorder == null)
{
returnBorder = new Border();
returnBorder.style = borders.style;
returnBorder.width = borders.width;
returnBorder.color = borders.color;
returnBorder.visible = borders.visible;
}
return returnBorder;
}
示例5: GetBorder
/// <summary>
/// Return border if specified, fast version of Borders.GetValue(type.ToString(), RV.ReadOnly)
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public Border GetBorder(BorderType type) {
// AndrewT: optimization - time-critical routine due to high calls number when render tables
switch (type) {
case BorderType.Left:
return this.left;
case BorderType.Right:
return this.right;
case BorderType.Top:
return this.top;
case BorderType.Bottom:
return this.bottom;
case BorderType.DiagonalDown:
return this.diagonalDown;
case BorderType.DiagonalUp:
return this.diagonalUp;
default:
return this.GetValue(type.ToString(), GV.ReadOnly) as Border;
}
}
示例6: GetBorder
private Border GetBorder(BorderType type)
{
return (Border)this.borders.GetValue(type.ToString(), GV.ReadOnly);
}