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
- OracleConnection.cs
- UriSection.cs
- AppDomainGrammarProxy.cs
- RuleInfoComparer.cs
- TraceData.cs
- AspCompat.cs
- ProtocolsConfigurationEntry.cs
- SizeKeyFrameCollection.cs
- ClientTargetCollection.cs
- BinaryObjectWriter.cs
- NumericExpr.cs
- MissingFieldException.cs
- MatrixTransform.cs
- ReadingWritingEntityEventArgs.cs
- PageCatalogPart.cs
- RecognizedPhrase.cs
- WsdlBuildProvider.cs
- TransformGroup.cs
- GroupLabel.cs
- ComponentChangedEvent.cs
- AppendHelper.cs
- ProxyHwnd.cs
- PropertyStore.cs
- ShaperBuffers.cs
- KoreanCalendar.cs
- TableProviderWrapper.cs
- ViewStateException.cs
- FeatureSupport.cs
- OuterGlowBitmapEffect.cs
- Form.cs
- FrameworkContentElement.cs
- UInt64.cs
- OdbcStatementHandle.cs
- XPathDocument.cs
- Trigger.cs
- CommandManager.cs
- Model3D.cs
- DesignerEditorPartChrome.cs
- SafeSystemMetrics.cs
- ScriptControl.cs
- LogWriteRestartAreaState.cs
- QuadraticBezierSegment.cs
- CacheOutputQuery.cs
- MediaTimeline.cs
- RuleValidation.cs
- AutomationPatternInfo.cs
- MetadataItemCollectionFactory.cs
- SynchronizedReadOnlyCollection.cs
- PLINQETWProvider.cs
- InkCanvasSelection.cs
- RotateTransform.cs
- FileEnumerator.cs
- CustomSignedXml.cs
- CannotUnloadAppDomainException.cs
- ContextMenuStrip.cs
- WorkflowServiceHost.cs
- UpdateManifestForBrowserApplication.cs
- TrustManager.cs
- AsnEncodedData.cs
- ThemeDictionaryExtension.cs
- XmlSchemaDocumentation.cs
- TransportReplyChannelAcceptor.cs
- WebPartTransformer.cs
- Monitor.cs
- TimelineCollection.cs
- ComboBox.cs
- Color.cs
- XPathSelectionIterator.cs
- FillBehavior.cs
- ObjectViewEntityCollectionData.cs
- DebuggerAttributes.cs
- TextElement.cs
- NamedElement.cs
- SourceFileInfo.cs
- PropertyGridView.cs
- EntityStoreSchemaFilterEntry.cs
- SolidBrush.cs
- RangeValueProviderWrapper.cs
- ParagraphVisual.cs
- XmlSchemaIdentityConstraint.cs
- StrokeCollection.cs
- Logging.cs
- ParsedAttributeCollection.cs
- IsolatedStorageException.cs
- AliasGenerator.cs
- TransactionalPackage.cs
- StructuredType.cs
- HwndMouseInputProvider.cs
- DocumentScope.cs
- DrawingGroup.cs
- ForEachAction.cs
- PageCache.cs
- DoubleLink.cs
- ButtonPopupAdapter.cs
- Number.cs
- InvalidWorkflowException.cs
- PersonalizablePropertyEntry.cs
- SignatureToken.cs
- DocumentPageView.cs
- TreeNodeClickEventArgs.cs