Exemplo n.º 1
0
        public static void Show(ManagementBaseObject managementObject)
        {
            ManagementObjectInspectorForm form = new ManagementObjectInspectorForm();

            form.ManagementObject = managementObject;
            form.Show();
        }
 public static void Show(ManagementBaseObject managementObject)
 {
     ManagementObjectInspectorForm form = new ManagementObjectInspectorForm();
     form.ManagementObject = managementObject;
     form.Show();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Shows the object inspector window for the specified ManagementBaseObject.
        /// </summary>
        /// <param name="managementObject">The ManagementBaseObject to be inspected.</param>
        /// <param name="location">The location (relative to the screen) to display the window.</param>
        private void ShowInspector(ManagementBaseObject managementObject, Point location)
        {
            this.gridQueryResults.Cursor = Cursors.WaitCursor;

            // Create form
            ManagementObjectInspectorForm popup = new ManagementObjectInspectorForm();
            popup.ShowMappedValues = this.showMappedValues;
            popup.Scope = this.CurrentNamespaceScope;
            popup.ManagementClass = this.queryBroker.ResultClass;
            popup.ManagementObject = managementObject;

            // Offset location to screen bounds
            Rectangle bounds = Screen.FromControl(this).WorkingArea;
            location.X = Math.Min(location.X, bounds.Width - popup.Width);
            location.Y = Math.Min(location.Y, bounds.Height - popup.Height);
            popup.Location = location;

            // Show
            this.gridQueryResults.Cursor = Cursors.Default;
            popup.Show(this);
        }