Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / AddIn / AddIn / System / Addin / Hosting / Store / ContractComponent.cs / 1305376 / ContractComponent.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: ContractComponent ** ** Purpose: Represents a class that implements IContract on ** disk, for the add-in model. ** ===========================================================*/ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Text; using System.AddIn.MiniReflection; using System.Diagnostics.Contracts; namespace System.AddIn { [Serializable] internal sealed class ContractComponent : PipelineComponent { public ContractComponent(TypeInfo typeInfo, String assemblyLocation) : base(typeInfo, assemblyLocation) { } public override string ToString() { return String.Format(CultureInfo.CurrentCulture, Res.ContractToString, Name, BestAvailableLocation); } internal override bool Validate(Type type, Collectionwarnings) { //if (!type.Implements(new TypeInfo(typeof(IContract)))) if (!IContractInReflectionLoaderContext.IsAssignableFrom(type)) { warnings.Add(String.Format(CultureInfo.CurrentCulture, Res.ContractMustImplementIContract, Name)); return false; } if (!type.IsInterface) { warnings.Add(String.Format(CultureInfo.CurrentCulture, Res.ContractMustBeInterface, Name)); return false; } return base.Validate(type, warnings); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetaTableHelper.cs
- XmlSchemaAttributeGroupRef.cs
- DeclarativeExpressionConditionDeclaration.cs
- RadioButtonFlatAdapter.cs
- Hex.cs
- DataListItemEventArgs.cs
- ScriptResourceHandler.cs
- RMPermissions.cs
- OperationResponse.cs
- ITreeGenerator.cs
- PointLightBase.cs
- SymbolEqualComparer.cs
- LoadedEvent.cs
- DropSourceBehavior.cs
- WebProxyScriptElement.cs
- XmlWrappingWriter.cs
- DataServiceConfiguration.cs
- SqlEnums.cs
- ResourceLoader.cs
- BaseDataBoundControl.cs
- PixelFormat.cs
- Scene3D.cs
- EarlyBoundInfo.cs
- RequestCachingSection.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- GiveFeedbackEventArgs.cs
- DataSpaceManager.cs
- __ComObject.cs
- EventBuilder.cs
- SByteStorage.cs
- HtmlValidatorAdapter.cs
- TableCell.cs
- SettingsPropertyCollection.cs
- XmlSerializerVersionAttribute.cs
- PointAnimationUsingKeyFrames.cs
- SoapSchemaExporter.cs
- X509CertificateCollection.cs
- WebServiceClientProxyGenerator.cs
- Transform.cs
- CheckBoxAutomationPeer.cs
- ImageIndexConverter.cs
- BindingContext.cs
- SevenBitStream.cs
- ChangeProcessor.cs
- PropertyExpression.cs
- DataReaderContainer.cs
- InstanceDataCollectionCollection.cs
- infer.cs
- TabPanel.cs
- FileDialogCustomPlace.cs
- FixedTextPointer.cs
- LiteralControl.cs
- CheckBoxAutomationPeer.cs
- Typeface.cs
- ExpressionBuilder.cs
- EventDrivenDesigner.cs
- DeclarationUpdate.cs
- ReadOnlyCollectionBase.cs
- TCPListener.cs
- ThemeInfoAttribute.cs
- CompositeFontInfo.cs
- PersonalizationStateInfoCollection.cs
- PhysicalAddress.cs
- COAUTHIDENTITY.cs
- HtmlInputPassword.cs
- RTLAwareMessageBox.cs
- SafeEventHandle.cs
- VersionedStream.cs
- PropertyDescriptor.cs
- CurrentTimeZone.cs
- PowerStatus.cs
- RefreshPropertiesAttribute.cs
- ModelVisual3D.cs
- XmlSchemaAttribute.cs
- MsmqTransportElement.cs
- TokenBasedSet.cs
- RefreshPropertiesAttribute.cs
- ReferenceSchema.cs
- BindingNavigator.cs
- _SslStream.cs
- AnimationTimeline.cs
- SystemIPv4InterfaceProperties.cs
- RegisteredHiddenField.cs
- ServicePoint.cs
- WeakEventManager.cs
- sqlpipe.cs
- CodeDefaultValueExpression.cs
- NavigationPropertyEmitter.cs
- Membership.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- RegisterResponseInfo.cs
- Transform3DCollection.cs
- URIFormatException.cs
- XmlSchemaProviderAttribute.cs
- X509ScopedServiceCertificateElement.cs
- XmlWriterSettings.cs
- CollectionViewGroupInternal.cs
- DataBindingCollection.cs
- SystemIcmpV4Statistics.cs
- Int64KeyFrameCollection.cs