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


C# ITreeNode.As方法代码示例

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


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

示例1: WhenSolutionIsOpened_ThenCanGetMsBuildProjectProperties

        public void WhenSolutionIsOpened_ThenCanGetMsBuildProjectProperties()
        {
            base.OpenSolution("SampleSolution\\SampleSolution.sln");

            var explorer = base.ServiceLocator.GetInstance<ISolutionExplorer>();

            var lib = new ITreeNode[] { explorer.Solution }.Traverse(TraverseKind.BreadthFirst, node => node.Nodes)
                .OfType<IProjectNode>()
                .FirstOrDefault(node => node.DisplayName == "ClassLibrary");

            var msb = lib.As<MsBuild.Project>();

            Assert.NotNull(msb);

            //Console.WriteLine("IntermediateOutputPath                                      : {0}", lib.Properties.IntermediateOutputPath);
            //Console.WriteLine("DesignTimeIntermediateOutputPath                                      : {0}", lib.Properties.DesignTimeIntermediateOutputPath);
            //Console.WriteLine("BaseIntermediateOutputPath                                      : {0}", lib.Properties.BaseIntermediateOutputPath);
            //Console.WriteLine("MSBuildProjectDirectory                                      : {0}", lib.Properties.MSBuildProjectDirectory);
            
            //Console.WriteLine("OutputFileName: {0}", lib.Properties.OutputFileName);
            //Console.WriteLine("OutputPath: {0}", lib.Properties.OutputPath);
            //Console.WriteLine("TargetDir                                      : {0}", lib.Properties.TargetDir);
            //Console.WriteLine("TargetedFrameworkDir                           : {0}", lib.Properties.TargetedFrameworkDir);
            //Console.WriteLine("TargetedRuntimeVersion                         : {0}", lib.Properties.TargetedRuntimeVersion);
            //Console.WriteLine("TargetedSDKArchitecture                        : {0}", lib.Properties.TargetedSDKArchitecture);
            //Console.WriteLine("TargetedSDKConfiguration                       : {0}", lib.Properties.TargetedSDKConfiguration);
            //Console.WriteLine("TargetExt                                      : {0}", lib.Properties.TargetExt);
            //Console.WriteLine("TargetFileName                                 : {0}", lib.Properties.TargetFileName);
            //Console.WriteLine("TargetFramework                                : {0}", lib.Properties.TargetFramework);
            //Console.WriteLine("TargetFrameworkAsMSBuildRuntime                : {0}", lib.Properties.TargetFrameworkAsMSBuildRuntime);
            //Console.WriteLine("TargetFrameworkIdentifier                      : {0}", lib.Properties.TargetFrameworkIdentifier);
            //Console.WriteLine("TargetFrameworkMoniker                         : {0}", lib.Properties.TargetFrameworkMoniker);
            //Console.WriteLine("TargetFrameworkMonikerAssemblyAttributesPath   : {0}", lib.Properties.TargetFrameworkMonikerAssemblyAttributesPath);
            //Console.WriteLine("TargetFrameworkMonikerDisplayName              : {0}", lib.Properties.TargetFrameworkMonikerDisplayName);
            //Console.WriteLine("TargetFrameworkSDKToolsDirectory               : {0}", lib.Properties.TargetFrameworkSDKToolsDirectory);
            //Console.WriteLine("TargetFrameworkVersion                         : {0}", lib.Properties.TargetFrameworkVersion);
            //Console.WriteLine("TargetName                                     : {0}", lib.Properties.TargetName);
            //Console.WriteLine("TargetPath                                     : {0}", lib.Properties.TargetPath);
            //Console.WriteLine("TargetPlatformIdentifier                       : {0}", lib.Properties.TargetPlatformIdentifier);
            //Console.WriteLine("TargetPlatformMoniker                          : {0}", lib.Properties.TargetPlatformMoniker);
            //Console.WriteLine("TargetPlatformRegistryBase                     : {0}", lib.Properties.TargetPlatformRegistryBase);
            //Console.WriteLine("TargetPlatformSdkPath                          : {0}", lib.Properties.TargetPlatformSdkPath);
            //Console.WriteLine("TargetPlatformVersion                          : {0}", lib.Properties.TargetPlatformVersion);
            //Console.WriteLine("TargetRuntime                                  : {0}", lib.Properties.TargetRuntime);

            //((DynamicObject)lib.Properties).GetDynamicMemberNames()
            //    .ToList()
            //    .ForEach(prop => Console.WriteLine(prop));
        }
开发者ID:MobileEssentials,项目名称:clide,代码行数:49,代码来源:MsBuildAdapterSpec.cs


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