Microsoft.CSharp.RuntimeBinder.Semantics.CType.isUnsafe C# (CSharp) Méthode

isUnsafe() public méthode

public isUnsafe ( ) : bool
Résultat bool
        public bool isUnsafe()
        {
            // Pointer types are the only unsafe types.
            // Note that generics may not be instantiated with pointer types
            return (this != null && (IsPointerType() || (IsArrayType() && AsArrayType().GetElementType().isUnsafe())));
        }
        public bool isPredefType(PredefinedType pt)

Usage Example

Exemple #1
0
 public void checkUnsafe(CType type, ErrorCode errCode, ErrArg pArg)
 {
     Debug.Assert((errCode != ErrorCode.ERR_SizeofUnsafe) || pArg != null);
     if (type == null || type.isUnsafe())
     {
         if (!isUnsafeContext() && ReportUnsafeErrors())
         {
             if (pArg != null)
                 ErrorContext.Error(errCode, pArg);
             else
                 ErrorContext.Error(errCode);
         }
         RecordUnsafeUsage();
     }
 }