mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 22:43:31 +08:00
Add RequireNonNull
http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
This commit is contained in:
parent
349e8b2da7
commit
6c705e1e25
@ -1,4 +1,7 @@
|
||||
namespace Wox.Infrastructure
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
public class StringMatcher
|
||||
{
|
||||
|
19
Wox.Infrastructure/SyntaxSuger.cs
Normal file
19
Wox.Infrastructure/SyntaxSuger.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
static class SyntaxSuger<T>
|
||||
{
|
||||
public static T RequireNonNull(T obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
else
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -68,6 +68,7 @@
|
||||
<Compile Include="Hotkey\KeyEvent.cs" />
|
||||
<Compile Include="Logger\Log.cs" />
|
||||
<Compile Include="Storage\PluginSettingsStorage.cs" />
|
||||
<Compile Include="SyntaxSuger.cs" />
|
||||
<Compile Include="WoxDirectroy.cs" />
|
||||
<Compile Include="Stopwatch.cs" />
|
||||
<Compile Include="Storage\BinaryStorage.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user