mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Add RequireNonNull
http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
namespace Wox.Infrastructure
|
using System;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
|
namespace Wox.Infrastructure
|
||||||
{
|
{
|
||||||
public class StringMatcher
|
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="Hotkey\KeyEvent.cs" />
|
||||||
<Compile Include="Logger\Log.cs" />
|
<Compile Include="Logger\Log.cs" />
|
||||||
<Compile Include="Storage\PluginSettingsStorage.cs" />
|
<Compile Include="Storage\PluginSettingsStorage.cs" />
|
||||||
|
<Compile Include="SyntaxSuger.cs" />
|
||||||
<Compile Include="WoxDirectroy.cs" />
|
<Compile Include="WoxDirectroy.cs" />
|
||||||
<Compile Include="Stopwatch.cs" />
|
<Compile Include="Stopwatch.cs" />
|
||||||
<Compile Include="Storage\BinaryStorage.cs" />
|
<Compile Include="Storage\BinaryStorage.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user