Snoop.SnoopUI.OnSourceInitialized C# (CSharp) Method

OnSourceInitialized() protected method

protected OnSourceInitialized ( EventArgs e ) : void
e System.EventArgs
return void
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);

            try
            {
                // load the window placement details from the user settings.
                WINDOWPLACEMENT wp = (WINDOWPLACEMENT)Properties.Settings.Default.SnoopUIWindowPlacement;
                wp.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
                wp.flags = 0;
                wp.showCmd = (wp.showCmd == Win32.SW_SHOWMINIMIZED ? Win32.SW_SHOWNORMAL : wp.showCmd);
                IntPtr hwnd = new WindowInteropHelper(this).Handle;
                Win32.SetWindowPlacement(hwnd, ref wp);

                // load whether all properties are shown by default
                this.PropertyGrid.ShowDefaults = Properties.Settings.Default.ShowDefaults;

                // load whether the previewer is shown by default
                this.PreviewArea.IsActive = Properties.Settings.Default.ShowPreviewer;
            }
            catch
            {
            }
        }