Add RequireNonNull

http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
This commit is contained in:
bao-qian 2016-04-22 23:29:38 +01:00
parent 349e8b2da7
commit 6c705e1e25
3 changed files with 24 additions and 1 deletions

View File

@ -1,4 +1,7 @@
namespace Wox.Infrastructure
using System;
using JetBrains.Annotations;
namespace Wox.Infrastructure
{
public class StringMatcher
{

View 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;
}
}
}
}

View File

@ -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" />