Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / AddIn / AddIn / System / Addin / Hosting / Store / AddInBase.cs / 1305376 / AddInBase.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: AddInBase ** ** Purpose: Represents an add-in's base class on disk. ** ===========================================================*/ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Text; using System.AddIn.MiniReflection; using System.Reflection; using System.Diagnostics.Contracts; namespace System.AddIn { [Serializable] internal sealed class AddInBase : PipelineComponent { internal TypeInfo[] _activatableAs; internal String _assemblyName; public AddInBase(TypeInfo typeInfo, TypeInfo[] activatableAs, String assemblyLocation, String assemblyName) : base(typeInfo, assemblyLocation) { _activatableAs = activatableAs; _assemblyName = assemblyName; } public override string ToString() { return String.Format(CultureInfo.CurrentCulture, Res.AddInBaseToString, Name, BestAvailableLocation); } internal override bool Validate(Type type, Collectionwarnings) { if (type.IsClass && type.IsSealed) { warnings.Add(String.Format(CultureInfo.CurrentCulture, Res.AddInBaseMustBeSubclassable, Name)); return false; } return base.Validate(type, warnings); } internal bool CanDirectConnectTo(TypeInfo havTypeInfo) { bool result = false; if(havTypeInfo.Equals(TypeInfo)) { // Check the add-in base's type info. result = true; } else if(_activatableAs != null) { // Check the ActivatableAs types. for(int i = 0; i < _activatableAs.Length && result == false; i++) { if(_activatableAs[i].Equals(havTypeInfo)) { result = true; } } } return result; } } } // 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
- Atom10FormatterFactory.cs
- RMEnrollmentPage1.cs
- HitTestDrawingContextWalker.cs
- SmtpClient.cs
- HitTestFilterBehavior.cs
- VariableQuery.cs
- SerialStream.cs
- AuthenticationConfig.cs
- WebBrowserHelper.cs
- ProcessHostConfigUtils.cs
- MessagingDescriptionAttribute.cs
- NativeMethods.cs
- StrokeSerializer.cs
- AsmxEndpointPickerExtension.cs
- CircleHotSpot.cs
- FilteredSchemaElementLookUpTable.cs
- SpotLight.cs
- StrokeRenderer.cs
- graph.cs
- ElementAction.cs
- TcpSocketManager.cs
- WebPartTransformer.cs
- TextServicesCompartmentEventSink.cs
- Margins.cs
- SkipStoryboardToFill.cs
- Permission.cs
- TimeSpan.cs
- SmiXetterAccessMap.cs
- ListViewSelectEventArgs.cs
- LOSFormatter.cs
- DataListItemCollection.cs
- X509CertificateCollection.cs
- ContentElementCollection.cs
- LOSFormatter.cs
- DeferredSelectedIndexReference.cs
- wgx_commands.cs
- TemplateBindingExtension.cs
- XPathItem.cs
- HMACSHA384.cs
- XmlCustomFormatter.cs
- SourceElementsCollection.cs
- UdpChannelFactory.cs
- TextTreeRootTextBlock.cs
- KeyboardDevice.cs
- SecurityState.cs
- CornerRadius.cs
- LoginCancelEventArgs.cs
- DataQuery.cs
- TextRangeAdaptor.cs
- HandoffBehavior.cs
- BigInt.cs
- DecoderFallback.cs
- CharEnumerator.cs
- _DigestClient.cs
- PropVariant.cs
- CharacterMetricsDictionary.cs
- Utilities.cs
- TdsParserSafeHandles.cs
- MessageSmuggler.cs
- TaskFormBase.cs
- VisualCollection.cs
- MatchSingleFxEngineOpcode.cs
- WebPartHeaderCloseVerb.cs
- FlatButtonAppearance.cs
- MsmqSecureHashAlgorithm.cs
- SafeBitVector32.cs
- ClientCredentialsElement.cs
- EventTask.cs
- XmlSchemaRedefine.cs
- Cursor.cs
- ClassicBorderDecorator.cs
- TextSimpleMarkerProperties.cs
- DbParameterHelper.cs
- XmlLoader.cs
- MatrixTransform3D.cs
- DocumentXPathNavigator.cs
- QilName.cs
- XMLUtil.cs
- ObjectNotFoundException.cs
- DbTransaction.cs
- ProviderIncompatibleException.cs
- BindingSource.cs
- Library.cs
- SingleAnimation.cs
- OdbcCommand.cs
- ListBindableAttribute.cs
- TextSimpleMarkerProperties.cs
- Path.cs
- safemediahandle.cs
- MinimizableAttributeTypeConverter.cs
- UidPropertyAttribute.cs
- OdbcDataReader.cs
- CodePageUtils.cs
- TableCell.cs
- DbBuffer.cs
- TypeSystemHelpers.cs
- ImportCatalogPart.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- DomainConstraint.cs
- ContainerActivationHelper.cs