Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ public string Version
/// <since_tizen> 3 </since_tizen>
public virtual void Run(string[] args)
{
if (args == null)
{
throw new ArgumentNullException(nameof(args));
}
ArgumentNullException.ThrowIfNull(args);
s_CurrentApplication = this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,7 @@ public static IEnumerable<RecentApplicationInfo> GetRecentApplications()
[EditorBrowsable(EditorBrowsableState.Never)]
public static IEnumerable<string> GetRuaStatTags(string caller)
{
if (caller == null)
{
throw new ArgumentNullException(nameof(caller));
}
ArgumentNullException.ThrowIfNull(caller);

List<string> tags = new List<string>();
Interop.ApplicationManager.RuaStatTagIterCallback callback = (string ruaStatTag, IntPtr userData) =>
Expand Down
20 changes: 4 additions & 16 deletions src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ public Bundle()
/// <since_tizen> 3 </since_tizen>
public Bundle(SafeBundleHandle handle)
{
if (handle == null)
{
throw new ArgumentNullException(nameof(handle));
}
ArgumentNullException.ThrowIfNull(handle);

if (handle.IsInvalid)
{
Expand Down Expand Up @@ -230,10 +227,7 @@ public bool Contains(string key)
/// <since_tizen> 3 </since_tizen>
public void AddItem(string key, byte[] value)
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
ArgumentNullException.ThrowIfNull(value);
AddItem(key, value, 0, value.Length);
}

Expand All @@ -260,10 +254,7 @@ public void AddItem(string key, byte[] value, int offset, int count)
{
if (!_keys.Contains(key))
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
ArgumentNullException.ThrowIfNull(value);
if (offset < 0)
{
throw new ArgumentOutOfRangeException(nameof(offset), offset, "Cannot be less than 0");
Expand Down Expand Up @@ -773,10 +764,7 @@ protected virtual void Dispose(bool disposing)
[EditorBrowsable(EditorBrowsableState.Never)]
public static Bundle ImportFromArgv(string[] argv)
{
if (argv == null)
{
throw new ArgumentNullException(nameof(argv));
}
ArgumentNullException.ThrowIfNull(argv);

return new Bundle(Interop.Bundle.ImportFromArgv(argv.Length, argv));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,7 @@ protected virtual void OnTimeZoneChanged(TimeZoneChangedEventArgs e)
[EditorBrowsable(EditorBrowsableState.Never)]
public static void Post(Action runner)
{
if (runner == null)
{
throw new ArgumentNullException(nameof(runner));
}
ArgumentNullException.ThrowIfNull(runner);

GSourceManager.Post(runner, true);
}
Expand All @@ -372,10 +369,7 @@ public static void Post(Action runner)
[EditorBrowsable(EditorBrowsableState.Never)]
public static async Task<T> Post<T>(Func<T> runner)
{
if (runner == null)
{
throw new ArgumentNullException(nameof(runner));
}
ArgumentNullException.ThrowIfNull(runner);

var task = new TaskCompletionSource<T>();
GSourceManager.Post(() => { task.SetResult(runner()); }, true);
Expand Down
10 changes: 2 additions & 8 deletions src/Tizen.Applications.Common/Tizen.Applications/CoreTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ public virtual void OnUIEvent(UIEventArgs e)
/// <since_tizen> 10 </since_tizen>
public static void Post(Action runner)
{
if (runner == null)
{
throw new ArgumentNullException(nameof(runner));
}
ArgumentNullException.ThrowIfNull(runner);

GSourceManager.Post(runner);
}
Expand All @@ -147,10 +144,7 @@ public static void Post(Action runner)

public static async Task<T> Post<T>(Func<T> runner)
{
if (runner == null)
{
throw new ArgumentNullException(nameof(runner));
}
ArgumentNullException.ThrowIfNull(runner);

var task = new TaskCompletionSource<T>();
GSourceManager.Post(() => { task.SetResult(runner()); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ public bool IsReplyRequest
/// <since_tizen> 3 </since_tizen>
public void ReplyToLaunchRequest(AppControl replyRequest, AppControlReplyResult result)
{
if (replyRequest == null)
{
throw new ArgumentNullException(nameof(replyRequest));
}
ArgumentNullException.ThrowIfNull(replyRequest);
Interop.AppControl.ErrorCode err = Interop.AppControl.ReplyToLaunchRequest(replyRequest.SafeAppControlHandle, this.SafeAppControlHandle, (int)result);
if (err != Interop.AppControl.ErrorCode.None)
throw new InvalidOperationException("Failed to reply. Err = " + err);
Expand Down
Loading