132 references to Requires
mscorlib (130)
system\appdomain.cs (1)
885Contract.Requires(fullName != null, "fullName != null");
system\collections\generic\arraysorthelper.cs (2)
190Contract.Requires(array != null, "Check the arguments in the caller!"); 191Contract.Requires(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
system\convert.cs (1)
262Contract.Requires(value != null, "[Convert.DefaultToType]value!=null");
system\datetime.cs (1)
172Contract.Requires(kind == DateTimeKind.Local, "Internal Constructor is for local times only");
system\decimal.cs (2)
572Contract.Requires((buffer != null && buffer.Length >= 16), "[GetBytes]buffer != null && buffer.Length >= 16"); 595Contract.Requires((buffer != null && buffer.Length >= 16), "[ToDecimal]buffer != null && buffer.Length >= 16");
system\globalization\datetimeformatinfo.cs (1)
1379Contract.Requires(values != null, "value != null");
system\io\__consolestream.cs (7)
176Contract.Requires(offset >= 0, "offset >= 0"); 177Contract.Requires(count >= 0, "count >= 0"); 178Contract.Requires(bytes != null, "bytes != null"); 238Contract.Requires(offset >= 0, "offset >= 0"); 239Contract.Requires(count >= 0, "count >= 0"); 240Contract.Requires(bytes != null, "bytes != null"); 241Contract.Requires(bytes.Length >= offset + count, "bytes.Length >= offset + count");
system\io\filestream.cs (8)
2488Contract.Requires(handle != null, "handle != null"); 2489Contract.Requires(offset >= 0, "offset >= 0"); 2490Contract.Requires(count >= 0, "count >= 0"); 2491Contract.Requires(bytes != null, "bytes != null"); 2543Contract.Requires(handle != null, "handle != null"); 2544Contract.Requires(offset >= 0, "offset >= 0"); 2545Contract.Requires(count >= 0, "count >= 0"); 2546Contract.Requires(bytes != null, "bytes != null");
system\io\path.cs (2)
488Contract.Requires(path != null, "path can't be null"); 511Contract.Requires(path != null, "path can't be null");
system\io\pathhelper.cs (3)
392Contract.Requires(useStackAlloc, "This should never be called for PathHelpers wrapping a StringBuilder"); 397Contract.Requires(!useStackAlloc, "This should never be called for PathHelpers that wrap a stackalloc'd buffer"); 403Contract.Requires(useStackAlloc, "This should never be called for PathHelpers wrapping a StringBuilder");
system\io\stream.cs (2)
1204Contract.Requires(stream != null, "Expected a non-null stream."); 1205Contract.Requires(methodName == "BeginRead" || methodName == "BeginWrite",
system\math.cs (4)
256Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 271Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 286Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 301Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)");
system\reflection\emit\typebuilderinstantiation.cs (1)
27Contract.Requires(type != null, "this is only called from RuntimeType.MakeGenericType and TypeBuilder.MakeGenericType so 'type' cannot be null");
system\resources\manifestbasedresourcegroveler.cs (5)
56Contract.Requires(mediator != null, "mediator shouldn't be null; check caller"); 432Contract.Requires(satellite != null, "satellite shouldn't be null; check caller"); 433Contract.Requires(fileName != null, "fileName shouldn't be null; check caller"); 457Contract.Requires(satellite != null, "satellite shouldn't be null; check caller"); 458Contract.Requires(name != null, "name shouldn't be null; check caller");
system\resources\resourcereader.cs (4)
204Contract.Requires(stream != null, "Need a stream!"); 205Contract.Requires(stream.CanRead, "Stream should be readable!"); 206Contract.Requires(resCache != null, "Need a Dictionary!"); 1247Contract.Requires(typeCode >= 0, "can't be negative");
system\runtime\compilerservices\AsyncMethodBuilder.cs (3)
623Contract.Requires(completedTask != null, "Expected non-null task"); 624Contract.Requires(completedTask.Status == TaskStatus.RanToCompletion, "Expected a successfully completed task"); 1109Contract.Requires(continuation != null, "Expected non-null continuation");
system\runtime\compilerservices\TaskAwaiter.cs (9)
73Contract.Requires(task != null, "Constructing an awaiter requires a task to await."); 162Contract.Requires(task.IsCompleted, "Task must have been completed by now."); 163Contract.Requires(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully."); 233Contract.Requires(task != null, "Need a task to wait on"); 234Contract.Requires(continuation != null, "Need a continuation to invoke when the wait completes"); 310Contract.Requires(task != null, "Constructing an awaiter requires a task to await."); 370Contract.Requires(task != null, "Constructing an awaitable requires a task to await."); 399Contract.Requires(task != null, "Constructing an awaiter requires a task to await."); 487Contract.Requires(task != null, "Constructing an awaiter requires a task to await.");
system\runtime\interopservices\windowsruntime\clrireferenceimpl.cs (1)
293Contract.Requires(obj != null, "Null should not be boxed.");
system\string.cs (1)
422Contract.Requires(strA.Length == strB.Length, "Lengths of strA and strB must be the same");
system\text\stringbuilder.cs (2)
1964Contract.Requires(Capacity == Length, "Expand expect to be called only when there is no space left"); // We are currently full 1965Contract.Requires(minBlockCharCount > 0, "Expansion request must be positive");
system\threading\SemaphoreSlim.cs (1)
671Contract.Requires(task != null, "Expected non-null task");
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (11)
207Contract.Requires(ReadyToComplete, "The block must be ready to complete to be here."); 234Contract.Requires(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception.InnerExceptions.Count > 0, 351Contract.Requires(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode."); 352Contract.Requires(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed."); 401Contract.Requires(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode."); 509Contract.Requires(pair != null, "Scheduler must be associated with a valid pair."); 510Contract.Requires(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask, 512Contract.Requires( 674Contract.Requires(scheduler != null, "Need a scheduler with which to construct the debug view."); 697Contract.Requires(pair != null, "Need a pair with which to construct the debug view."); 740Contract.Requires(syncObj != null, "The monitor object to check must be provided.");
system\threading\Tasks\FutureFactory.cs (12)
540Contract.Requires((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 699Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 822Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 959Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1104Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1256Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1379Contract.Requires(thisRef != null, "Expected a non-null thisRef"); 1380Contract.Requires(endMethod != null, "Expected a non-null endMethod"); 1779Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1826Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2180Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2227Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
system\threading\Tasks\ProducerConsumerQueues.cs (9)
180Contract.Requires(segment != null, "Expected a non-null segment."); 235Contract.Requires(segment != null, "Expected a non-null segment."); 236Contract.Requires(array != null, "Expected a non-null item array."); 293Contract.Requires(segment != null, "Expected a non-null segment."); 294Contract.Requires(array != null, "Expected a non-null item array."); 359Contract.Requires(segment != null, "Expected a non-null segment."); 360Contract.Requires(array != null, "Expected a non-null item array."); 485Contract.Requires((size & (size - 1)) == 0, "Size must be a power of 2"); 524Contract.Requires(queue != null, "Expected a non-null queue.");
system\threading\Tasks\Task.cs (20)
230Contract.Requires(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 1176Contract.Requires(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler"); 1989Contract.Requires(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 2000Contract.Requires(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 2147Contract.Requires(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true"); 2371Contract.Requires(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task"); 3393Contract.Requires((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 4636Contract.Requires(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4637Contract.Requires(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4638Contract.Requires(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4729Contract.Requires(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 6071Contract.Requires(tasks != null, "Expected a non-null tasks array"); 6102Contract.Requires(tasks != null, "Expected a non-null task array"); 6103Contract.Requires(tasks.Length > 0, "Expected a non-zero length task array"); 6322Contract.Requires(tasks != null, "Expected a non-null tasks array"); 6346Contract.Requires(tasks != null, "Expected a non-null task array"); 6347Contract.Requires(tasks.Length > 0, "Expected a non-zero length task array"); 7152Contract.Requires(outerTask != null, "Expected non-null outerTask"); 7238Contract.Requires(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7269Contract.Requires(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
system\threading\Tasks\TaskContinuation.cs (6)
37Contract.Requires(action is Action<Task> || action is Action<Task, object>, 85Contract.Requires(function is Func<Task, TResult> || function is Func<Task, object, TResult>, 133Contract.Requires(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object>, 181Contract.Requires(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object, TResult>, 305Contract.Requires(task != null, "TaskContinuation ctor: task is null"); 306Contract.Requires(scheduler != null, "TaskContinuation ctor: scheduler is null");
system\threading\Tasks\TaskExceptionHolder.cs (5)
63Contract.Requires(task != null, "Expected a non-null task."); 189Contract.Requires(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject"); 190Contract.Requires( 206Contract.Requires(exceptionObject != null, "Expected exceptionObject to be non-null."); 243Contract.Requires(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject");
system\threading\Tasks\TaskFactory.cs (3)
1641Contract.Requires((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1719Contract.Requires((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 2422Contract.Requires(tasks != null, "Expected non-null collection of tasks");
system\threading\Tasks\TaskToApm.cs (1)
175Contract.Requires(!completedSynchronously || task.IsCompleted, "If completedSynchronously is true, the task must be completed.");
system\threading\Tasks\ThreadPoolTaskScheduler.cs (1)
45Contract.Requires(obj != null, "TaskScheduler.LongRunningThreadWork: obj is null");
system\type.cs (1)
1721Contract.Requires(ifaceType.IsInterface, "ifaceType must be an interface type");
System (2)
net\System\Net\_ChunkParser.cs (1)
102Contract.Requires(internalBuffer.Length >= chunkLengthBuffer,
net\System\Net\WebSockets\WebSocketHelpers.cs (1)
542Contract.Requires(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");