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.

unboxing.cs 394 B

123456789
  1. IUser user;
  2. // Here we use inline unboxing to make a call to its member (if available) only once.
  3. // Note that if the entity we're trying to cast to is null, this will throw a NullReferenceException.
  4. Console.WriteLine(((IGuildUser)user).Nickname);
  5. // In case you are certain the entity IS said member, you can also use unboxing to declare variables.
  6. IGuildUser guildUser = (IGuildUser)user;