예제 #1
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                ThreadStart method = delegate()
                {
                    DdemlObject.Dispose();
                };

                try 
                {
                    Invoke(method);

                    // Dispose the synchronizer if it was created internally.
                    DdeThread synchronizer = Synchronizer as DdeThread;
                    if (synchronizer != null)
                    {
                        synchronizer.Dispose();
                    }
                }
                catch
                {
                    // Swallow any exception that occurs.
                }
            }
        }
예제 #2
0
        /// <summary>
        ///     This contains the implementation to release all resources held by this instance.
        /// </summary>
        /// <param name="disposing">
        ///     True if called by Dispose, false otherwise.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                ThreadStart method = delegate { DdemlObject.Dispose(); };

                try
                {
                    Context.Invoke(method);
                }
                catch
                {
                    // Swallow any exception that occurs.
                }
            }
        }