254 references to TryGetTarget
Aspire.Hosting.Analyzers (1)
Infrastructure\BoundedCacheWithFactory.cs (1)
35if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Client.TypedClient.IntegrationTests (1)
TypedProxyTests.4.0.0.cs (1)
617Assert.False(opContextReference.TryGetTarget(out OperationContextExtension opContext), "OperationContextExtension should have been collected");
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.AspNetCore.App.Analyzers (1)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
38if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.AspNetCore.Cryptography.Internal (1)
WeakReferenceHelpers.cs (1)
24if (weakReference!.TryGetTarget(out var existingTarget))
Microsoft.AspNetCore.Cryptography.Internal.Tests (3)
WeakReferenceHelpersTests.cs (3)
25Assert.True(wr.TryGetTarget(out var target)); 43Assert.True(wr.TryGetTarget(out var target)); 67Assert.True(wr.TryGetTarget(out var target));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
38if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.AspNetCore.Http.ValidationsGenerator (1)
src\Shared\RoslynUtils\BoundedCacheWithFactory.cs (1)
38if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\Infrastructure\ConnectionReference.cs (1)
28return _weakReference.TryGetTarget(out connection);
Internal\Infrastructure\KestrelEventSource.cs (2)
269if (!weakReference.TryGetTarget(out var target) || ReferenceEquals(target, options)) 366if (!weakReference.TryGetTarget(out var target))
Microsoft.AspNetCore.SignalR.Client.Core (1)
src\SignalR\common\Shared\TimerAwaitable.cs (1)
51if (weakRef.TryGetTarget(out var thisRef))
Microsoft.Build (6)
Collections\WeakValueDictionary.cs (5)
68if (pair.Value?.TryGetTarget(out _) ?? false) 98if (!wrappedValue.TryGetTarget(out V value)) 174if (!wrappedValue.TryGetTarget(out value)) 210if (!entry.Value.TryGetTarget(out _)) 246else if (kvp.Value.TryGetTarget(out V target))
Definition\Project.cs (1)
4352if (s_typicalTargetsCollection.TryGetTarget(out RetrievableEntryHashSet<ProjectTargetInstance> candidate) && candidate.EntriesAreReferenceEquals(Targets))
Microsoft.Build.Engine.OM.UnitTests (2)
ObjectModelRemoting\RemoteProjectsProviderMock\LinkedObjectsMap.cs (2)
26if (h.IsValid && h.RemoterWeak.TryGetTarget(out var result)) 75if (holder.RemoterWeak.TryGetTarget(out result))
Microsoft.CodeAnalysis (14)
ConstantValueSpecialized.cs (1)
177if (_constantValueReference?.TryGetTarget(out constantValue) != true)
InternalUtilities\WeakList.cs (3)
34if (!_items[i].TryGetTarget(out _)) 113if (item.TryGetTarget(out _)) 188if (_weakList._items[currentIndex].TryGetTarget(out var item))
InternalUtilities\WeakReferenceExtensions.cs (2)
14reference.TryGetTarget(out var target); 20return !reference.TryGetTarget(out _);
Syntax\SyntaxList.SeparatedWithManyWeakChildren.cs (1)
44weak.TryGetTarget(out result);
Syntax\SyntaxList.WithManyWeakChildren.cs (1)
53_children[index].Value?.TryGetTarget(out value);
Syntax\SyntaxNode.cs (2)
254if (slot?.TryGetTarget(out value) == true) 273if (previousWeakReference?.TryGetTarget(out previousNode) == true)
Text\ChangedText.cs (4)
85if (info.WeakOldText.TryGetTarget(out tmp)) 183if (_info.WeakOldText.TryGetTarget(out actualOldText) && actualOldText == oldText) 214if (info.WeakOldText.TryGetTarget(out text) && text == oldText) 233change.WeakOldText.TryGetTarget(out actualOldText);
Microsoft.CodeAnalysis.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.CodeAnalysis.CodeStyle (3)
src\Compilers\Core\Portable\InternalUtilities\WeakReferenceExtensions.cs (2)
14reference.TryGetTarget(out var target); 20return !reference.TryGetTarget(out _);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EventHandlerFactory.cs (1)
24if (weakTarget.TryGetTarget(out var targ))
Microsoft.CodeAnalysis.CSharp (4)
Compilation\CSharpCompilation.cs (2)
2575if (previousWeakReference != null && previousWeakReference.TryGetTarget(out previousFactory)) 2592if (previousWeakReference != null && previousWeakReference.TryGetTarget(out previousFactory))
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
241if (previousWeakReference != null && previousWeakReference.TryGetTarget(out ExecutableCodeBinder? previousBinder))
Syntax\InternalSyntax\CSharpSyntaxNode.cs (1)
286else if (!weakStructure.TryGetTarget(out structure))
Microsoft.CodeAnalysis.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.UndoPrimitive.cs (1)
60return _weakTextBuffer.TryGetTarget(out var textBuffer) &&
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
253!weakReference.TryGetTarget(out var editorSnapshot))
Microsoft.CodeAnalysis.Features (1)
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
189if (!_lastDocumentWithCachedDiagnostics.TryGetTarget(out var lastDocument)
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Microsoft.CodeAnalysis.UnitTests (1)
Collections\List\ICollection.Generic.Tests.cs (1)
364return !wr.TryGetTarget(out _);
Microsoft.CodeAnalysis.Workspaces (7)
src\Compilers\Core\Portable\InternalUtilities\WeakReferenceExtensions.cs (2)
14reference.TryGetTarget(out var target); 20return !reference.TryGetTarget(out _);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EventHandlerFactory.cs (1)
24if (weakTarget.TryGetTarget(out var targ))
Workspace\Solution\Document.cs (3)
261return _model != null && _model.TryGetTarget(out semanticModel); 272return _nullableDisabledModel != null && _nullableDisabledModel.TryGetTarget(out semanticModel); 367if (original.TryGetTarget(out var semanticModel))
Workspace\Solution\VersionSource\RecoverableTextAndVersion.RecoverableText.cs (1)
66return weakReference != null && weakReference.TryGetTarget(out value) && value != null;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (5)
src\Compilers\Core\Portable\InternalUtilities\WeakList.cs (3)
34if (!_items[i].TryGetTarget(out _)) 113if (item.TryGetTarget(out _)) 188if (_weakList._items[currentIndex].TryGetTarget(out var item))
src\Compilers\Core\Portable\InternalUtilities\WeakReferenceExtensions.cs (2)
14reference.TryGetTarget(out var target); 20return !reference.TryGetTarget(out _);
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
411if (wr.TryGetTarget(out Stats? stats)) 449if (!all[i].TryGetTarget(out _))
Microsoft.Extensions.DependencyInjection (2)
DependencyInjectionEventSource.cs (2)
162if (!reference.TryGetTarget(out ServiceProvider? target) || target == provider) 290if (reference.TryGetTarget(out ServiceProvider? provider))
Microsoft.Maui (6)
Animations\Animation.cs (1)
340 if (Parent?.TryGetTarget(out view) ?? false)
Graphics\ShapeDrawable.cs (1)
21 get => _shapeView is not null && _shapeView.TryGetTarget(out var d) ? d : null;
WeakList.cs (3)
35 if (w.TryGetTarget(out T? target)) 62 if (w.TryGetTarget(out T? item)) 71 _list.RemoveAll(w => !w.TryGetTarget(out _));
WeakReferenceExtensions.cs (1)
24 if (self.TryGetTarget(out var target))
Microsoft.Maui.Controls (44)
AnimatableKey.cs (3)
81 if (!Animatable.TryGetTarget(out target)) 99 if (!Animatable.TryGetTarget(out thisAnimatable)) 106 if (!other.Animatable.TryGetTarget(out thatAnimatable))
AnimationExtensions.cs (2)
331 info.Owner.TryGetTarget(out IAnimatable owner); 368 if (o is Tweener tweener && s_animations.TryGetValue(tweener.Handle, out Info info) && info.Owner.TryGetTarget(out IAnimatable owner))
Application\Application.cs (1)
437 if (r.TryGetTarget(out var w))
AppThemeBinding.cs (2)
93 if (_weakTarget == null || !_weakTarget.TryGetTarget(out var target)) 156 if (_weakTarget?.TryGetTarget(out var target) == true &&
BindableLayout\BindableLayout.cs (4)
348 if (!_layoutWeakReference.TryGetTarget(out IBindableLayout layout)) 358 if (!_layoutWeakReference.TryGetTarget(out IBindableLayout layout)) 483 if (!_layoutWeakReference.TryGetTarget(out IBindableLayout layout)) 504 if (!_layoutWeakReference.TryGetTarget(out IBindableLayout layout))
BindingBase.cs (1)
87 _relativeSourceTargetOverride?.TryGetTarget(out element);
BindingExpression.cs (11)
53 if (!_weakTarget.TryGetTarget(out BindableObject target)) 59 if (_weakSource.TryGetTarget(out var source) && _targetProperty != null) 85 if (_weakTarget != null && _weakTarget.TryGetTarget(out BindableObject prevTarget) && !ReferenceEquals(prevTarget, target)) 88 if (_weakSource != null && _weakSource.TryGetTarget(out var previousSource) && !ReferenceEquals(previousSource, sourceObject)) 99 if (_weakSource != null && _weakSource.TryGetTarget(out var sourceObject)) 479 if (weakElement.TryGetTarget(out elem)) 497 if (!weak.TryGetTarget(out chainMember)) 512 if (_weakTarget?.TryGetTarget(out target) != true) 516 if (_weakSource?.TryGetTarget(out currentSource) == true) 536 if (_weakTarget?.TryGetTarget(out target) != true) 711 if (_expression._weakTarget is not null && _expression._weakTarget.TryGetTarget(out BindableObject obj))
Element\Element.cs (2)
291 if (_parentOverride.TryGetTarget(out var parent)) 346 if (_realParent.TryGetTarget(out var parent))
Interactivity\EventTrigger.cs (1)
60 if (wr.TryGetTarget(out var target) && target == bindable)
Internals\WeakEventProxy.cs (2)
27 if (_source is not null && _source.TryGetTarget(out source)) 38 if (_handler is not null && _handler.TryGetTarget(out handler))
Menu\MenuItemTracker.cs (2)
31 if (target.TryGetTarget(out var page)) 57 get => _target is not null && _target.TryGetTarget(out var target) ? target : null;
PlatformBindingHelpers.cs (1)
76 if ((bindable as BindableObjectProxy<TPlatformView>).TargetReference.TryGetTarget(out platformView))
TypedBinding.cs (7)
157 if (!_weakTarget.TryGetTarget(out target)) 166 if (_weakSource.TryGetTarget(out source) && source != null) 374 if (weakElement.TryGetTarget(out elem)) 392 if (!weak.TryGetTarget(out chainMember)) 406 if (_weakTarget?.TryGetTarget(out target) != true) 410 if (_weakSource?.TryGetTarget(out currentSource) == true) 429 if (_weakTarget?.TryGetTarget(out target) != true)
ViewExtensions.cs (3)
50 if (weakView.TryGetTarget(out VisualElement? v)) 272 if (weakView.TryGetTarget(out VisualElement? v)) 277 if (weakView.TryGetTarget(out VisualElement? v))
VisualStateManager.cs (2)
333 _visualElement.TryGetTarget(out var ve); 407 _visualElement.TryGetTarget(out var ve);
Microsoft.ML.Core (3)
Environment\HostEnvironmentBase.cs (3)
104if (child.TryGetTarget(out IHost host)) 141_children.RemoveAll(r => r.TryGetTarget(out IHost _) == false); 420_children.RemoveAll(r => r.TryGetTarget(out IHost _) == false);
Microsoft.ML.Transforms (2)
Text\WordEmbeddingsExtractor.cs (2)
658if (_vocab[_modelFileNameWithPath].TryGetTarget(out Model model)) 669if (_vocab[_modelFileNameWithPath].TryGetTarget(out Model modelObject))
PresentationCore (9)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (2)
34Debug.Assert(listener.TryGetTarget(out _)); 67if (weakReference.TryGetTarget(out var listener))
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (1)
101if (_penThreadWeakRefList[i].TryGetTarget(out candidatePenThread)
System\Windows\Media\Imaging\BitmapSource.cs (5)
1702if(_bitmapSource.TryGetTarget(out bitmapSource)) 1719if(_bitmapSource.TryGetTarget(out bitmapSource)) 1734if(_bitmapSource.TryGetTarget(out bitmapSource)) 1751if(_bitmapSource.TryGetTarget(out bitmapSource)) 1781if(_bitmapSource.TryGetTarget(out bitmapSource))
System\Windows\UIElement.cs (1)
4682wRef?.TryGetTarget(out element);
PresentationFramework (20)
MS\Internal\WindowsRuntime\Generated\WinRT.cs (1)
181if (!_instance.TryGetTarget(out value))
System\Windows\Controls\ContextMenu.cs (1)
613if (_weakRefToPreviousFocus.TryGetTarget(out previousFocus))
System\Windows\Controls\PopupControlService.cs (1)
1302if (!_storage.TryGetTarget(out value))
System\Windows\Controls\VirtualizingStackPanel.cs (4)
12379if (_wrIC.TryGetTarget(out ItemsControl ic)) 12395if (_wrIC.TryGetTarget(out ItemsControl ic)) 12488if (wr.TryGetTarget(out itemsControl) && itemsControl == target) 12559if (!wr.TryGetTarget(out unused))
System\Windows\Data\Binding.cs (1)
495return wr.TryGetTarget(out target) ? target : null;
System\Windows\Data\BindingExpressionBase.cs (1)
209return (wr.TryGetTarget(out bg)) ? bg : null;
System\Windows\Data\BindingGroup.cs (3)
557if (!_inheritanceContext.TryGetTarget(out inheritanceContext)) 577_inheritanceContext.TryGetTarget(out inheritanceContext); 615_inheritanceContext.TryGetTarget(out inheritanceContext);
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (4)
164if (wr.TryGetTarget(out rd)) 241if (!wr.TryGetTarget(out target) || target == rd) 444wrDict.TryGetTarget(out cachedDict); 509if (kvp.Key.Item == null || !kvp.Value.TryGetTarget(out dict))
System\windows\Documents\TextEditor.cs (1)
186if (_immCompositionForDetach.TryGetTarget(out immComposition))
System\Windows\Documents\TextStore.cs (2)
4960if (wr.TryGetTarget(out fe) && fe == target) 5031if (!wr.TryGetTarget(out unused))
System\Windows\Documents\WinRTSpellerInterop.cs (1)
734!_dispatcher.TryGetTarget(out dispatcher) ||
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
System.Diagnostics.TraceSource (4)
System\Diagnostics\Switch.cs (2)
81if (s_switches[i].TryGetTarget(out _)) 280if (s_switches[i].TryGetTarget(out Switch? swtch))
System\Diagnostics\TraceSource.cs (2)
52if (s_tracesources[i].TryGetTarget(out _)) 170if (s_tracesources[i].TryGetTarget(out TraceSource? tracesource))
System.IO.FileSystem.Watcher (4)
System\IO\FileSystemWatcher.Linux.cs (4)
388if (_weakWatcher.TryGetTarget(out FileSystemWatcher? watcher)) 465if (_weakWatcher.TryGetTarget(out FileSystemWatcher? watcher)) 556if (!_weakWatcher.TryGetTarget(out watcher)) 771if (_weakWatcher.TryGetTarget(out FileSystemWatcher? watcher))
System.Net.Http (4)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
743if (wr.TryGetTarget(out HttpConnectionPool? @this))
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (3)
104if (wr.TryGetTarget(out HttpConnectionPoolManager? thisRef)) 119if (wr.TryGetTarget(out HttpConnectionPoolManager? thisRef)) 158if (poolsRef.TryGetTarget(out ConcurrentDictionary<HttpConnectionKey, HttpConnectionPool>? pools))
System.Net.Requests (2)
System\Net\ServicePoint\ServicePointManager.cs (2)
125if (s_servicePointTable.TryGetValue(tableKey, out wr) && wr.TryGetTarget(out sp)) 135if (!entry.Value.TryGetTarget(out _))
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
193if (wr.TryGetTarget(out ManagedWebSocket? thisRef))
System.Private.CoreLib (12)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
132if (weakRef == null || !weakRef.TryGetTarget(out CounterGroup? ret))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventProvider.cs (1)
66if (_this._eventProvider.TryGetTarget(out EventProvider? target))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (8)
480if (eventSourceRef.TryGetTarget(out EventSource? eventSource) && !eventSource.IsDisposed) 2882if (eventSourceRef.TryGetTarget(out EventSource? eventSource) && eventSource.Guid == m_guid && !eventSource.IsDisposed) 4347if (!weakRef.TryGetTarget(out _)) 4401if (esRef.TryGetTarget(out EventSource? es)) 4465if (eventSourceRef.TryGetTarget(out EventSource? eventSource)) 4484if (eventSourceRef.TryGetTarget(out EventSource? eventSource) 4548if (!eventSourceRef.TryGetTarget(out EventSource? eventSource)) 4638if (eventSourceRef.TryGetTarget(out EventSource? eventSource))
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (2)
295if (weakAlc.TryGetTarget(out AssemblyLoadContext? alc)) 483if (alcAlive.Value.TryGetTarget(out AssemblyLoadContext? alc))
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\ContextAware.cs (1)
27public DataContract? GetItem(int index) => _contracts[index].strong ?? (_contracts[index].weak?.TryGetTarget(out DataContract? ret) == true ? ret : null);
System.Private.Xml (4)
System\Xml\Dom\XmlDocument.cs (2)
291if (!elemRef.TryGetTarget(out XmlElement? target)) 943if (elemRef.TryGetTarget(out XmlElement? elem) && elem.IsConnected())
System\Xml\Dom\XmlElementList.cs (2)
290if (_listener.TryGetTarget(out XmlElementListListener? listener)) 382if (_elemList.TryGetTarget(out XmlElementList? el))
System.Private.Xml.Linq (3)
System\Xml\Linq\XNamespace.cs (3)
261ns = refNamespace != null && refNamespace.TryGetTarget(out XNamespace? target) ? target : null; 284r.TryGetTarget(out XNamespace? target) ? target.NamespaceName : null; 302if (refOld != null && refOld.TryGetTarget(out XNamespace? ns))
System.Text.Json (2)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (2)
436Debug.Assert(weakRef.TryGetTarget(out _) is false); 458if (weakRef is null || !weakRef.TryGetTarget(out CachingContext? ctx))
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexReplacement.cs (1)
110if (!replRef.TryGetTarget(out RegexReplacement? repl) || !repl.Pattern.Equals(replacement))
System.Threading.Tasks.Dataflow (1)
Internal\Common.cs (1)
96return wr.TryGetTarget(out T? item) ? item : null;
System.Windows.Forms (54)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (1)
381public Control? Owner => _ownerControl.TryGetTarget(out Control? owner) ? owner : null;
System\Windows\Forms\Accessibility\LabelEditAccessibleObject.cs (4)
41UIA_PROPERTY_ID.UIA_NativeWindowHandlePropertyId => UIAHelper.WindowHandleToVariant(_labelEdit.TryGetTarget(out var target) ? target.HWND : HWND.Null), 49if (_labelEdit.TryGetTarget(out var target)) 68public override string? Name => _labelEdit.TryGetTarget(out var target) 79_labelEdit.TryGetTarget(out var target) ? (int)target.HWND : (int)HWND.Null
System\Windows\Forms\Accessibility\LabelEditNativeWindow.cs (1)
85if (_owningControl.TryGetTarget(out Control? target) && !target.IsAccessibilityObjectCreated)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (2)
60public override LOGFONTW Logfont => _owningControl.TryGetTarget(out Control? target) ? target.Font.ToLogicalFont() : default; 179if (IsDegenerate(_owningControl.TryGetTarget(out Control? target) ? target.ClientRectangle : Rectangle.Empty))
System\Windows\Forms\ActiveX\AxHost.AxContainer.ExtenderProxy.cs (2)
41_control.TryGetTarget(out Control? target); 47_container.TryGetTarget(out AxContainer? container);
System\Windows\Forms\Application.ThreadContext.cs (1)
168get => _activatingControlRef?.TryGetTarget(out Control? target) ?? false ? target : null;
System\Windows\Forms\ComponentModel\COM2Interop\COM2Properties.cs (1)
229bool valid = _weakObjectReference.TryGetTarget(out object? target);
System\Windows\Forms\Control.cs (2)
2692get => _reflectParent?.TryGetTarget(out Control? parent) ?? false ? parent : null; 12820_toolStripControlHostReference.TryGetTarget(out ToolStripControlHost? value);
System\Windows\Forms\Controls\DataGridView\DataGridView.DataGridViewEditingPanelAccessibleObject.cs (4)
27_ownerDataGridView.TryGetTarget(out var owner) 37if (!_ownerDataGridView.TryGetTarget(out var owner)) 86=> (VARIANT)(_ownerDataGridView.TryGetTarget(out var owner) && owner.CurrentCell is not null), 89UIA_PROPERTY_ID.UIA_IsEnabledPropertyId => (VARIANT)(_ownerDataGridView.TryGetTarget(out var owner) && owner.Enabled),
System\Windows\Forms\Controls\ListView\ListViewLabelEditAccessibleObject.cs (6)
25_owningListView.TryGetTarget(out ListView? target) 30_owningListView.TryGetTarget(out ListView? target) 37_owningListView.TryGetTarget(out ListView? target) 50UIA_PROPERTY_ID.UIA_IsEnabledPropertyId => _owningListView.TryGetTarget(out ListView? target) ? (VARIANT)target.Enabled : VARIANT.False, 58=> _owningListView.TryGetTarget(out ListView? target) && target.View == View.Tile ? target._selectedItem?.SubItems[1].AccessibilityObject : null, 63_owningListView.TryGetTarget(out ListView? target)
System\Windows\Forms\Controls\ListView\ListViewLabelEditNativeWindow.cs (1)
12public override AccessibleObject? AccessibilityObject => _owningListView.TryGetTarget(out ListView? target) ? new ListViewLabelEditAccessibleObject(target, this) : null;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.CommandsPaneAccessibleObject.cs (2)
30if (_parentPropertyGrid.TryGetTarget(out PropertyGrid? target) 52? owner.AccessibleName ?? (_parentPropertyGrid.TryGetTarget(out PropertyGrid? target)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.GridEntryAccessibleObject.cs (1)
231=> _owningGridEntry.TryGetTarget(out GridEntry? target) ? target : null;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.HelpPaneAccessibleObject.cs (2)
30if (_parentPropertyGrid.TryGetTarget(out PropertyGrid? target) 62return _parentPropertyGrid.TryGetTarget(out PropertyGrid? target)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.PropertyGridViewAccessibleObject.cs (1)
29if (!_parentPropertyGrid.TryGetTarget(out PropertyGrid? target))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStrip.PropertyGridToolStripAccessibleObject.cs (4)
30if (_parentPropertyGrid.TryGetTarget(out PropertyGrid? target) 60_parentPropertyGrid.TryGetTarget(out PropertyGrid? target); 69&& _parentPropertyGrid.TryGetTarget(out PropertyGrid? target) 74_parentPropertyGrid.TryGetTarget(out PropertyGrid? target);
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
23private TextBoxBase? Owner => _owner.TryGetTarget(out TextBoxBase? owner) ? owner : null;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
213if (_lastFocusedTool.TryGetTarget(out IKeyboardToolTip? tool) && tool is not null)
System\Windows\Forms\Controls\TrackBar\TrackBar.TrackBarChildAccessibleObject.cs (1)
52TrackBar? IOwnedObject<TrackBar>.Owner => _owningTrackBar.TryGetTarget(out TrackBar? target) ? target : null;
System\Windows\Forms\Controls\TreeView\TreeViewLabelEditAccessibleObject.cs (4)
20_owningTreeView.TryGetTarget(out TreeView? target) 25_owningTreeView.TryGetTarget(out TreeView? target) 30_owningTreeView.TryGetTarget(out TreeView? target) 39UIA_PROPERTY_ID.UIA_IsEnabledPropertyId => _owningTreeView.TryGetTarget(out TreeView? target) ? (VARIANT)target.Enabled : VARIANT.False,
System\Windows\Forms\Controls\TreeView\TreeViewLabelEditNativeWindow.cs (1)
12public override AccessibleObject? AccessibilityObject => _owningTreeView.TryGetTarget(out TreeView? target) ? new TreeViewLabelEditAccessibleObject(target, this) : null;
System\Windows\Forms\Input\MouseHoverTimer.cs (3)
19_currentItem.TryGetTarget(out var currentItem); 37_currentItem.TryGetTarget(out var currentItem); 59if (_currentItem.TryGetTarget(out var currentItem) && !currentItem.IsDisposed)
System\Windows\Forms\Layout\LayoutEventArgs.cs (1)
28_affectedComponent?.TryGetTarget(out target);
System\Windows\Forms\NativeWindow.cs (3)
349if (_weakThisPtr.TryGetTarget(out _)) 690if (_weakThisPtr.TryGetTarget(out _)) 838bool finalizing = !_weakThisPtr.TryGetTarget(out _);
System\Windows\Forms\ToolTip\KeyboardToolTipStateMachine.cs (1)
149if (_lastFocusedTool.TryGetTarget(out IKeyboardToolTip? tool))
System\Windows\Forms\ToolTip\KeyboardToolTipStateMachine.ToolToTipDictionary.cs (2)
21if (!toolTipReference.TryGetTarget(out toolTip)) 47if (toolTipReference.TryGetTarget(out ToolTip? existingToolTip))
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (1)
46get => _destinationThread?.TryGetTarget(out Thread? target) == true ? target : null;
System.Windows.Forms.Design (2)
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
34if (s_defaultSerializerRef is null || !s_defaultSerializerRef.TryGetTarget(out ComponentCodeDomSerializer? defaultSerializer))
System\Windows\Forms\Design\ImageIndexEditor.cs (1)
52_currentImageListPropertyReference.TryGetTarget(out PropertyDescriptor? currentProperty) &&
System.Windows.Forms.Primitives (1)
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (1)
166if (!_instance.TryGetTarget(out object? target))
System.Windows.Forms.Tests (2)
System\Windows\Forms\ToolStripTests.cs (2)
7331Assert.False(currentItemWR.TryGetTarget(out _)); 7338Assert.True(currentItemWR.TryGetTarget(out _));
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\BoundedCacheWithFactory.cs (1)
37if (!weakReferencedEntry.TryGetTarget(out var cachedEntry) ||