我见过一些应用程序,其中C#代码被分成不同的文件,每个文件都包含一个分部类。从我看来,它可以使这些在Mac上的Visual Studio中缩进,如下例所示:
file1
file1.data
file1.commands
file1.bindings
有人可以告诉我如何实现这种视觉效果
答案 0 :(得分:2)
只需在csproj文件中添加<DependentUpon />
标记即可。
<Compile Include="file1.cs" />
<Compile Include="file1.data.cs">
<DependentUpon>file1.cs</DependentUpon>
</Compile>
<Compile Include="file1.commands.cs">
<DependentUpon>file1.cs</DependentUpon>
</Compile>
<Compile Include="file1. bindings.cs">
<DependentUpon>file1.cs</DependentUpon>
</Compile>
我认为除非你安装扩展程序,否则在visual-studio中有一个快捷方式。您必须在文本编辑器中手动编辑csproj。此外,我认为还没有适用于VS for Mac的插件。
参考文献:
编辑1 看起来有一个nesting add-in(测试版)可用于MonoDevelop - 反过来应该与VS for Mac兼容。