public Mobypicture(Twitter twitter, TwitterConfiguration twitterConfig)
{
- if (twitter == null)
- throw new ArgumentNullException(nameof(twitter));
- if (twitterConfig == null)
- throw new ArgumentNullException(nameof(twitterConfig));
-
- this.twitter = twitter;
- this.twitterConfig = twitterConfig;
+ this.twitter = twitter ?? throw new ArgumentNullException(nameof(twitter));
+ this.twitterConfig = twitterConfig ?? throw new ArgumentNullException(nameof(twitterConfig));
this.mobypictureApi = new MobypictureApi(twitter.Api);
}
public TwipplePhoto(Twitter twitter, TwitterConfiguration twitterConfig)
{
- if (twitter == null)
- throw new ArgumentNullException(nameof(twitter));
- if (twitterConfig == null)
- throw new ArgumentNullException(nameof(twitterConfig));
-
- this.twitter = twitter;
- this.twitterConfig = twitterConfig;
+ this.twitter = twitter ?? throw new ArgumentNullException(nameof(twitter));
+ this.twitterConfig = twitterConfig ?? throw new ArgumentNullException(nameof(twitterConfig));
this.twippleApi = new TwippleApi(twitter.Api);
}
public MemoryImageMediaItem(MemoryImage image)
{
- if (image == null)
- throw new ArgumentNullException(nameof(image));
-
- this._image = image;
+ this._image = image ?? throw new ArgumentNullException(nameof(image));
var num = Interlocked.Increment(ref _fileNumber);
this.Path = PathPrefix + num + this._image.ImageFormatExt;
public string[] FilterBody
{
get { return this._FilterBody; }
- set
- {
- if (value == null)
- throw new ArgumentNullException(nameof(value));
-
- this.SetProperty(ref this._FilterBody, value);
- }
+ set { this.SetProperty(ref this._FilterBody, value ?? throw new ArgumentNullException(nameof(value))); }
}
private string[] _FilterBody = new string[0];
public string[] ExFilterBody
{
get { return this._ExFilterBody; }
- set
- {
- if (value == null)
- throw new ArgumentNullException(nameof(value));
-
- this.SetProperty(ref this._ExFilterBody, value);
- }
+ set { this.SetProperty(ref this._ExFilterBody, value ?? throw new ArgumentNullException(nameof(value))); }
}
private string[] _ExFilterBody = new string[0];
public ReadLockTransaction(ReaderWriterLockSlim lockObj)
{
- if (lockObj == null)
- throw new ArgumentNullException(nameof(lockObj));
-
- this.lockObj = lockObj;
+ this.lockObj = lockObj ?? throw new ArgumentNullException(nameof(lockObj));
this.lockObj.EnterReadLock();
}
public WriteLockTransaction(ReaderWriterLockSlim lockObj)
{
- if (lockObj == null)
- throw new ArgumentNullException(nameof(lockObj));
-
- this.lockObj = lockObj;
+ this.lockObj = lockObj ?? throw new ArgumentNullException(nameof(lockObj));
this.lockObj.EnterWriteLock();
}
public UpgradeableReadLockTransaction(ReaderWriterLockSlim lockObj)
{
- if (lockObj == null)
- throw new ArgumentNullException(nameof(lockObj));
-
- this.lockObj = lockObj;
+ this.lockObj = lockObj ?? throw new ArgumentNullException(nameof(lockObj));
this.lockObj.EnterUpgradeableReadLock();
}