18 references to Contract
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (18)
BuildHost.cs (1)
133Contract.ThrowIfFalse(TryEnsureMSBuildLoaded(projectFilePath), $"We don't have an MSBuild to use; {nameof(HasUsableMSBuild)} should have been called first to check.");
MSBuild\ProjectFile\ProjectFile.cs (1)
434Contract.ThrowIfNull(_loadedProject, "The project was not loaded.");
Program.cs (1)
58Contract.ThrowIfFalse(targetObject == 0, "The first object registered should have target 0, which is assumed by the client.");
Rpc\Contracts\MonoMSBuildDiscovery.cs (3)
71Contract.ThrowIfTrue(PlatformInformation.IsWindows); 95Contract.ThrowIfTrue(PlatformInformation.IsWindows); 132Contract.ThrowIfTrue(PlatformInformation.IsWindows);
Rpc\RpcServer.cs (7)
72Contract.ThrowIfNull(request); 85_ => Contract.ThrowIfFalse(runningTasks.Remove(runningTask)), 110Contract.ThrowIfFalse( 116Contract.ThrowIfNull(method, $"The invoked method '{request.Method}' could not be found."); 123Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length - 1, $"The arguments list should contain every parameter for {request.Method} except the final CancellationToken."); 125Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length, $"The arguments list should contain every parameter for {request.Method}."); 173Contract.ThrowIfTrue(responseJson.Contains("\r") || responseJson.Contains("\n"));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (5)
53Contract.ThrowIfTrue(_index + values.Length > _values.Length); 60Contract.ThrowIfTrue(_index + values.Count > _values.Length); 67Contract.ThrowIfTrue(_index + values.Count > _values.Length); 74Contract.ThrowIfTrue(_index + values.Count > _values.Length); 108Contract.ThrowIfTrue(_index != _values.Length);