You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

safety-cast.cs 475 B

3 years ago
1234567891011121314
  1. IUser user;
  2. // Here we check if the user is an IGuildUser, if not, let it pass. This ensures its not null.
  3. if (user is IGuildUser)
  4. {
  5. Console.WriteLine("This user is in a guild!");
  6. }
  7. // Check failed.
  8. ----------------------------
  9. // Another situation, where we want to get the actual data of said IGuildUser.
  10. ----------------------------
  11. // A final situation, where we dont actually need to do anything code-wise when the check does not pass, so we want to simplify it.