184 references to Invariant
WindowsBase (184)
Base\MS\Internal\IO\Packaging\CaseInsensitiveOrdinalStringComparer.cs (3)
32Invariant.Assert((x is String) && (y is String)); 39Invariant.Assert((x is String) && (y is String)); 48Invariant.Assert(str is String);
Base\MS\Internal\IO\Packaging\CompoundFile\CompoundFileDeflateTransform.cs (8)
79Invariant.Assert(source.CanRead); 80Invariant.Assert(sink.CanWrite, "Logic Error - Cannot decompress into a read-only stream"); 213Invariant.Assert(source.CanRead); 214Invariant.Assert(sink.CanWrite, "Logic Error - Cannot compress into a read-only stream"); 276Invariant.Assert(bytesRead <= sourceBufferSize); 293Invariant.Assert(compressedSize > 0, "compressing non-zero bytes creates a non-empty block"); 297Invariant.Assert(zStream.AvailIn == 0, "Expecting all data to be compressed!"); 355Invariant.Assert(size >= 0, "Cannot allocate negative number of bytes");
Base\MS\Internal\IO\Packaging\CompoundFile\NativeCompoundFileAPIs.cs (5)
96Invariant.Assert(s != null, "s cannot be null"); 127Invariant.Assert(s != null, "s cannot be null"); 437Invariant.Assert(ppstg != null, "ppstg cannot be null"); 454Invariant.Assert(pstgDest != null, "pstgDest cannot be null"); 745Invariant.Assert(pstm != null, "pstm cannot be null");
Base\MS\Internal\IO\Packaging\CompoundFile\UserUseLicenseDictionaryLoader.cs (1)
54Invariant.Assert(rmet != null);
Base\MS\Internal\IO\Packaging\CompoundFile\VersionedStreamOwner.cs (1)
159Invariant.Assert(temp >= 0); // catch any math errors
Base\MS\Internal\IO\Packaging\InterleavedZipPartStream.cs (4)
79Invariant.Assert(_dir.GetStartOffset(GetCurrentPieceNumber()) == 0); 137Invariant.Assert(_dir.GetStartOffset(pieceNumber) == _currentOffset + totalBytesRead); 309Invariant.Assert(totalBytesWritten == count); 440Invariant.Assert(CanSeek);
Base\MS\Internal\IO\Packaging\InternalRelationshipCollection.cs (5)
117Invariant.Assert(!_package.InStreamingCreation); 130Invariant.Assert(!_package.InStreamingCreation); 145Invariant.Assert(!_package.InStreamingCreation); 209Invariant.Assert(id != null, "id should not be null"); 731Invariant.Assert(_relationships.Count > 0);
Base\MS\Internal\IO\Packaging\PartBasedPackageProperties.cs (3)
503Invariant.Assert(_propertyPart == null); // This gets called exclusively from constructor. 672Invariant.Assert(false, "Unknown value type for properties"); 762Invariant.Assert(_xmlWriter == null);
Base\MS\Internal\IO\Packaging\PartManifestEntry.cs (4)
73Invariant.Assert(uri != null); 74Invariant.Assert(contentType != null); 75Invariant.Assert(hashAlgorithm != null); 87Invariant.Assert(relationshipSelectors.Count > 0);
Base\MS\Internal\IO\Packaging\PieceDirectory.cs (6)
71Invariant.Assert(stream != null); 72Invariant.Assert(pieceStart >= 0); 168Invariant.Assert(sortedPieceInfoList.Count > 0); 248Invariant.Assert(pieceNumber <= _lastPieceIndex, "We should have found the valid pieceNumber earlier"); 297Invariant.Assert(pieceNumber <= _lastPieceIndex); 495Invariant.Assert(_pieceStreamInfoList.Count == 0);
Base\MS\Internal\IO\Packaging\PieceNameHelper.cs (4)
189Invariant.Assert(pieceNumber >= 0, "Negative piece number."); 208Invariant.Assert(zipFileInfo != null); 453Invariant.Assert(pieceInfoA != null); 454Invariant.Assert(pieceInfoB != null);
Base\MS\Internal\IO\Packaging\SparseMemoryStream.cs (3)
381Invariant.Assert(lowWaterMark >=0 && highWaterMark >=0); // both of them must be positive or 0 382Invariant.Assert(lowWaterMark < highWaterMark); // low water mark must below high water mark 383Invariant.Assert(lowWaterMark <= Int32.MaxValue); // low water mark must fit single memory stream 2G
Base\MS\Internal\IO\Packaging\XmlDigitalSignatureProcessor.cs (7)
121Invariant.Assert(signer != null); 604Invariant.Assert(transformName != null); 631Invariant.Assert(transformName != null); 747Invariant.Assert(manager != null); 748Invariant.Assert(signaturePart != null); 967Invariant.Assert(_signedXml != null); 1198Invariant.Assert(!signer.HasPrivateKey);
Base\MS\Internal\IO\Packaging\XmlSignatureManifest.cs (3)
118Invariant.Assert(manager != null); 119Invariant.Assert(reader != null); 705Invariant.Assert(false, "This option should never be executed");
Base\MS\Internal\IO\Packaging\XmlSignatureProperties.cs (2)
103Invariant.Assert(xDoc != null); 104Invariant.Assert(signatureId != null);
Base\MS\Internal\IO\Zip\ZipIOBlockManager.cs (1)
835Invariant.Assert(_blockList.Count >= _requiredBlockCount);
Base\MS\Internal\IO\Zip\ZipIOLocalFileBlock.cs (4)
224Invariant.Assert(!_blockManager.Streaming); 576Invariant.Assert(_localFileDataDescriptor != null); 600Invariant.Assert(_localFileDataDescriptor != null); 624Invariant.Assert(_localFileDataDescriptor != null);
Base\MS\Internal\IO\Zip\ZipIOLocalFileDataDescriptor.cs (3)
155Invariant.Assert(_size == _fixedMinimalRecordSizeWithSignatureZip64); 192Invariant.Assert((value >= 0), "CompressedSize must be non-negative"); 206Invariant.Assert((value >= 0), "UncompressedSize must be non-negative");
Base\MS\Internal\PlatformCulture.cs (1)
36Invariant.Assert(!string.IsNullOrEmpty(uiLanguage), "No UILanguage was specified in stringtable.");
Base\MS\Internal\Security\RightsManagement\ClientSession.cs (26)
58Invariant.Assert(user != null); 59Invariant.Assert((userActivationMode == UserActivationMode.Permanent) || 76Invariant.Assert((_hSession != null) && (!_hSession.IsInvalid)); 302Invariant.Assert(_envHandle == null); 407Invariant.Assert((certificateType == EnumerateLicenseFlags.SpecifiedClientLicensor) || 487Invariant.Assert(index >= 0); 547Invariant.Assert(issuanceLicense != null); 548Invariant.Assert(!_envHandle.IsInvalid); 601Invariant.Assert(!_envHandle.IsInvalid); 666Invariant.Assert((oldList != null) && (newList != null)); 791Invariant.Assert(serializedUseLicense != null); 878Invariant.Assert(theFirstHrFailureCode != 0); // it must contain an error as a succesfull return above should take of non-failure cases 1082Invariant.Assert(!issuanceLicenseHandle.IsInvalid); 1106Invariant.Assert(index >= 0); 1107Invariant.Assert(certificateChain != null); 1284Invariant.Assert(certificateChain != null); 1294Invariant.Assert(certificateChain != null); 1376Invariant.Assert(certificateChain != null); 1405Invariant.Assert(useLicenseChain != null); 1411Invariant.Assert(useLicense != null); 1455Invariant.Assert(useLicenseChain != null); 1459Invariant.Assert(useLicense != null); 1611Invariant.Assert(useLicenseChain != null); 1614Invariant.Assert(useLicense != null); 1764Invariant.Assert(publishLicense != null); 1845Invariant.Assert(publishLicense != null);
Base\MS\Internal\Security\RightsManagement\IssuanceLicense.cs (10)
109Invariant.Assert((boundLicenseHandle.IsInvalid) || (issuanceLicense != null)); 157Invariant.Assert((_issuanceLicenseHandle != null) && 250Invariant.Assert(unsignedPublishLicense != null); 416Invariant.Assert(grant != null); 417Invariant.Assert(grant.User != null); 647Invariant.Assert(index >= 0); 673Invariant.Assert(index >= 0); 730Invariant.Assert(index >= 0); 797Invariant.Assert(index >= 0); 1047Invariant.Assert((_issuanceLicenseHandle != null) &&
Base\MS\Internal\WeakReferenceKey.cs (1)
26Invariant.Assert(item != null);
Base\System\ComponentModel\GroupDescription.cs (1)
221Invariant.Assert(_sort.Count == 0, "must be empty SortDescription collection");
Base\System\IO\Packaging\CompoundFile\StorageInfo.cs (3)
558Invariant.Assert(streamArray != null); 588Invariant.Assert(storageArray != null); 680Invariant.Assert( null != newStorage);
Base\System\IO\Packaging\CompoundFile\StorageRoot.cs (1)
497Invariant.Assert(root != null);
Base\System\IO\Packaging\EncryptedPackage.cs (3)
620Invariant.Assert(_root != null, "The envelope cannot be null"); 720Invariant.Assert(!_handedOutPackageStream, "Copy of package stream has been already handed out"); 791Invariant.Assert(!_handedOutPackage, "Copy of package has been already handed out");
Base\System\IO\Packaging\Package.cs (1)
1164Invariant.Assert(index >= 0, "Given uri must be present in the dictionary");
Base\System\IO\Packaging\ZipPackage.cs (3)
838Invariant.Assert(extensionA != null, "extenstion should not be null"); 839Invariant.Assert(extensionB != null, "extenstion should not be null"); 850Invariant.Assert(extension != null, "extenstion should not be null");
Base\System\IO\Packaging\ZipPackagePart.cs (1)
82Invariant.Assert(_pieces != null);
Base\System\Security\RightsManagement\CryptoProvider.cs (8)
372Invariant.Assert(boundLicenseHandleList != null); 373Invariant.Assert(boundLicenseHandleList.Count > 0); 375Invariant.Assert(rightsInfoList != null); 376Invariant.Assert(rightsInfoList.Count > 0); 380Invariant.Assert(rightsInfoList.Count == boundLicenseHandleList.Count); 382Invariant.Assert(owner != null); 398Invariant.Assert(serializedPublishLicense != null); 441Invariant.Assert(attributeSize == 4);
Base\System\Security\RightsManagement\SecureEnvironment.cs (4)
272Invariant.Assert(_clientSession != null); 398Invariant.Assert(applicationManifest != null); 399Invariant.Assert(user != null); 400Invariant.Assert(clientSession != null);
Base\System\Security\RightsManagement\UnsignedPublishLicense.cs (2)
296Invariant.Assert(!boundLicenseHandle.IsInvalid); 297Invariant.Assert(publishLicenseTemplate != null);
Base\System\Security\RightsManagement\User.cs (3)
238Invariant.Assert(false, "AuthenticationProviderType can only be queried for Windows or Passport authentication"); 284Invariant.Assert(user1 != null, "user1 should not be null"); 290Invariant.Assert(user != null, "user should not be null");
Base\System\Windows\Data\DataSourceProvider.cs (2)
287Invariant.Assert(Dispatcher != null); 362Invariant.Assert(args.Length == 5);
Base\System\Windows\DependencyProperty.cs (2)
431Invariant.Assert (!valueAsISealable.IsSealed, 436Invariant.Assert(dispatcherObject.Dispatcher == null,
Base\System\Windows\Freezable.cs (13)
846Invariant.Assert(false); 1951if (Invariant.Strict) 1960Invariant.Assert(clone != original, "CloneCore should not return the same instance as the original."); 1963Invariant.Assert(!cloneAsFreezable.HasHandlers, "CloneCore should not have handlers attached on construction."); 1971Invariant.Assert(originalAsIList.Count == cloneAsIList.Count, "CloneCore didn't clone all of the elements in the list."); 1979Invariant.Assert(originalItemAsFreezable != cloneItemAsFreezable, "CloneCore didn't clone the elements in the list correctly."); 1988if (Invariant.Strict) 1990Invariant.Assert(newInstance != null, "{0} should not return null.", methodName); 1991Invariant.Assert(newInstance.GetType() == original.GetType(), 1995Invariant.Assert(!newInstance.IsFrozen, "{0} should return a mutable instance. Recieved a frozen instance.", 2004if (Invariant.Strict) 2042if (Invariant.Strict) 2044Invariant.Assert(owner != null,
Base\System\Windows\Threading\DispatcherOperation.cs (1)
513Invariant.Assert(false, "Operation should be either Aborted or Completed!");
Base\System\Windows\WeakEventManager.cs (7)
610Invariant.Assert(_users == 0, "Cannot modify a ListenerList that is in use"); 619Invariant.Assert(_users == 0, "Cannot modify a ListenerList that is in use"); 632Invariant.Assert(_users == 0, "Cannot modify a ListenerList that is in use"); 679Invariant.Assert(_users == 0, "Cannot modify a ListenerList that is in use"); 730Invariant.Assert(_users == 0, "Cannot modify a ListenerList that is in use"); 808Invariant.Assert(handled, 825Invariant.Assert(_users == 0, "Cannot modify a ListenerList that is in use");
Shared\MS\Internal\Invariant.cs (1)
261if (Invariant.IsDialogOverrideEnabled)
Shared\MS\Internal\IO\Packaging\PackagingUtilities.cs (21)
69Invariant.Assert(reader != null && reader.ReadState == ReadState.Initial); 208Invariant.Assert(stream != null); 209Invariant.Assert(buffer != null); 210Invariant.Assert(buffer.Length > 0); 211Invariant.Assert(offset >= 0); 212Invariant.Assert(requestedCount >= 0); 213Invariant.Assert(requiredCount >= 0); 214Invariant.Assert(checked(offset + requestedCount <= buffer.Length)); 215Invariant.Assert(requiredCount <= requestedCount); 263Invariant.Assert(reader != null); 264Invariant.Assert(buffer != null); 265Invariant.Assert(buffer.Length > 0); 266Invariant.Assert(offset >= 0); 267Invariant.Assert(requestedCount >= 0); 268Invariant.Assert(requiredCount >= 0); 269Invariant.Assert(checked(offset + requestedCount <= buffer.Length)); 270Invariant.Assert(requiredCount <= requestedCount); 302Invariant.Assert(sourceStream != null); 303Invariant.Assert(targetStream != null); 304Invariant.Assert(bytesToCopy >= 0); 305Invariant.Assert(bufferSize > 0);
Shared\MS\Internal\TextServicesLoader.cs (1)
111Invariant.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
Shared\MS\Win32\HwndWrapper.cs (1)
416Invariant.Assert(handle != null && handle.Value != IntPtr.Zero,