簡體   English   中英

MAC上Visual Studio中的文件縮進

[英]File indenting in Visual Studio on the MAC

我見過一些應用程序,其中C#代碼在不同的文件中分割,每個文件都包含一個部分類。 從我所看到的,可以使它們在Mac上的Visual Studio中以縮進的形式出現,如以下示例所示:

file1
   file1.data
   file1.commands
   file1.bindings

有人可以告訴我如何實現這種視覺效果

只需在您的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。 另外,我認為還沒有適用於Mac的VS的插件。

參考文獻:

  1. 在Visual Studio中嵌套文件
  2. 介紹Visual Studio的File Nestor

編輯1看起來有一個可用於MonoDevelop的嵌套加載項 (測試版)-而后者應與VS for Mac兼容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM