-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
117 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
namespace Menees.VsTools.Tasks | ||
{ | ||
#region Using Directives | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
#endregion | ||
|
||
internal sealed class BackgroundOptions | ||
{ | ||
#region Private Data Members | ||
|
||
private readonly object locker = new object(); | ||
|
||
#endregion | ||
|
||
#region Public Events | ||
|
||
public event EventHandler Updated; | ||
|
||
#endregion | ||
|
||
#region Public Properties | ||
|
||
public bool EnableCommentScans { get; private set; } | ||
|
||
public string ExcludeFromCommentScans { get; private set; } | ||
|
||
#endregion | ||
|
||
#region Public Methods | ||
|
||
public bool Update(Options options) | ||
{ | ||
bool updated = false; | ||
|
||
lock (this.locker) | ||
{ | ||
if (this.EnableCommentScans != options.EnableCommentScans) | ||
{ | ||
this.EnableCommentScans = options.EnableCommentScans; | ||
updated = true; | ||
} | ||
|
||
if (this.ExcludeFromCommentScans != options.ExcludeFromCommentScans) | ||
{ | ||
this.ExcludeFromCommentScans = options.ExcludeFromCommentScans; | ||
updated = true; | ||
} | ||
} | ||
|
||
if (updated) | ||
{ | ||
this.Updated?.Invoke(this, EventArgs.Empty); | ||
} | ||
|
||
return updated; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters