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
- OdbcCommandBuilder.cs
- NamespaceQuery.cs
- GenericTypeParameterBuilder.cs
- EventTrigger.cs
- StrokeFIndices.cs
- SystemInfo.cs
- UserControlParser.cs
- HostProtectionPermission.cs
- LinqDataSourceStatusEventArgs.cs
- EntityContainerEmitter.cs
- TemplatePropertyEntry.cs
- RuleDefinitions.cs
- PriorityBinding.cs
- DbInsertCommandTree.cs
- FontEditor.cs
- UIElement3D.cs
- ContentTextAutomationPeer.cs
- UpdatableWrapper.cs
- OperandQuery.cs
- TypeDependencyAttribute.cs
- WebColorConverter.cs
- SafeRightsManagementSessionHandle.cs
- IntellisenseTextBox.designer.cs
- Control.cs
- DetailsViewInsertedEventArgs.cs
- DataGridViewSelectedCellCollection.cs
- ellipse.cs
- StringCollectionEditor.cs
- SiteMapNodeItem.cs
- FontStyleConverter.cs
- ReaderOutput.cs
- ListItem.cs
- MSAANativeProvider.cs
- SerializationSectionGroup.cs
- RC2CryptoServiceProvider.cs
- ProgressBarHighlightConverter.cs
- PenThreadPool.cs
- ActiveXContainer.cs
- ByteFacetDescriptionElement.cs
- HttpSessionStateBase.cs
- AliasExpr.cs
- PageCatalogPart.cs
- UrlAuthFailedErrorFormatter.cs
- UseAttributeSetsAction.cs
- SafeNativeMethods.cs
- UInt16.cs
- FormViewRow.cs
- ToolStripSystemRenderer.cs
- MultitargetingHelpers.cs
- BStrWrapper.cs
- DictionaryBase.cs
- _ListenerRequestStream.cs
- MetadataProperty.cs
- ChangePassword.cs
- Control.cs
- ContentPresenter.cs
- Brush.cs
- WebServiceEnumData.cs
- SqlDataSourceView.cs
- InkCanvasFeedbackAdorner.cs
- CompositionCommandSet.cs
- ParameterExpression.cs
- MetadataSerializer.cs
- HtmlInputCheckBox.cs
- DeviceContexts.cs
- ListViewInsertEventArgs.cs
- ResourceSet.cs
- RoutedEventArgs.cs
- UserControlCodeDomTreeGenerator.cs
- XmlSchemaAll.cs
- SafeFileMapViewHandle.cs
- ExtractedStateEntry.cs
- SelectionWordBreaker.cs
- DataServiceResponse.cs
- VBIdentifierNameEditor.cs
- SettingsContext.cs
- FontFamilyValueSerializer.cs
- MatrixStack.cs
- ColumnResizeAdorner.cs
- BasicExpressionVisitor.cs
- ScrollPattern.cs
- Soap11ServerProtocol.cs
- Label.cs
- AccessKeyManager.cs
- CellTreeNode.cs
- VirtualStackFrame.cs
- SafeEventLogReadHandle.cs
- BinaryReader.cs
- LogicalExpr.cs
- CodeTypeReference.cs
- SelectionProviderWrapper.cs
- AppSettingsExpressionBuilder.cs
- CultureTable.cs
- AuthenticationException.cs
- Point4DValueSerializer.cs
- SpellerStatusTable.cs
- CodeThrowExceptionStatement.cs
- CacheVirtualItemsEvent.cs
- SafeNativeMethodsMilCoreApi.cs
- LinkedResource.cs