Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / ComIntegration / ComPlusTypeValidator.cs / 1 / ComPlusTypeValidator.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.ComIntegration { using System; using System.Reflection; using System.EnterpriseServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.ServiceModel; static class ComPlusTypeValidator { static Guid IID_Object = new Guid("{65074F7F-63C0-304E-AF0A-D51741CB4A8D}"); static Guid IID_IDisposable = new Guid("{805D7A98-D4AF-3F0F-967F-E5CF45312D2C}"); static Guid IID_IManagedObject = new Guid("{C3FCC19E-A970-11D2-8B5A-00A0C9B7C9C4}"); static Guid IID_IProcessInitializer = new Guid("{1113F52D-DC7F-4943-AED6-88D04027E32A}"); static Guid IID_IRemoteDispatch = new Guid("{6619A740-8154-43BE-A186-0319578E02DB}"); static Guid IID_IServicedComponentInfo = new Guid("{8165B19E-8D3A-4D0B-80C8-97DE310DB583}"); public static bool IsValidInterface(Guid iid) { if (iid == IID_Object || iid == IID_IDisposable || iid == IID_IManagedObject || iid == IID_IProcessInitializer || iid == IID_IRemoteDispatch || iid == IID_IServicedComponentInfo || iid.ToString("D").EndsWith("C000-000000000046", StringComparison.OrdinalIgnoreCase)) //other ole/com standard interfaces { return false; } return true; } public static bool IsValidParameter(Type type, ICustomAttributeProvider attributeProvider, bool allowReferences) { object[] attributes = System.ServiceModel.Description.ServiceReflector.GetCustomAttributes(attributeProvider, typeof(MarshalAsAttribute), true); foreach (MarshalAsAttribute attr in attributes) { UnmanagedType marshalAs = attr.Value; if (marshalAs == UnmanagedType.IDispatch || marshalAs == UnmanagedType.Interface || marshalAs == UnmanagedType.IUnknown) { return allowReferences; } } XsdDataContractExporter exporter = new XsdDataContractExporter(); if (!exporter.CanExport(type)) { return false; } return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DeclaredTypeElementCollection.cs
- RestHandlerFactory.cs
- PersonalizationStateInfoCollection.cs
- Component.cs
- ExpressionList.cs
- DefaultBindingPropertyAttribute.cs
- DodSequenceMerge.cs
- InputBuffer.cs
- PersonalizationProviderHelper.cs
- CodeDesigner.cs
- AsyncCompletedEventArgs.cs
- Socket.cs
- SamlConstants.cs
- BuildManagerHost.cs
- JsonServiceDocumentSerializer.cs
- TagNameToTypeMapper.cs
- DbConnectionClosed.cs
- ObjectStateManagerMetadata.cs
- DynamicScriptObject.cs
- MeasurementDCInfo.cs
- DataControlButton.cs
- Size3D.cs
- HtmlTable.cs
- LinqDataSourceSelectEventArgs.cs
- RegionIterator.cs
- MimeReturn.cs
- HatchBrush.cs
- SyntaxCheck.cs
- CfgArc.cs
- WindowsListViewScroll.cs
- GraphicsContainer.cs
- manifestimages.cs
- SQLSingle.cs
- LocatorPartList.cs
- PeerPresenceInfo.cs
- TokenBasedSetEnumerator.cs
- ButtonBase.cs
- Profiler.cs
- COM2Enum.cs
- PreviewPageInfo.cs
- DbParameterCollectionHelper.cs
- BindingEntityInfo.cs
- DBParameter.cs
- GetCertificateRequest.cs
- AppSettingsExpressionBuilder.cs
- AssemblyHash.cs
- FileRecordSequenceCompletedAsyncResult.cs
- PathTooLongException.cs
- XslTransform.cs
- Style.cs
- DataObjectMethodAttribute.cs
- ResourceReferenceExpression.cs
- RoleManagerModule.cs
- EntityViewGenerator.cs
- PlainXmlDeserializer.cs
- BufferedStream.cs
- ToolTipService.cs
- precedingquery.cs
- HttpRuntime.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- MultiBinding.cs
- ExponentialEase.cs
- TreeViewItem.cs
- BinaryConverter.cs
- FontFamily.cs
- xsdvalidator.cs
- CodeObject.cs
- TextStore.cs
- NavigationCommands.cs
- Table.cs
- CheckBoxRenderer.cs
- NamespaceExpr.cs
- HttpPostServerProtocol.cs
- ItemChangedEventArgs.cs
- XmlValidatingReaderImpl.cs
- TabletCollection.cs
- Win32Exception.cs
- ErrorRuntimeConfig.cs
- ServiceInstallComponent.cs
- OdbcException.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- WebSysDisplayNameAttribute.cs
- RootProfilePropertySettingsCollection.cs
- ExecutionEngineException.cs
- GridLength.cs
- comcontractssection.cs
- SafeFileMappingHandle.cs
- ResourcePermissionBaseEntry.cs
- DrawingDrawingContext.cs
- MemoryMappedView.cs
- DefaultAssemblyResolver.cs
- FlowNode.cs
- HandleCollector.cs
- RequestSecurityToken.cs
- FileIOPermission.cs
- PassportIdentity.cs
- Variable.cs
- SecurityUtils.cs
- ParallelTimeline.cs
- KerberosSecurityTokenAuthenticator.cs