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


C# WorkspaceItem.ToString方法代码示例

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


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

示例1: PrintWorkspaceItem

 string PrintWorkspaceItem(WorkspaceItem item, int counter, int count)
 {
     int indentLevelOrig = Debug.IndentLevel;
     int indentLevel = Debug.IndentLevel;
     Debug.IndentLevel = ++indentLevel;
     Debug.WriteLine(item.ToString());
     Debug.IndentLevel = ++indentLevel;
     if (item.Descriptions != null)
     {
         int i = 1;
         int length = item.Descriptions.Length;
         Debug.WriteLine(String.Format("Descriptions[{0}]", length)); Logger.InfoFormat("Descriptions[{0}]", length);
         Debug.IndentLevel = ++indentLevel;
         foreach (WorkspaceItemDescription description in item.Descriptions)
         {
             Debug.WriteLine(String.Format("Description {0} of {1} => {2}", i, length, description));
             Logger.InfoFormat("\tDescription {0} of {1} => {2}", i++, length, description);
         }
         Debug.IndentLevel = --indentLevel;
     }
     if (item.Children != null)
     {
         int i = 1;
         int length = item.Children.Length;
         Debug.WriteLine(String.Format("Children[{0}]", length)); Logger.InfoFormat("Children[{0}]", length);
         Debug.IndentLevel = ++indentLevel;
         foreach (WorkspaceItem child in item.Children)
         {
             Debug.WriteLine(String.Format("Child {0} of {1} => {2}", i, length, child));
             Logger.InfoFormat("\tChild {0} of {1} => {2}", i++, length, child);
         }
         Debug.IndentLevel = --indentLevel;
     }
     if (item.Properties != null)
     {
         int i = 1;
         int length = item.Properties.Length;
         Debug.WriteLine(String.Format("Properties[{0}]", length)); Logger.InfoFormat("Properties[{0}]", length);
         Debug.IndentLevel = ++indentLevel;
         foreach (WorkspaceItemProperty property in item.Properties)
         {
             Debug.WriteLine(String.Format("Property {0} of {1} => {2}", i, length, property));
             Logger.InfoFormat("\tProperty {0} of {1} => {2}", i++, length, property);
         }
         Debug.IndentLevel = --indentLevel;
     }
     Debug.IndentLevel = indentLevelOrig;
     return String.Empty;
 }
开发者ID:rlefever68,项目名称:Broobu.HamRadio,代码行数:49,代码来源:WorkspaceBrowserTestFixture.cs


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