mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add RequireNonNull
http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
This commit is contained in:
parent
5bc74fc296
commit
6bb0d736be
3 changed files with 24 additions and 1 deletions
|
|
@ -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 a new issue