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


C# Object.GetUpperBound方法代码示例

本文整理汇总了C#中System.Object.GetUpperBound方法的典型用法代码示例。如果您正苦于以下问题:C# Object.GetUpperBound方法的具体用法?C# Object.GetUpperBound怎么用?C# Object.GetUpperBound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Object的用法示例。


在下文中一共展示了Object.GetUpperBound方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FormatInline

        private static Inline FormatInline(ChatControl control, Inline inline, TraceEventType eventType, int id, Object[] args = null)
        {
            switch (eventType)
            {
                case TraceEventType.Error:
                case TraceEventType.Warning:
                    inline.Foreground = Brushes.Red;
                    inline.FontWeight = FontWeights.Bold;
                    break;
                case TraceEventType.Information:
                    if ((id & EventIds.Chat) != 0)
                        inline.FontWeight = FontWeights.Bold;
                    if (args == null || args.GetUpperBound(0) == -1)
                    {
                        if ((id & EventIds.OtherPlayer) == 0)
                            inline.Foreground = Brushes.DarkGray;
                    }
                    else
                    {
                        int i = 0;
                        var p = args[i] as Player;
                        while (p == null && i < args.Length - 1)
                        {
                            i++;
                            p = args[i] as Player;
                        }
                        inline.Foreground = p != null ? new SolidColorBrush(p.Color) : Brushes.Red;

                        if (p != null && Player.LocalPlayer.Id != p.Id)
                        {
                            var theinline = inline;
                            theinline.Initialized += (sender, eventArgs) =>
                                {
                                    try
                                    {
                                        var curcolor = (theinline.Foreground as SolidColorBrush).Color;
                                        var dbAscending = new ColorAnimation(curcolor, Colors.Tomato, new Duration(TimeSpan.FromMilliseconds(500)))
                                            { RepeatBehavior = new RepeatBehavior(2), AutoReverse = true };
                                        var storyboard = new Storyboard();
                                        Storyboard.SetTarget(dbAscending, theinline);
                                        Storyboard.SetTargetProperty(dbAscending, new PropertyPath("Foreground.Color"));
                                        storyboard.Children.Add(dbAscending);
                                        storyboard.Begin(control);
                                    }
                                    catch (Exception)
                                    {
                                    }
                                };
                        }
                    }
                    break;
            }
            return inline;
        }
开发者ID:haplo63,项目名称:OCTGN,代码行数:54,代码来源:ChatControl.xaml.cs

示例2:

        SetRangeValues
        (
            Range upperLeftCornerMarker,
            Object[,] values
        )
        {
            Debug.Assert(upperLeftCornerMarker != null);
            Debug.Assert(values != null);

            Debug.Assert(upperLeftCornerMarker.Parent is Worksheet);

            Worksheet oWorksheet = (Worksheet)upperLeftCornerMarker.Parent;

            Int32 iRow = upperLeftCornerMarker.Row;
            Int32 iColumn = upperLeftCornerMarker.Column;

            Range oRangeToSet = oWorksheet.get_Range(

                oWorksheet.Cells[iRow, iColumn],

                oWorksheet.Cells[
                    iRow + values.GetUpperBound(0) - values.GetLowerBound(0),
                    iColumn + values.GetUpperBound(1) - values.GetLowerBound(1)
                    ]
                );

            oRangeToSet.set_Value(Missing.Value, values);
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:28,代码来源:ExcelUtil.cs

示例3: FormatInline

 private Inline FormatInline(Inline inline, TraceEventType eventType, int id, Object[] args=null)
 {
     if (eventType == TraceEventType.Warning || eventType == TraceEventType.Error)
     {
         inline.Foreground = Brushes.Red;
         inline.FontWeight = FontWeights.Bold;
     }
     else if (eventType == TraceEventType.Information)
     {
         if ((id & EventIds.Chat) != 0)
                 inline.FontWeight = FontWeights.Bold;
         if (args == null || args.GetUpperBound(0) == -1)
         {
             if ((id & EventIds.OtherPlayer) == 0)
                 inline.Foreground = Brushes.DarkGray;
         }
         else
         {
             int i = 0;
             Player p = args[i] as Player;
             while (p == null && i < args.Length-1)
             {
                 i++;
                 p = args[i] as Player;
             }
             if (p != null)
                 inline.Foreground = new SolidColorBrush(p.Color);
             else
                 inline.Foreground = Brushes.Red;
         }
     }
     return inline;
 }
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:33,代码来源:ChatControl.xaml.cs

示例4: AssertValid

    GetRowCount
    (
        Object [,] aoColumnValues
    )
    {
        Debug.Assert(aoColumnValues != null);
        AssertValid();

        return ( aoColumnValues.GetUpperBound(0) -
            aoColumnValues.GetLowerBound(0) + 1);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:11,代码来源:DuplicateEdgeMerger.cs

示例5: LoadRows

 ///<summary>
 ///Creates a XArrayHelper and copies the values from an object array.
 ///</summary>
 ///<param name="array">The source array to be copied.</param>
 public void LoadRows(Object[,] array)
 {
     this.RedimXArray(new int[] { array.GetUpperBound(0), array.GetUpperBound(1) }, new int[] { array.GetLowerBound(0), array.GetLowerBound(1) });
     for (int row = array.GetLowerBound(0); row <= array.GetUpperBound(0); row++)
     {
         for (int col = array.GetLowerBound(1); col <= array.GetUpperBound(1); col++)
         {
             this.SetValue(array[row, col], row, col);
         }
     }
 }
开发者ID:WebMAPTestUser,项目名称:SKS,代码行数:15,代码来源:XArrayHelper.cs


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