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
- TagMapCollection.cs
- FontStretchConverter.cs
- ObjectConverter.cs
- ExtendedProtectionPolicy.cs
- HostedTransportConfigurationManager.cs
- MouseCaptureWithinProperty.cs
- CompilerError.cs
- StaticResourceExtension.cs
- DocumentViewerAutomationPeer.cs
- ConfigsHelper.cs
- FormViewPagerRow.cs
- Certificate.cs
- ContractNamespaceAttribute.cs
- DictionaryContent.cs
- FillErrorEventArgs.cs
- ToolStripScrollButton.cs
- Brush.cs
- BooleanKeyFrameCollection.cs
- RenamedEventArgs.cs
- Renderer.cs
- IxmlLineInfo.cs
- control.ime.cs
- DependencyPropertyAttribute.cs
- DataBoundControlAdapter.cs
- OdbcRowUpdatingEvent.cs
- ProfileSettings.cs
- OdbcParameterCollection.cs
- WebControlParameterProxy.cs
- DataGridTextBox.cs
- EmbeddedMailObjectsCollection.cs
- SystemIPInterfaceProperties.cs
- Transform3D.cs
- Transform3D.cs
- PassportPrincipal.cs
- ObjectViewEntityCollectionData.cs
- SafeBuffer.cs
- SqlExpander.cs
- TextParaLineResult.cs
- NativeRightsManagementAPIsStructures.cs
- TextRangeAdaptor.cs
- Axis.cs
- WindowsScrollBar.cs
- TCPClient.cs
- EventRouteFactory.cs
- DataGridViewComboBoxColumnDesigner.cs
- SchemaObjectWriter.cs
- MatrixUtil.cs
- ReadOnlyCollection.cs
- XmlSchemaSimpleContentExtension.cs
- DLinqDataModelProvider.cs
- WhiteSpaceTrimStringConverter.cs
- DataGridRowHeader.cs
- XhtmlBasicLabelAdapter.cs
- ConnectionManagementElementCollection.cs
- Metadata.cs
- RootDesignerSerializerAttribute.cs
- DatePicker.cs
- VSWCFServiceContractGenerator.cs
- Point3DKeyFrameCollection.cs
- Quad.cs
- PrimitiveType.cs
- SoapEnvelopeProcessingElement.cs
- NotCondition.cs
- HttpCookiesSection.cs
- PackagingUtilities.cs
- ToolBarButtonClickEvent.cs
- OrderByBuilder.cs
- RenamedEventArgs.cs
- GetFileNameResult.cs
- ScaleTransform.cs
- DBSqlParserColumn.cs
- Hashtable.cs
- FusionWrap.cs
- FontSizeConverter.cs
- ISFClipboardData.cs
- TemplatedMailWebEventProvider.cs
- CloseCryptoHandleRequest.cs
- EventLevel.cs
- ConsoleEntryPoint.cs
- SqlConnectionPoolProviderInfo.cs
- KnownBoxes.cs
- Bitmap.cs
- MaterialCollection.cs
- Event.cs
- ByteRangeDownloader.cs
- CodeExpressionStatement.cs
- MarshalByValueComponent.cs
- StackBuilderSink.cs
- XmlException.cs
- Mapping.cs
- Interop.cs
- InputScopeManager.cs
- TextAction.cs
- TransformerInfo.cs
- ObjectItemCollection.cs
- MetadataItemSerializer.cs
- RelatedImageListAttribute.cs
- TypeInformation.cs
- SecureEnvironment.cs
- OutputCacheSection.cs