|
|
@ -39,10 +39,20 @@ namespace CSharpBinding.FormattingStrategy |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
internal class CSharpFormattingOptionsPersistence |
|
|
|
internal class CSharpFormattingOptionsPersistence |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
static bool initialized; |
|
|
|
static Dictionary<string, CSharpFormattingOptionsPersistence> projectOptions; |
|
|
|
static Dictionary<string, CSharpFormattingOptionsPersistence> projectOptions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static CSharpFormattingOptionsPersistence() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Initialize(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void Initialize() |
|
|
|
public static void Initialize() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (initialized) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialized = true; |
|
|
|
projectOptions = new Dictionary<string, CSharpFormattingOptionsPersistence>(); |
|
|
|
projectOptions = new Dictionary<string, CSharpFormattingOptionsPersistence>(); |
|
|
|
|
|
|
|
|
|
|
|
// Load global settings
|
|
|
|
// Load global settings
|
|
|
@ -54,8 +64,11 @@ namespace CSharpBinding.FormattingStrategy |
|
|
|
GlobalOptions.Load(); |
|
|
|
GlobalOptions.Load(); |
|
|
|
|
|
|
|
|
|
|
|
// Handlers for solution loading/unloading
|
|
|
|
// Handlers for solution loading/unloading
|
|
|
|
SD.ProjectService.SolutionOpened += SolutionOpened; |
|
|
|
var projectService = SD.GetService<IProjectService>(); |
|
|
|
SD.ProjectService.SolutionClosed += SolutionClosed; |
|
|
|
if (projectService != null) { |
|
|
|
|
|
|
|
SD.ProjectService.SolutionOpened += SolutionOpened; |
|
|
|
|
|
|
|
SD.ProjectService.SolutionClosed += SolutionClosed; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static CSharpFormattingOptionsPersistence GlobalOptions |
|
|
|
public static CSharpFormattingOptionsPersistence GlobalOptions |
|
|
|