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
- ReliableSessionBindingElement.cs
- FormViewUpdatedEventArgs.cs
- ProcessExitedException.cs
- D3DImage.cs
- ReceiveCompletedEventArgs.cs
- InputScope.cs
- HuffModule.cs
- FieldDescriptor.cs
- StringExpressionSet.cs
- MembershipAdapter.cs
- ReadOnlyDataSourceView.cs
- ObjectDataSourceMethodEventArgs.cs
- Activity.cs
- ByteFacetDescriptionElement.cs
- XmlNamespaceMapping.cs
- GridViewRowCollection.cs
- AuthenticationManager.cs
- TripleDESCryptoServiceProvider.cs
- HttpWebRequest.cs
- RegisteredDisposeScript.cs
- DataBindingHandlerAttribute.cs
- TimeSpanSecondsConverter.cs
- InstanceCompleteException.cs
- OdbcUtils.cs
- DesignerContextDescriptor.cs
- X509Utils.cs
- SectionXmlInfo.cs
- SHA1Managed.cs
- KeyedCollection.cs
- JsonWriter.cs
- HttpModuleAction.cs
- Bitmap.cs
- ImageUrlEditor.cs
- IdleTimeoutMonitor.cs
- RawStylusSystemGestureInputReport.cs
- TextElement.cs
- MatrixAnimationUsingPath.cs
- LinkConverter.cs
- SetStoryboardSpeedRatio.cs
- TreeNodeBinding.cs
- StateChangeEvent.cs
- ComponentEvent.cs
- ListBox.cs
- SystemPens.cs
- MatrixTransform3D.cs
- QilBinary.cs
- OrthographicCamera.cs
- DataColumnCollection.cs
- ElementUtil.cs
- LayoutDump.cs
- ScriptManager.cs
- WeakRefEnumerator.cs
- NumericUpDownAcceleration.cs
- StrongNameKeyPair.cs
- EntitySqlException.cs
- HasCopySemanticsAttribute.cs
- FontStyles.cs
- MessageQueueException.cs
- OAVariantLib.cs
- MembershipAdapter.cs
- ParameterRetriever.cs
- DSASignatureDeformatter.cs
- CultureInfoConverter.cs
- Environment.cs
- DesignerCommandSet.cs
- StringBlob.cs
- ColumnTypeConverter.cs
- PropertyNames.cs
- WhiteSpaceTrimStringConverter.cs
- SiteMapNodeCollection.cs
- XmlConvert.cs
- TextBoxView.cs
- FileDataSourceCache.cs
- UnhandledExceptionEventArgs.cs
- NativeMethods.cs
- AppSettingsExpressionBuilder.cs
- RoleServiceManager.cs
- ContentPathSegment.cs
- ByteAnimationBase.cs
- ExpressionLexer.cs
- CodeExporter.cs
- StringExpressionSet.cs
- MasterPageParser.cs
- EventToken.cs
- SqlDataSourceCommandEventArgs.cs
- PropertyEntry.cs
- OdbcFactory.cs
- DesignerView.cs
- EntityClientCacheEntry.cs
- PropertySegmentSerializer.cs
- ExtensibleClassFactory.cs
- Transform.cs
- TextContainerChangedEventArgs.cs
- StateDesigner.Helpers.cs
- DependencyPropertyConverter.cs
- PersonalizationDictionary.cs
- LostFocusEventManager.cs
- TableRow.cs
- DrawingVisual.cs
- ParameterCollectionEditorForm.cs