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
- ChannelManager.cs
- FactoryGenerator.cs
- SqlWriter.cs
- TemplateInstanceAttribute.cs
- Emitter.cs
- RectAnimation.cs
- DesignerAttribute.cs
- DispatchChannelSink.cs
- DbDataReader.cs
- WindowsAuthenticationEventArgs.cs
- ValidationRule.cs
- BaseInfoTable.cs
- AnnotationResourceChangedEventArgs.cs
- TextRangeAdaptor.cs
- ImageInfo.cs
- SmiSettersStream.cs
- PropertyFilter.cs
- MouseActionConverter.cs
- Rectangle.cs
- SafeThreadHandle.cs
- PixelShader.cs
- DATA_BLOB.cs
- TextModifierScope.cs
- DebugTracing.cs
- Int32CollectionConverter.cs
- EventTrigger.cs
- DBSqlParserTableCollection.cs
- RegexInterpreter.cs
- PointCollectionValueSerializer.cs
- ResourceAttributes.cs
- GradientStop.cs
- ListViewUpdateEventArgs.cs
- PropertyToken.cs
- BasicHttpMessageCredentialType.cs
- SBCSCodePageEncoding.cs
- TypedMessageConverter.cs
- ObjectViewQueryResultData.cs
- InboundActivityHelper.cs
- XamlRtfConverter.cs
- WebRequest.cs
- SelectionRangeConverter.cs
- TaiwanLunisolarCalendar.cs
- ModelUIElement3D.cs
- GroupBox.cs
- PtsCache.cs
- ClientRequest.cs
- GroupBox.cs
- Substitution.cs
- EventLogTraceListener.cs
- rsa.cs
- PropertyMetadata.cs
- DataContractSerializerOperationFormatter.cs
- OpenTypeCommon.cs
- SerializableAuthorizationContext.cs
- PropertyToken.cs
- LineVisual.cs
- Control.cs
- XmlLinkedNode.cs
- TextBounds.cs
- AuthenticationModuleElementCollection.cs
- GenerateHelper.cs
- MobileTemplatedControlDesigner.cs
- CodeDomExtensionMethods.cs
- __Filters.cs
- PointAnimation.cs
- CompoundFileIOPermission.cs
- RenderingBiasValidation.cs
- BitmapEffectInput.cs
- TCPListener.cs
- TextRangeBase.cs
- TransactionException.cs
- WebConfigurationFileMap.cs
- XmlSubtreeReader.cs
- SqlException.cs
- Label.cs
- HtmlElement.cs
- X509Utils.cs
- PageAdapter.cs
- XmlNodeComparer.cs
- RawStylusActions.cs
- DataTableMapping.cs
- SettingsPropertyValueCollection.cs
- SpinLock.cs
- InteropBitmapSource.cs
- ScrollChrome.cs
- CommentEmitter.cs
- InstanceOwnerException.cs
- TemplateBindingExtension.cs
- AnonymousIdentificationModule.cs
- ObjectSelectorEditor.cs
- RegexBoyerMoore.cs
- FixedSOMSemanticBox.cs
- Calendar.cs
- NegotiateStream.cs
- ImageSourceConverter.cs
- ServicePrincipalNameElement.cs
- Classification.cs
- ToolStripLocationCancelEventArgs.cs
- GridViewDeletedEventArgs.cs
- StorageMappingItemLoader.cs