ACAT.Lib.Core.Utility.Windows.GetVisible C# (CSharp) Метод

GetVisible() публичный статический Метод

Gets the visibility of a control. This is just a helper function that takes care of cross-thread invokations that would result in .NET exceptions.
public static GetVisible ( Control control ) : bool
control System.Windows.Forms.Control
Результат bool
        public static bool GetVisible(Control control)
        {
            try
            {
                if (control.InvokeRequired)
                {
                    return (bool)control.Invoke(new getVisible(GetVisible), control);
                }

                return control.Visible;
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
                return false;
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Docks this scanner to the companian scanner
        /// </summary>
        /// <param name="scanner">companian scanner</param>
        private void dockToScanner(Form scanner)
        {
            if (!Windows.GetVisible(this))
            {
                return;
            }

            if (scanner is IScannerPanel)
            {
                if (((IPanel)scanner).PanelCommon.DisplayMode != DisplayModeTypes.Popup)
                {
                    Windows.DockWithScanner(this, scanner, Context.AppWindowPosition);
                    Windows.SetTopMost(scanner);
                }
            }

            if (Left < 0)
            {
                Left = 0;
            }
        }