80 references to TryGetService
System.Windows.Forms.Design (80)
System\ComponentModel\Design\ComponentDesigner.cs (9)
97if (TryGetService(out IInheritanceService? inheritanceService)) 196if (comps is not null && comps.Count > 0 && TryGetService(out IDesignerHost? host)) 225if (parent is not null && TryGetService(out IDesignerHost? host)) 250if (!TryGetService(out IEventBindingService? ebs) 251|| !TryGetService(out ISelectionService? selectionService)) 368return TryGetService(out IDesignerHost? host) && _component == host.RootComponent; 383bool isRoot = TryGetService(out IDesignerHost? host) && component == host.RootComponent; 390if (TryGetService(out IComponentChangeService? cs)) 456if (TryGetService(out IComponentChangeService? cs))
System\Windows\Forms\Design\BindingNavigatorDesigner.cs (3)
28if (TryGetService(out IComponentChangeService? componentChangeService)) 39if (TryGetService(out IComponentChangeService? componentChangeService)) 76if (TryGetService(out IComponentChangeService? componentChangeService))
System\Windows\Forms\Design\BindingSourceDesigner.cs (2)
22if (TryGetService(out IComponentChangeService? componentChangeService)) 33if (TryGetService(out IComponentChangeService? componentChangeService))
System\Windows\Forms\Design\ControlDesigner.cs (15)
164if ((!TryGetService(out IDesignerHost? host) || (host is not null && !host.Loading)) 375return TryGetService(out IDesignerHost? host) && Component == host.RootComponent; 421if (TryGetService(out IUIService? uis)) 465if (TryGetService(out IComponentChangeService? componentChangeService)) 554if (TryGetService(out IComponentChangeService? componentChangeService)) 584if (!TryGetService(out INestedContainer? nc)) 700if (TryGetService(out ISelectionService? sel) && sel.GetComponentSelected(Control)) 942if (TryGetService(out DesignerActionService? designerActionService)) 1002if (TryGetService(out ComponentCache? cache) && component is not null) 1011if (TryGetService(out ComponentCache? cache) && component is not null) 1047if (TryGetService(out IComponentChangeService? componentChangeService)) 1057if (TryGetService(out IComponentChangeService? componentChangeService)) 1149&& TryGetService(out IDesignerHost? host)) 1310if (!_ctrlSelect && TryGetService(out ISelectionService? selectionService)) 1401if (TryGetService(out ISelectionService? selectionService) && !Component.Equals(selectionService.PrimarySelection))
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (1)
281if (!TryGetService(out IDesignerHost? host))
System\Windows\Forms\Design\DocumentDesigner.cs (3)
879if (!TryGetService(out IDesignerHost host)) 901if (_componentTray is null && TryGetService(out ISplitWindowService sws)) 1148if (!TryGetService(out ISelectionService svc))
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
567DesignerTransaction designerTransaction = TryGetService(out IDesignerHost host)
System\Windows\Forms\Design\FormDocumentDesigner.cs (1)
363if (ce.Component is ToolStrip && _toolStripAdornerWindowService is null && TryGetService(out IDesignerHost _))
System\Windows\Forms\Design\ListBoxDesigner.cs (2)
86if (TryGetService<IComponentChangeService>(out IComponentChangeService? componentChangeService)) 111if (TryGetService(out IComponentChangeService? componentChangeService))
System\Windows\Forms\Design\SplitContainerDesigner.cs (4)
173if (TryGetService(out ISelectionService? svc)) 198if (TryGetService(out SelectionManager? selMgr)) 250if (TryGetService(out ISelectionService? svc)) 401if (!TryGetService(out ISelectionService? svc))
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
97if (TryGetService(out IComponentChangeService? cs)) 113if (TryGetService(out IComponentChangeService? cs))
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (1)
225if (!TryGetService(out SelectionManager? selectionManager))
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1267if (TryGetService(out SelectionManager selectionManager) && ToolStrip is not null && CanAddItems && ToolStrip.Visible) 1856if (TryGetService(out IComponentChangeService changeService))
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (9)
223if (TryGetService(out SelectionManager selectionManager)) 318if (TryGetService(out BehaviorService _)) 320if (_dummyToolStripGlyph is not null && TryGetService(out SelectionManager selectionManager)) 367if (TryGetService(out _selectionService)) 401if (TryGetService(out _nestedContainer)) 411if (_undoEngine is null && TryGetService(out _undoEngine)) 430if (TryGetService(out ToolStripKeyboardHandlingService keyboardHandlingService)) 537if (TryGetService(out SelectionManager selectionManager)) 681if (TryGetService(out BehaviorService behaviorService))
System\Windows\Forms\Design\ToolStripItemDesigner.cs (19)
247if (!TryGetService(out IDesignerHost designerHost)) 340&& TryGetService(out IUIService uiService)) 470if (TryGetService(out IComponentChangeService cs)) 481if (_bodyGlyph is not null && TryGetService(out ToolStripAdornerWindowService toolStripAdornerWindowService) 514if (TryGetService(out BehaviorService b) && ImmediateParent is not null) 532if (TryGetService(out IComponentChangeService changeService) && parent.Site is not null) 554if (TryGetService(out IComponentChangeService changeService) && parent.Site is not null) 658if (TryGetService(out IComponentChangeService cs)) 663if (TryGetService(out _selectionService)) 716if (!TryGetService(out IDesignerHost host)) 756if (!TryGetService(out ComponentSerializationService serializationService)) 781if (TryGetService(out IComponentChangeService changeService)) 920&& TryGetService(out BehaviorService behaviorService)) 988if (TryGetService(out IDesignerHost designerHost) && currentSelection.Owner is ToolStripDropDown parentDropDown) 1022if (TryGetService(out BehaviorService behaviorService)) 1058if (!TryGetService(out IDesignerHost host)) 1130if (TryGetService(out ToolStripKeyboardHandlingService keyboardHandlingService)) 1307if (!TryGetService(out ToolStripKeyboardHandlingService keyboardService)) 1315if (TryGetService(out BehaviorService behaviorService))
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (4)
138if (TryGetService(out ComponentSerializationService serializationService)) 178if (TryGetService(out ComponentSerializationService serializationService)) 1512if (TryGetService(out _selectionService)) 1533if (_undoEngine is null && TryGetService(out _undoEngine))
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
434if (TryGetService(out IMenuCommandService? menuCommandService)) 451if (TryGetService(out IMenuCommandService? menuCommandService))