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
- ForwardPositionQuery.cs
- DropShadowEffect.cs
- DisplayNameAttribute.cs
- SafeFileMappingHandle.cs
- AspCompat.cs
- ControlUtil.cs
- MouseGestureValueSerializer.cs
- TextTreeTextElementNode.cs
- Geometry.cs
- TimeSpanOrInfiniteConverter.cs
- ConstraintEnumerator.cs
- SwitchLevelAttribute.cs
- OlePropertyStructs.cs
- ByteViewer.cs
- BmpBitmapEncoder.cs
- OleDbConnection.cs
- WorkflowValidationFailedException.cs
- AttachedPropertyMethodSelector.cs
- SqlDataAdapter.cs
- OlePropertyStructs.cs
- QilCloneVisitor.cs
- AlphaSortedEnumConverter.cs
- DiagnosticTrace.cs
- XmlSchemaDocumentation.cs
- LocalizableResourceBuilder.cs
- SafeLibraryHandle.cs
- WebControlsSection.cs
- CharacterBuffer.cs
- OpacityConverter.cs
- SystemFonts.cs
- ChannelBinding.cs
- ControlType.cs
- ObjectMaterializedEventArgs.cs
- BaseAddressPrefixFilterElement.cs
- LicenseException.cs
- ServiceActivationException.cs
- XmlNodeWriter.cs
- StringUtil.cs
- NameSpaceExtractor.cs
- DataContractAttribute.cs
- FormView.cs
- AspNetCompatibilityRequirementsAttribute.cs
- XmlWhitespace.cs
- DoubleCollection.cs
- XamlBuildTaskServices.cs
- InternalTypeHelper.cs
- UniqueID.cs
- CodeAttributeArgument.cs
- SafeBitVector32.cs
- ActivityBuilder.cs
- DataServiceRequestOfT.cs
- DataRow.cs
- CheckedListBox.cs
- UpdatePanel.cs
- AssemblyCollection.cs
- CachedRequestParams.cs
- EventSource.cs
- ProjectionPruner.cs
- CompiledQueryCacheKey.cs
- PointConverter.cs
- TaiwanLunisolarCalendar.cs
- ImageListDesigner.cs
- COM2Enum.cs
- ExceptionCollection.cs
- HtmlElement.cs
- SortKey.cs
- XmlSchema.cs
- CapabilitiesUse.cs
- WindowsTitleBar.cs
- FragmentQuery.cs
- IconBitmapDecoder.cs
- CodeCommentStatement.cs
- InputMethodStateChangeEventArgs.cs
- ConstantCheck.cs
- LifetimeMonitor.cs
- HandledMouseEvent.cs
- DocumentGridPage.cs
- CopyAction.cs
- MruCache.cs
- ForEachAction.cs
- StylusPlugInCollection.cs
- BitConverter.cs
- XmlSchemaAttributeGroupRef.cs
- BindingListCollectionView.cs
- UdpTransportSettings.cs
- TextBox.cs
- RecognizerStateChangedEventArgs.cs
- DbProviderConfigurationHandler.cs
- DBSchemaTable.cs
- SafePointer.cs
- PagesChangedEventArgs.cs
- HttpListenerContext.cs
- SafeEventLogReadHandle.cs
- TextElementCollection.cs
- ProtectedProviderSettings.cs
- TreeViewItem.cs
- AnnouncementEventArgs.cs
- MultiBinding.cs
- CompositeCollectionView.cs
- TextEditorContextMenu.cs