Beispiel #1
0
        private static void CloseSharedResources()
        {
            if (connection != null)
            {
                lock (InternalSyncObject) {
                    if (connection != null)
                    {
                        TraceMethod method = Tracing.On ? new TraceMethod(typeof(RemoteDebugger), "CloseSharedResources") : null;
                        if (Tracing.On)
                        {
                            Tracing.Enter("RemoteDebugger", method);
                        }

                        try {
                            Marshal.ReleaseComObject(connection);
                        }
                        catch (Exception e) {
                            if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
                            {
                                throw;
                            }
                            if (Tracing.On)
                            {
                                Tracing.ExceptionCatch(TraceEventType.Warning, typeof(RemoteDebugger), "CloseSharedResources", e);
                            }
                        }
                        if (Tracing.On)
                        {
                            Tracing.Exit("RemoteDebugger", method);
                        }
                        connection = null;
                    }
                }
            }
        }
 internal static void CloseSharedResources()
 {
     if (connection != null)
     {
         lock (typeof(RemoteDebugger)) {
             if (connection != null)
             {
                 try {
                     Marshal.ReleaseComObject(connection);
                 }
                 catch (Exception) {
                 }
                 connection = null;
             }
         }
     }
 }
 internal static void UnregisterNotifySource(INotifyConnection2 connection, INotifySource2 source)
 {
     connection.UnregisterNotifySource(source);
 }
 internal static INotifySink2 RegisterNotifySource(INotifyConnection2 connection, INotifySource2 source)
 {
     return(connection.RegisterNotifySource(source));
 }
        private static void CloseSharedResources() {
            if (connection != null) {
                lock (InternalSyncObject) {
                    if (connection != null) {
                        TraceMethod method = Tracing.On ? new TraceMethod(typeof(RemoteDebugger), "CloseSharedResources") : null;
                        if (Tracing.On) Tracing.Enter("RemoteDebugger", method);

                        try {
                            Marshal.ReleaseComObject(connection);
                        }
                        catch (Exception e) {
                            if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException) {
                                throw;
                            }
                            if (Tracing.On) Tracing.ExceptionCatch(TraceEventType.Warning, typeof(RemoteDebugger), "CloseSharedResources", e);
                        }
                        if (Tracing.On) Tracing.Exit("RemoteDebugger", method);
                        connection = null;
                    }
                }
            }
        }
 internal static void UnregisterNotifySource(INotifyConnection2 connection, INotifySource2 source) {
     connection.UnregisterNotifySource(source);
 }   
 internal static INotifySink2 RegisterNotifySource(INotifyConnection2 connection, INotifySource2 source) {
     return connection.RegisterNotifySource(source);
 }