Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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, Collection warnings) { //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
- serverconfig.cs
- MD5CryptoServiceProvider.cs
- XmlAttribute.cs
- CheckBoxList.cs
- DoubleLinkList.cs
- Rotation3DAnimationBase.cs
- XmlConvert.cs
- RuleSettings.cs
- ExecutionEngineException.cs
- StrongNameKeyPair.cs
- WebRequest.cs
- SrgsDocument.cs
- Ray3DHitTestResult.cs
- listitem.cs
- SafeHandles.cs
- SqlProcedureAttribute.cs
- StyleBamlRecordReader.cs
- ValueCollectionParameterReader.cs
- PolicyException.cs
- XmlWhitespace.cs
- TypedDataSetSchemaImporterExtension.cs
- DataServices.cs
- BaseDataListComponentEditor.cs
- HttpFileCollection.cs
- WebConfigurationFileMap.cs
- DesignerVerb.cs
- WebPartConnectionsConnectVerb.cs
- HostSecurityManager.cs
- SynchronizationContext.cs
- PagedDataSource.cs
- UInt64Converter.cs
- Header.cs
- BamlResourceContent.cs
- PathFigureCollectionConverter.cs
- OdbcEnvironmentHandle.cs
- WindowsListBox.cs
- RequestCache.cs
- ExpressionBindingsDialog.cs
- HtmlAnchor.cs
- QilInvoke.cs
- RegexMatchCollection.cs
- ShimAsPublicXamlType.cs
- DropShadowEffect.cs
- StylusCollection.cs
- HttpModuleCollection.cs
- IdentifierService.cs
- Trigger.cs
- DataExpression.cs
- WebServiceAttribute.cs
- DataGrid.cs
- InvalidPropValue.cs
- SqlNamer.cs
- AssemblyBuilder.cs
- LogicalExpr.cs
- TableItemPatternIdentifiers.cs
- Span.cs
- SqlDataSourceCommandEventArgs.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- FloaterBaseParaClient.cs
- LinearKeyFrames.cs
- ContextMenuStrip.cs
- RegisteredArrayDeclaration.cs
- AliasExpr.cs
- ClientSponsor.cs
- ProfileModule.cs
- MatrixCamera.cs
- OleDbDataReader.cs
- DataGridViewCellStyle.cs
- UIElement3D.cs
- WebPartConnection.cs
- PathFigureCollection.cs
- SqlRecordBuffer.cs
- prompt.cs
- TemplatePropertyEntry.cs
- ChannelManagerBase.cs
- OleAutBinder.cs
- XPathBinder.cs
- CommandID.cs
- CommandID.cs
- BulletChrome.cs
- OperatorExpressions.cs
- BigInt.cs
- FileDialog_Vista.cs
- TreeWalker.cs
- HeaderedContentControl.cs
- ListControl.cs
- StylusPoint.cs
- Int64.cs
- TextEditor.cs
- PopupRoot.cs
- AsyncOperationManager.cs
- RawStylusInputReport.cs
- FreezableOperations.cs
- ErrorWrapper.cs
- HttpChannelHelpers.cs
- QuaternionKeyFrameCollection.cs
- DependencyPropertyDescriptor.cs
- TypedRowHandler.cs
- BindingWorker.cs
- ExpressionsCollectionConverter.cs