Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / ComIntegration / MonikerBuilder.cs / 1 / MonikerBuilder.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.ComIntegration { using System; using System.Reflection; using System.Collections.Generic; using System.Threading; using System.ServiceModel.Channels; using System.Runtime.Remoting.Proxies; using System.Runtime.Remoting; using System.Runtime.Remoting.Services; using System.Runtime.InteropServices; internal class MonikerBuilder : IProxyCreator { ComProxy comProxy = null; private MonikerBuilder () { } void IDisposable.Dispose () { } ComProxy IProxyCreator.CreateProxy (IntPtr outer, ref Guid riid) { if ((riid != typeof (IMoniker).GUID) && (riid != typeof (IParseDisplayName).GUID)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCastException(SR.GetString(SR.NoInterface, riid))); if (outer == IntPtr.Zero) { DiagnosticUtility.DebugAssert("OuterProxy cannot be null"); throw DiagnosticUtility.ExceptionUtility.ThrowHelperInternal(false); } if (comProxy == null) { ServiceMonikerInternal moniker = null; try { moniker = new ServiceMonikerInternal (); comProxy = ComProxy.Create (outer, moniker, moniker); return comProxy; } finally { if ((comProxy == null) && (moniker != null)) ((IDisposable)moniker).Dispose (); } } else return comProxy.Clone (); } bool IProxyCreator.SupportsErrorInfo (ref Guid riid) { if ((riid != typeof (IMoniker).GUID) && (riid != typeof (IParseDisplayName).GUID)) return false; else return true; } bool IProxyCreator.SupportsDispatch () { return false; } bool IProxyCreator.SupportsIntrinsics () { return false; } public static MarshalByRefObject CreateMonikerInstance () { IProxyCreator serviceChannelBuilder = new MonikerBuilder ();; IProxyManager proxyManager = new ProxyManager (serviceChannelBuilder); Guid iid = typeof (IMoniker).GUID; IntPtr ppv = OuterProxyWrapper.CreateOuterProxyInstance (proxyManager, ref iid); MarshalByRefObject ret = EnterpriseServicesHelper.WrapIUnknownWithComObject (ppv) as MarshalByRefObject; Marshal.Release(ppv); return ret; } } } // 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
- StylusDownEventArgs.cs
- TemplateModeChangedEventArgs.cs
- Figure.cs
- XmlSignatureProperties.cs
- CultureNotFoundException.cs
- CombinedGeometry.cs
- TdsParser.cs
- InputLanguageCollection.cs
- DiscoveryInnerClientManaged11.cs
- SymbolPair.cs
- RegexGroup.cs
- MinimizableAttributeTypeConverter.cs
- TypedTableBase.cs
- Trace.cs
- ConfigXmlText.cs
- EdmItemCollection.OcAssemblyCache.cs
- HtmlInputPassword.cs
- OdbcConnectionOpen.cs
- HttpDebugHandler.cs
- DbConnectionPoolGroup.cs
- MediaContext.cs
- DrawingContextDrawingContextWalker.cs
- ConstraintEnumerator.cs
- UserUseLicenseDictionaryLoader.cs
- Walker.cs
- ProxyWebPartManager.cs
- Encoder.cs
- SerializationStore.cs
- AppDomainUnloadedException.cs
- SqlTransaction.cs
- XmlSchemaSimpleContentRestriction.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- HttpModule.cs
- infer.cs
- ProfileManager.cs
- SizeAnimationUsingKeyFrames.cs
- DesignerExtenders.cs
- PostBackOptions.cs
- ListBase.cs
- PagesSection.cs
- TimerEventSubscription.cs
- GenericTypeParameterBuilder.cs
- DataViewManagerListItemTypeDescriptor.cs
- WebPartDeleteVerb.cs
- UIElementAutomationPeer.cs
- TCPClient.cs
- CheckBox.cs
- ColorBuilder.cs
- ControlsConfig.cs
- SqlParameter.cs
- BitSet.cs
- XmlSiteMapProvider.cs
- AttributeEmitter.cs
- DataTableCollection.cs
- ListViewItemSelectionChangedEvent.cs
- EditorPartChrome.cs
- Error.cs
- Int32AnimationBase.cs
- SymDocumentType.cs
- TypeBinaryExpression.cs
- DataAdapter.cs
- ProcessHostFactoryHelper.cs
- GroupBoxAutomationPeer.cs
- Int16Converter.cs
- ellipse.cs
- OdbcConnectionHandle.cs
- SmiRecordBuffer.cs
- ButtonRenderer.cs
- ActivationService.cs
- Int32AnimationBase.cs
- XmlSchemas.cs
- StrokeNodeOperations.cs
- FrameworkElementFactory.cs
- SemanticTag.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- IdentityNotMappedException.cs
- DataListCommandEventArgs.cs
- ListSortDescription.cs
- BaseValidator.cs
- CompatibleComparer.cs
- XmlCDATASection.cs
- WriterOutput.cs
- Matrix3DConverter.cs
- EdmProperty.cs
- DropShadowBitmapEffect.cs
- DuplicateWaitObjectException.cs
- RectangleGeometry.cs
- ResourceBinder.cs
- SponsorHelper.cs
- OutputCacheSettings.cs
- UpdateManifestForBrowserApplication.cs
- Cloud.cs
- AppDomainUnloadedException.cs
- PreloadedPackages.cs
- DataGridItem.cs
- FileSystemInfo.cs
- AppDomainUnloadedException.cs
- AppDomainFactory.cs
- InvokeMemberBinder.cs
- WaitHandle.cs