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
- Misc.cs
- DataGridViewRowCollection.cs
- Expression.cs
- NotImplementedException.cs
- MouseActionConverter.cs
- ListItemCollection.cs
- SpeechRecognizer.cs
- ToolZone.cs
- BitmapMetadataEnumerator.cs
- VisualStyleTypesAndProperties.cs
- FileChangesMonitor.cs
- Switch.cs
- XPathNodePointer.cs
- DurableEnlistmentState.cs
- LabelDesigner.cs
- WorkflowTerminatedException.cs
- ResourceReferenceKeyNotFoundException.cs
- SerializableTypeCodeDomSerializer.cs
- WebZone.cs
- LightweightCodeGenerator.cs
- TextFindEngine.cs
- OleDbReferenceCollection.cs
- FormatControl.cs
- ComponentEditorPage.cs
- IEnumerable.cs
- SrgsDocumentParser.cs
- JsonWriter.cs
- AppliedDeviceFiltersEditor.cs
- NamedElement.cs
- MemberAssignmentAnalysis.cs
- SafeSerializationManager.cs
- StylusPointPropertyInfoDefaults.cs
- __Filters.cs
- NativeMethods.cs
- LinqDataSourceUpdateEventArgs.cs
- SqlMetaData.cs
- GestureRecognizer.cs
- SamlConditions.cs
- Rectangle.cs
- SqlDataSourceQueryEditor.cs
- WindowsPen.cs
- OdbcParameterCollection.cs
- TraceHandler.cs
- CommandTreeTypeHelper.cs
- DynamicUpdateCommand.cs
- CustomAttributeBuilder.cs
- TextRange.cs
- ReadContentAsBinaryHelper.cs
- InternalEnumValidatorAttribute.cs
- NetworkStream.cs
- BaseProcessor.cs
- RuntimeHelpers.cs
- StrongNameHelpers.cs
- WorkflowRuntimeEndpoint.cs
- ProfileGroupSettings.cs
- NonBatchDirectoryCompiler.cs
- SelectionWordBreaker.cs
- DataGridViewRowPostPaintEventArgs.cs
- MetadataArtifactLoaderComposite.cs
- AppDomainUnloadedException.cs
- XmlILConstructAnalyzer.cs
- CaseInsensitiveOrdinalStringComparer.cs
- XmlName.cs
- TriggerActionCollection.cs
- WpfPayload.cs
- TextParaClient.cs
- TextRangeSerialization.cs
- GradientBrush.cs
- XdrBuilder.cs
- RouteTable.cs
- XD.cs
- DictionaryContent.cs
- BrowserInteropHelper.cs
- PersonalizationState.cs
- XmlElementAttribute.cs
- SqlUnionizer.cs
- DataGridToolTip.cs
- InkPresenterAutomationPeer.cs
- Script.cs
- EmissiveMaterial.cs
- LicenseProviderAttribute.cs
- ObjectNotFoundException.cs
- XhtmlBasicListAdapter.cs
- TreeViewHitTestInfo.cs
- FieldAccessException.cs
- IntegrationExceptionEventArgs.cs
- SqlWebEventProvider.cs
- TextTreeRootTextBlock.cs
- XmlEventCache.cs
- OracleMonthSpan.cs
- OdbcEnvironmentHandle.cs
- StrongNameUtility.cs
- StringAnimationUsingKeyFrames.cs
- XmlKeywords.cs
- ToolStripGripRenderEventArgs.cs
- XmlTextAttribute.cs
- VisualStyleElement.cs
- XPathConvert.cs
- TextServicesLoader.cs
- XmlLinkedNode.cs