ComProxy IProxyCreator.CreateProxy(IntPtr outer, ref Guid riid)
 {
     if ((riid != typeof(IMoniker).GUID) && (riid != typeof(IParseDisplayName).GUID))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCastException(System.ServiceModel.SR.GetString("NoInterface", new object[] { (Guid)riid })));
     }
     if (outer == IntPtr.Zero)
     {
         throw Fx.AssertAndThrow("OuterProxy cannot be null");
     }
     if (this.comProxy == null)
     {
         ServiceMonikerInternal internal2 = null;
         try
         {
             internal2     = new ServiceMonikerInternal();
             this.comProxy = ComProxy.Create(outer, internal2, internal2);
             return(this.comProxy);
         }
         finally
         {
             if ((this.comProxy == null) && (internal2 != null))
             {
                 ((IDisposable)internal2).Dispose();
             }
         }
     }
     return(this.comProxy.Clone());
 }
 ComProxy IProxyCreator.CreateProxy(IntPtr outer, ref Guid riid)
 {
     if ((riid != typeof(IMoniker).GUID) && (riid != typeof(IParseDisplayName).GUID))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidCastException(System.ServiceModel.SR.GetString("NoInterface", new object[] { (Guid) riid })));
     }
     if (outer == IntPtr.Zero)
     {
         throw Fx.AssertAndThrow("OuterProxy cannot be null");
     }
     if (this.comProxy == null)
     {
         ServiceMonikerInternal internal2 = null;
         try
         {
             internal2 = new ServiceMonikerInternal();
             this.comProxy = ComProxy.Create(outer, internal2, internal2);
             return this.comProxy;
         }
         finally
         {
             if ((this.comProxy == null) && (internal2 != null))
             {
                 ((IDisposable) internal2).Dispose();
             }
         }
     }
     return this.comProxy.Clone();
 }
        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)
            {
                throw Fx.AssertAndThrow("OuterProxy cannot be null");
            }

            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();
        }
示例#4
0
        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)
            {
                throw Fx.AssertAndThrow("OuterProxy cannot be null");
            }

            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());
            }
        }