2017-09-29 13 views
1

我已經看到一些應用程序,其中C#代碼在不同文件中分割,每個文件都包含部分類。從我看到它可能使這些出現縮進在Visual Studio中的Mac上就像這個例子:MAC上的Visual Studio中的文件縮進

file1 
    file1.data 
    file1.commands 
    file1.bindings 

誰能告訴我怎樣才能達到這種視覺效果

回答

2

只需添加一個<DependentUpon />標籤中你的csproj文件。

<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 Files In Visual Studio
  2. Introducing File Nestor for Visual Studio

EDIT 1 看起來像有一個nesting add-in(測試版)可用於MonoDevelop的 - 這又應該是兼容VS爲蘋果電腦。

相關問題