Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void
예제 #1
0
        /// <summary>Gets the IWin32 window.</summary>
        /// <param name="visual">The visual object.</param>
        /// <returns>The Win32 Window.</returns>
        internal static IWin32Window GetIWin32Window(this Visual visual)
        {
            var source = PresentationSource.FromVisual(visual) as HwndSource;

            if (source != null)
            {
                var         win    = new Win32Window(source.Handle);
                Win32Window window = win;
                win.Dispose();
                return(window);
            }

            return(null);
        }
예제 #2
0
        /// <summary>Gets the IWin32 window.</summary>
        /// <param name="visual">The visual object.</param>
        /// <returns>The Win32 Window.</returns>
        internal static IWin32Window GetIWin32Window(this Visual visual)
        {
            var source = PresentationSource.FromVisual(visual) as HwndSource;
            if (source != null)
            {
                var win = new Win32Window(source.Handle);
                Win32Window window = win;
                win.Dispose();
                return window;
            }

            return null;
        }