Is there any way to apply region wrapping?

Answered

Hello,

I was wondering if resharper can perform code format to apply the #region for variables /constructor/methods... I mean consider the following code

public class SettingsWindowViewModel : ViewModelBase
{
private readonly ISettingService settingService;

public SettingsWindowViewModel(ISettingService settingService)
{
this.settingService = settingService;
}

public override string Title => Properties.Resources.LBL_SETTINGS_WINDOW;

protected override async Task<bool> CancelAsync()
{
await settingService.SaveSettingsAsync();
return await base.CancelAsync();
}
}

To the following

 

public class SettingsWindowViewModel : ViewModelBase
{
#region Variables
private readonly ISettingService settingService;
#endregion

#region Constructor
public SettingsWindowViewModel(ISettingService settingService)
{
this.settingService = settingService;
}
#endregion

#region Properties
public override string Title => Properties.Resources.LBL_SETTINGS_WINDOW;
#endregion

#region Overrides
protected override async Task<bool> CancelAsync()
{
await settingService.SaveSettingsAsync();
return await base.CancelAsync();
}
#endregion
}

Thanks in advance
Paolo
0
2 comments

Hello Paolo!

 

Thank you for contacting us.

Please try File layout feature for this purpose, for detailed information pleaes refer to the following help article - https://www.jetbrains.com/help/resharper/2017.1/File_and_Type_Layout.html

Thank you.

1

Please sign in to leave a comment.