2016-09-08 66 views
3

Ich weiß nicht, ob es einen Namen dafür gibt, aber ich möchte automatisch Einzug (/ Tab?) - Ausrichtung meiner Quelle für einen großen verwandten Code-Block. Wie so:Kann ich Code in Visual Studio automatisch einrücken?

Bevor:

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)}, 
}; 

Nach:

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)}, 
}; 

weiß, dass ich die Ctrl + K, Ctrl + F wie vorgeschlagen here, und ich benutze das die ganze Zeit, aber es ist nicht das, wonach ich suche.

Ich habe versucht, manuell über den Code zu tabgen, aber ich möchte das nicht jedes Mal tun.

Ich bin auf der Suche nach einer Visual Studio-Erweiterung.

+0

Diese Erweiterung kann helfen, aber jeder mit dem Code beteiligt sind, müssen sie installiert haben: https://www.alwaysaligned.net/ –

+0

@LucasTrzesniewski AlwaysAligned ist was ich will, aber es ist 40 $ pro Benutzer. Ich war auf der Suche nach etwas im Bereich $ Free.99 – Brandon

+0

@Brandon gibt es auch einen großen "Download einer kostenlosen Kopie" -Taste am oberen Rand der Seite. Seltsam. –

Antwort

3

Ich verwendete Code Alignment VisualStudio Erweiterung für diesen Zweck. Hier

ist, was es tun kann (taken from official website)

person.FirstName = "Chris";    => person.FirstName = "Chris"; 
    person.Surname = "McGrath";    => person.Surname = "McGrath"; 
    person.Age = 24;       => person.Age  = 24; 
    person.Occupation = "Software Developer"; => person.Occupation = "Software Developer"; 
    person.HomeTown = "Brisbane";    => person.HomeTown = "Brisbane"; 
Verwandte Themen