C# 我可以在Visual Studio中自动缩进对齐代码吗?
我不知道是否有它的名字,但我想自动缩进(/tab?)-对齐我的源代码以获得一大块相关的代码。像这样: 之前:C# 我可以在Visual Studio中自动缩进对齐代码吗?,c#,visual-studio,format,C#,Visual Studio,Format,我不知道是否有它的名字,但我想自动缩进(/tab?)-对齐我的源代码以获得一大块相关的代码。像这样: 之前: this._strategies = new Dictionary< Type, IStrategy > { {typeof( Station ), new StationStrategy(this)}, {typeof( Turnout ), new TurnoutStrategy(this)}, {typeof( EndOfLine ), new
this._strategies = new Dictionary< Type, IStrategy >
{
{typeof( Station ), new StationStrategy(this)},
{typeof( Turnout ), new TurnoutStrategy(this)},
{typeof( EndOfLine ), new EndOfLineStrategy(this)},
{typeof( Chainage_Equality ), new ChainageEqualityStrategy(this)},
{typeof( Track_Connector ), new TrackConnectorStrategy(this)},
{typeof( Multimeter ), new MultimeterStrategy(this)},
{typeof( Power_Rail_Gap ), new PowerRailGapStrategy(this)},
{typeof( EndOfWire ), new EndOfWireStrategy(this)},
{typeof( Grounding_Point ), new GroundingPointStrategy(this)},
{typeof( Busbar ), new BusbarStrategy(this)},
{typeof( AARU ), new AutomaticAssuredReceptivityUnitStrategy(this)},
{typeof( TPS ), new TractionPowerSubstationStrategy(this)},
{typeof( AutoTransformer ), new AutotransformerStrategy(this)},
{typeof( Energy_Storage ), new EnergyStorageStrategy(this)},
};
this._strategies = new Dictionary< Type, IStrategy >
{
{typeof( Station ), new StationStrategy(this)},
{typeof( Turnout ), new TurnoutStrategy(this)},
{typeof( EndOfLine ), new EndOfLineStrategy(this)},
{typeof( Chainage_Equality ), new ChainageEqualityStrategy(this)},
{typeof( Track_Connector ), new TrackConnectorStrategy(this)},
{typeof( Multimeter ), new MultimeterStrategy(this)},
{typeof( Power_Rail_Gap ), new PowerRailGapStrategy(this)},
{typeof( EndOfWire ), new EndOfWireStrategy(this)},
{typeof( Grounding_Point ), new GroundingPointStrategy(this)},
{typeof( Busbar ), new BusbarStrategy(this)},
{typeof( AARU ), new AutomaticAssuredReceptivityUnitStrategy(this)},
{typeof( TPS ), new TractionPowerSubstationStrategy(this)},
{typeof( AutoTransformer ), new AutotransformerStrategy(this)},
{typeof( Energy_Storage ), new EnergyStorageStrategy(this)},
};
this.\u strategies=newdictionary
{
{typeof(Station),newstationstrategy(this)},
{类型(道岔),新的转弯策略(本)},
{typeof(EndOfLine),新EndOfLineStrategy(this)},
{typeof(chaineage_Equality),新chaineageequalitystrategy(this)},
{typeof(Track_Connector),新的trackconnector策略(this)},
{typeof(万用表),新的万用表策略(this)},
{typeof(Power_Rail_Gap),新的powerrailgap策略(this)},
{typeof(EndOfWire),新的EndOfWire策略(this)},
{typeof(Grounding_Point),新groundingpoint策略(this)},
{类型(母线),新母线策略(本)},
{typeof(AARU),新的自动化策略(this)},
{typeof(TPS),新的牵引动力基础战略(this)},
{类型(自耦变压器),新自耦变压器策略(本)},
{类型(能源存储),新能源存储策略(本)},
};
之后:
this._strategies = new Dictionary< Type, IStrategy >
{
{typeof( Station ), new StationStrategy(this)},
{typeof( Turnout ), new TurnoutStrategy(this)},
{typeof( EndOfLine ), new EndOfLineStrategy(this)},
{typeof( Chainage_Equality ), new ChainageEqualityStrategy(this)},
{typeof( Track_Connector ), new TrackConnectorStrategy(this)},
{typeof( Multimeter ), new MultimeterStrategy(this)},
{typeof( Power_Rail_Gap ), new PowerRailGapStrategy(this)},
{typeof( EndOfWire ), new EndOfWireStrategy(this)},
{typeof( Grounding_Point ), new GroundingPointStrategy(this)},
{typeof( Busbar ), new BusbarStrategy(this)},
{typeof( AARU ), new AutomaticAssuredReceptivityUnitStrategy(this)},
{typeof( TPS ), new TractionPowerSubstationStrategy(this)},
{typeof( AutoTransformer ), new AutotransformerStrategy(this)},
{typeof( Energy_Storage ), new EnergyStorageStrategy(this)},
};
this._strategies = new Dictionary< Type, IStrategy >
{
{typeof( Station ), new StationStrategy(this)},
{typeof( Turnout ), new TurnoutStrategy(this)},
{typeof( EndOfLine ), new EndOfLineStrategy(this)},
{typeof( Chainage_Equality ), new ChainageEqualityStrategy(this)},
{typeof( Track_Connector ), new TrackConnectorStrategy(this)},
{typeof( Multimeter ), new MultimeterStrategy(this)},
{typeof( Power_Rail_Gap ), new PowerRailGapStrategy(this)},
{typeof( EndOfWire ), new EndOfWireStrategy(this)},
{typeof( Grounding_Point ), new GroundingPointStrategy(this)},
{typeof( Busbar ), new BusbarStrategy(this)},
{typeof( AARU ), new AutomaticAssuredReceptivityUnitStrategy(this)},
{typeof( TPS ), new TractionPowerSubstationStrategy(this)},
{typeof( AutoTransformer ), new AutotransformerStrategy(this)},
{typeof( Energy_Storage ), new EnergyStorageStrategy(this)},
};
this.\u strategies=newdictionary
{
{typeof(Station),newstationstrategy(this)},
{类型(道岔),新的转弯策略(本)},
{typeof(EndOfLine),新EndOfLineStrategy(this)},
{typeof(chaineage_Equality),新chaineageequalitystrategy(this)},
{typeof(Track_Connector),新的trackconnector策略(this)},
{typeof(万用表),新的万用表策略(this)},
{typeof(Power_Rail_Gap),新的powerrailgap策略(this)},
{typeof(EndOfWire),新的EndOfWire策略(this)},
{typeof(Grounding_Point),新groundingpoint策略(this)},
{类型(母线),新母线策略(本)},
{typeof(AARU),新的自动化策略(this)},
{typeof(TPS),新的牵引动力基础战略(this)},
{类型(自耦变压器),新自耦变压器策略(本)},
{类型(能源存储),新能源存储策略(本)},
};
我知道Ctrl+K,Ctrl+F的用法,我一直都在使用,但这不是我想要的
我尝试过手动切换代码,但我不想每次都这么做
我正在寻找Visual Studio扩展。我正使用VisualStudio扩展来实现此目的
下面是它能做的
这个扩展可能会有所帮助,但与代码相关的每个人都必须安装它:@Lucastzesniewski AlwaysAligned是我想要的,但每个用户40美元。我在找免费的东西。99@Brandon页面顶部还有一个大的“下载免费副本”按钮。“怪怪的。”米奇:当然。下面是我为解决这个问题所做的工作:我每次都手动对字符进行制表。以下是我不想做的:每次都用制表符标记字符。我将把它添加到问题中。我在找一个VS扩展,应该提到这一点。谢谢你的否决票。@Lucastrezesniewski我想我忽略了,只看到了购买许可证按钮。