Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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, Collection warnings) { 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
- GridEntry.cs
- PartialClassGenerationTask.cs
- ToolStripKeyboardHandlingService.cs
- MarshalDirectiveException.cs
- TraceContext.cs
- AssemblyInfo.cs
- XmlnsDefinitionAttribute.cs
- RegexGroup.cs
- EntityDataSourceView.cs
- BufferBuilder.cs
- SchemaManager.cs
- _LocalDataStoreMgr.cs
- SystemParameters.cs
- LinkLabel.cs
- BindingCollection.cs
- SinglePageViewer.cs
- CommandSet.cs
- ColorConverter.cs
- SafeEventHandle.cs
- JsonReaderWriterFactory.cs
- OdbcError.cs
- DataListCommandEventArgs.cs
- ArithmeticException.cs
- FrameworkElement.cs
- MailAddressCollection.cs
- ToolBarOverflowPanel.cs
- QueryResult.cs
- HMACMD5.cs
- ServicePointManager.cs
- FileChangesMonitor.cs
- ClosureBinding.cs
- RoleService.cs
- FrameworkTextComposition.cs
- TextProviderWrapper.cs
- VerificationException.cs
- TextBreakpoint.cs
- ToggleButton.cs
- GeneralTransform3DTo2DTo3D.cs
- FigureParagraph.cs
- LightweightCodeGenerator.cs
- PreviewPrintController.cs
- MetadataUtil.cs
- SolidColorBrush.cs
- GeneralTransform2DTo3D.cs
- GridViewPageEventArgs.cs
- Converter.cs
- FloaterParaClient.cs
- NumberFormatInfo.cs
- EFTableProvider.cs
- DataGridViewBand.cs
- WSHttpSecurity.cs
- SoapFault.cs
- XmlElement.cs
- ContentType.cs
- SystemIPv4InterfaceProperties.cs
- QilTernary.cs
- SearchForVirtualItemEventArgs.cs
- RadioButtonStandardAdapter.cs
- EpmCustomContentSerializer.cs
- UpdateProgress.cs
- TypeToken.cs
- MultipartIdentifier.cs
- TextSyndicationContentKindHelper.cs
- WebBrowserNavigatedEventHandler.cs
- TypeViewSchema.cs
- WsdlInspector.cs
- DynamicPropertyHolder.cs
- Error.cs
- GenericWebPart.cs
- BasicExpandProvider.cs
- SemanticTag.cs
- TrackingMemoryStream.cs
- ResXFileRef.cs
- XmlReflectionImporter.cs
- SystemIPInterfaceStatistics.cs
- StreamBodyWriter.cs
- AnnotationStore.cs
- SignedPkcs7.cs
- CodeCommentStatementCollection.cs
- ColumnBinding.cs
- CqlBlock.cs
- MemberNameValidator.cs
- FixedSOMContainer.cs
- GrammarBuilderRuleRef.cs
- TraceUtility.cs
- ManualResetEvent.cs
- CheckBox.cs
- OutOfMemoryException.cs
- HttpCacheParams.cs
- Listbox.cs
- FixedDocument.cs
- BuildResult.cs
- OutputWindow.cs
- FileDialog.cs
- ExpressionReplacer.cs
- FileNotFoundException.cs
- ObjectQueryExecutionPlan.cs
- DeclaredTypeValidator.cs
- MetadataArtifactLoaderResource.cs
- CultureInfo.cs