当前位置: 首页>>代码示例>>C#>>正文


C# BorderType.ToString方法代码示例

本文整理汇总了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()));
    }
开发者ID:vronikp,项目名称:EventRegistration,代码行数:10,代码来源:Borders.cs

示例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;
 }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:24,代码来源:Borders.cs

示例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;
        }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:30,代码来源:MergedCellList.cs

示例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;
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:17,代码来源:MergedCellList.cs

示例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;
      }
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:30,代码来源:Borders.cs

示例6: GetBorder

 private Border GetBorder(BorderType type)
 {
     return (Border)this.borders.GetValue(type.ToString(), GV.ReadOnly);
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:4,代码来源:BordersRenderer.cs


注:本文中的BorderType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。