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)) 715if (TryGetService(out ISelectionService? sel) && sel.GetComponentSelected(Control)) 957if (TryGetService(out DesignerActionService? designerActionService)) 1017if (TryGetService(out ComponentCache? cache) && component is not null) 1026if (TryGetService(out ComponentCache? cache) && component is not null) 1062if (TryGetService(out IComponentChangeService? componentChangeService)) 1072if (TryGetService(out IComponentChangeService? componentChangeService)) 1164&& TryGetService(out IDesignerHost? host)) 1325if (!_ctrlSelect && TryGetService(out ISelectionService? selectionService)) 1416if (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)
840if (!TryGetService(out IDesignerHost host)) 862if (_componentTray is null && TryGetService(out ISplitWindowService sws)) 1109if (!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(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)
1250if (TryGetService(out SelectionManager selectionManager) && ToolStrip is not null && CanAddItems && ToolStrip.Visible) 1878if (TryGetService(out IComponentChangeService changeService))
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (9)
223if (TryGetService(out SelectionManager selectionManager)) 312if (TryGetService(out BehaviorService _)) 314if (_dummyToolStripGlyph is not null && TryGetService(out SelectionManager selectionManager)) 361if (TryGetService(out _selectionService)) 395if (TryGetService(out _nestedContainer)) 405if (_undoEngine is null && TryGetService(out _undoEngine)) 424if (TryGetService(out ToolStripKeyboardHandlingService keyboardHandlingService)) 531if (TryGetService(out SelectionManager selectionManager)) 675if (TryGetService(out BehaviorService behaviorService))
System\Windows\Forms\Design\ToolStripItemDesigner.cs (19)
247if (!TryGetService(out IDesignerHost designerHost)) 340&& TryGetService(out IUIService uiService)) 458if (TryGetService(out IComponentChangeService cs)) 469if (_bodyGlyph is not null && TryGetService(out ToolStripAdornerWindowService toolStripAdornerWindowService) 502if (TryGetService(out BehaviorService b) && ImmediateParent is not null) 520if (TryGetService(out IComponentChangeService changeService) && parent.Site is not null) 542if (TryGetService(out IComponentChangeService changeService) && parent.Site is not null) 643if (TryGetService(out IComponentChangeService cs)) 648if (TryGetService(out _selectionService)) 701if (!TryGetService(out IDesignerHost host)) 741if (!TryGetService(out ComponentSerializationService serializationService)) 766if (TryGetService(out IComponentChangeService changeService)) 902&& TryGetService(out BehaviorService behaviorService)) 970if (TryGetService(out IDesignerHost designerHost) && currentSelection.Owner is ToolStripDropDown parentDropDown) 1004if (TryGetService(out BehaviorService behaviorService)) 1040if (!TryGetService(out IDesignerHost host)) 1112if (TryGetService(out ToolStripKeyboardHandlingService keyboardHandlingService)) 1289if (!TryGetService(out ToolStripKeyboardHandlingService keyboardService)) 1297if (TryGetService(out BehaviorService behaviorService))
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (4)
138if (TryGetService(out ComponentSerializationService serializationService)) 178if (TryGetService(out ComponentSerializationService serializationService)) 1482if (TryGetService(out _selectionService)) 1503if (_undoEngine is null && TryGetService(out _undoEngine))
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
428if (TryGetService(out IMenuCommandService? menuCommandService)) 445if (TryGetService(out IMenuCommandService? menuCommandService))