I'm currently working with T4 templates and I have noticed that sometimes the code is not indented properly, how can I avoid that?
For instance I have this code in the template
}
<# } #>
this.cmbDecisionList.Dat = dataSource;
this.btnDec.Enabled = dataSource.Count > 0;
}
and in the generated class it's like
}
this.cmbDecisionList.Dat = dataSource;
this.btnDec.Enabled = dataSource.Count > 0;
}
Allow me to illustrate your problem by replacing spaces with dots.
}
....<# } #>
....this.cmbDecisionList.Dat = dataSource;
this.btnDec.Enabled = dataSource.Count > 0;
}
and in the generated class it's like
}
........this.cmbDecisionList.Dat = dataSource;
this.btnDec.Enabled = dataSource.Count > 0;
}
Now, let us remove the preceding dots.
}
<# } #>
....this.cmbDecisionList.Dat = dataSource;
this.btnDec.Enabled = dataSource.Count > 0;
}
and in the generated class it's like
}
....this.cmbDecisionList.Dat = dataSource;
this.btnDec.Enabled = dataSource.Count > 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With