23 implementations of Instance
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TypeContext.cs (1)
113public object Instance
PresentationFramework (10)
MS\Internal\Data\DefaultValueConverter.cs (1)
796public object Instance { get { return null; } }
System\Windows\Controls\ContentPresenter.cs (1)
1143object ITypeDescriptorContext.Instance { get { return _instance; } }
System\Windows\Documents\DPTypeDescriptorContext.cs (1)
156object System.ComponentModel.ITypeDescriptorContext.Instance
System\Windows\Markup\Baml2006\DeferredBinaryDeserializerExtension.cs (1)
93object ITypeDescriptorContext.Instance
System\Windows\Markup\Baml2006\TypeConverterMarkupExtension.cs (1)
56object ITypeDescriptorContext.Instance
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
204object ITypeDescriptorContext.Instance 1224public object Instance
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1484public object Instance
System\Windows\Markup\TypeContext.cs (1)
113public object Instance
System\Windows\TemplateContent.cs (1)
1489object ITypeDescriptorContext.Instance
ReachFramework (1)
Serialization\Manager\XpsTokenContext.cs (1)
126Instance
System.Drawing.Common.Tests (1)
System\Drawing\Printing\MarginsConverterTests.cs (1)
151public object Instance { get { return null; } }
System.Windows.Forms (1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
610public object? Instance => GetValueOwner() ?? _parent?.Instance;
System.Windows.Forms.Design (3)
System\ComponentModel\Design\DesignerActionPanel.TypeDescriptorContext.cs (1)
23public object Instance { get; }
System\Windows\Forms\Design\CollectionEditVerbManager.cs (1)
116object ITypeDescriptorContext.Instance
System\Windows\Forms\Design\EditorServiceContext.cs (1)
96object ITypeDescriptorContext.Instance => _designer.Component;
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\DataMemberFieldConverterTests.cs (1)
54public object Instance { get { return null; } }
System.Xaml (2)
System\Xaml\Context\ServiceProviderContext.cs (1)
104object ITypeDescriptorContext.Instance
System\Xaml\XamlObjectReader.cs (1)
2807public object Instance
System.Xaml.Tests (3)
System\Windows\Markup\NameReferenceConverterTests.cs (1)
199public object Instance => throw new NotImplementedException();
System\Windows\Markup\ValueSerializerTests.cs (1)
447public object Instance => throw new NotImplementedException();
System\Windows\Markup\XamlSetTypeConverterEventArgsTests.cs (1)
46public object Instance => throw new NotImplementedException();
113 references to Instance
PresentationCore (33)
System\Windows\Input\Command\KeyGestureConverter.cs (2)
62if (context != null && context.Instance != null) 64KeyGesture keyGesture = context.Instance as KeyGesture;
System\Windows\Input\Command\MouseActionConverter.cs (2)
49if (context is null || context.Instance is null) 53return IsDefinedMouseAction((MouseAction)context.Instance);
System\Windows\Input\Command\MouseGestureConverter.cs (2)
125if (context != null && context.Instance != null) 127MouseGesture mouseGesture = context.Instance as MouseGesture;
System\Windows\Input\InputScopeNameConverter.cs (2)
68if (typeof (string) == destinationType && null != context && null != context.Instance && context.Instance is InputScopeName)
System\Windows\Media\FontFamilyConverter.cs (1)
62FontFamily fontFamily = context.Instance as FontFamily;
System\Windows\Media\Generated\BrushConverter.cs (4)
79if (context != null && context.Instance != null) 81if (!(context.Instance is Brush)) 86Brush value = (Brush)context.Instance; 151if (context != null && context.Instance != null)
System\Windows\Media\Generated\CacheModeConverter.cs (4)
79if (context != null && context.Instance != null) 81if (!(context.Instance is CacheMode)) 86CacheMode value = (CacheMode)context.Instance; 151if (context != null && context.Instance != null)
System\Windows\Media\Generated\GeometryConverter.cs (4)
79if (context != null && context.Instance != null) 81if (!(context.Instance is Geometry)) 86Geometry value = (Geometry)context.Instance; 151if (context != null && context.Instance != null)
System\Windows\Media\Generated\PathFigureCollectionConverter.cs (4)
79if (context != null && context.Instance != null) 81if (!(context.Instance is PathFigureCollection)) 86PathFigureCollection value = (PathFigureCollection)context.Instance; 151if (context != null && context.Instance != null)
System\Windows\Media\Generated\TransformConverter.cs (4)
79if (context != null && context.Instance != null) 81if (!(context.Instance is Transform)) 86Transform value = (Transform)context.Instance; 151if (context != null && context.Instance != null)
System\Windows\Media\ImageSourceConverter.cs (4)
67if (context != null && context.Instance != null) 69if (!(context.Instance is ImageSource)) 75ImageSource value = (ImageSource)context.Instance; 215if (context != null && context.Instance != null)
PresentationFramework (5)
System\Windows\Input\Command\CommandConverter.cs (1)
76RoutedCommand command = context != null ? context.Instance as RoutedCommand : null;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (4)
839Context.Instance is FrameworkTemplate 841(Context.Instance as FrameworkTemplate).HasContent ) 847value = (Context.Instance as FrameworkTemplate).LoadContent(); 1229return _baseContext.Instance;
System.Windows.Forms (18)
System\Windows\Forms\ComponentModel\COM2Interop\Com2AboutBoxPropertyDescriptor.AboutBoxUITypeEditor.cs (2)
17object? component = context.Instance; 19using var dispatch = ComHelpers.TryGetComScope<IDispatch>(context.Instance, out HRESULT hr);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (1)
37object? instance = context?.Instance;
System\Windows\Forms\Controls\Buttons\FlatButtonAppearanceConverter.cs (1)
19if (context is not null && attributes is not null && context.Instance is Button)
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (5)
23if (sourceType == typeof(string) && context is not null && context.Instance is ListViewItem) 42if (destinationType == typeof(string) && context is not null && context.Instance is ListViewItem) 58if (context is not null && context.Instance is not null) 60if (context.Instance is ListViewItem item && item.ListView is not null) 115if (context is not null && context.Instance is ListViewItem item && item.ListView is not null)
System\Windows\Forms\Controls\ListView\ListViewItemStateImageIndexConverter.cs (2)
44if (context is not null && context.Instance is not null) 46object instance = context.Instance;
System\Windows\Forms\Controls\TreeView\TreeViewImageIndexConverter.cs (2)
77if (context is not null && context.Instance is not null) 79object? instance = context.Instance;
System\Windows\Forms\ImageIndexConverter.cs (2)
100if (context is not null && context.Instance is not null) 102object? instance = context.Instance;
System\Windows\Forms\ImageKeyConverter.cs (2)
107if (context is not null && context.Instance is not null) 109object? instance = context.Instance;
System\Windows\Forms\MDI\MdiWindowListItemConverter.cs (1)
20if (context?.Instance is MenuStrip menu)
System.Windows.Forms.Design (33)
System\ComponentModel\Design\CollectionEditor.cs (2)
354if (!_ignoreChangedEvents && sender != Context.Instance) 367if (!_ignoreChangingEvents && sender != Context.Instance)
System\Windows\Forms\Design\ColumnHeaderCollectionEditor.cs (4)
51if (Context?.Instance is not ListView listview) 62property = TypeDescriptor.GetProperties(Context.Instance)["Columns"]; 63changeService.OnComponentChanging(Context.Instance, property); 70changeService.OnComponentChanged(Context.Instance, property);
System\Windows\Forms\Design\DataGridViewCellStyleEditor.cs (1)
24IComponent? component = context?.Instance as IComponent;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.cs (2)
23if (windowsFormsEditorService is not null && context?.Instance is not null) 27DataGridViewColumnCollectionDialog.ListBoxItem item = (DataGridViewColumnCollectionDialog.ListBoxItem)context.Instance;
System\Windows\Forms\Design\DataSourceListEditor.cs (1)
23if (provider is not null && context is not null && context.Instance is not null)
System\Windows\Forms\Design\DesignBindingPicker.cs (7)
488if (_context?.Instance is BindingSource instance && _designerHost is not null) 615if (comp == _context?.Instance) 806bool omitMemberContents = (isBindingSourceListMember && !pickingFieldMembers) || _context?.Instance is BindingSource; 1093if (isListofLists && _context?.Instance is BindingSource) 1719if (_context?.Instance is BindingSource) 1725if (dataMemberCount == 0 || _context?.Instance is BindingSource) 2579if (context is not null && context.Instance is BindingSource && dataSourceDescriptor is not null)
System\Windows\Forms\Design\DesignBindingValueUIHandler.cs (1)
34if (context.Instance is Control control)
System\Windows\Forms\Design\FormatStringEditor.cs (1)
22object component = context?.Instance!;
System\Windows\Forms\Design\ImageIndexEditor.cs (1)
39object? instance = context.Instance;
System\Windows\Forms\Design\LinkAreaEditor.cs (4)
35if (context?.Instance is not null) 37property = TypeDescriptor.GetProperties(context.Instance)["Text"]; 40text = (string?)property.GetValue(context.Instance); 55property.SetValue(context!.Instance, text);
System\Windows\Forms\Design\ListControlStringCollectionEditor.cs (1)
23if (context?.Instance is ListControl control && control.DataSource is not null)
System\Windows\Forms\Design\MaskedTextBoxTextEditor.cs (4)
13if (context?.Instance is null || !provider.TryGetService(out IWindowsFormsEditorService? editorService)) 18if (context.Instance is not MaskedTextBox maskedTextBox) 39if (context?.Instance is not null) 49if (context?.Instance is not null)
System\Windows\Forms\Design\MaskPropertyEditor.cs (1)
68(context.Instance as MaskedTextBox)!,
System\Windows\Forms\Design\StyleEditorForm.cs (1)
96_tableLayoutPanel = Context.Instance as TableLayoutPanel;
System\Windows\Forms\Design\TabPageCollectionEditor.cs (1)
24var tabControl = Context?.Instance as TabControl;
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (1)
104if (Context is not null && Context.Instance is TreeView view)
System.Windows.Forms.Design.Tests (15)
System\Windows\Forms\Design\FormatStringEditorTests.cs (1)
34_context.Setup(c => c.Instance).Returns(_cellStyle);
System\Windows\Forms\Design\MaskedTextBoxTextEditorTests.cs (13)
19.Setup(c => c.Instance) 43.Setup(c => c.Instance) 65.Setup(c => c.Instance) 83mockContext.Object.Instance.Should().NotBeOfType<MaskedTextBox>(); 84MaskedTextBox? maskedText = mockContext.Object.Instance as MaskedTextBox; 101.Setup(c => c.Instance) 119Assert.True(mockContext.Object.Instance is MaskedTextBox); 120MaskedTextBox? maskedTextBox = mockContext.Object.Instance as MaskedTextBox; 134.Setup(c => c.Instance) 152Assert.True(mockContext.Object.Instance is MaskedTextBox); 153MaskedTextBox? maskedTextBox = mockContext.Object.Instance as MaskedTextBox; 166.Setup(c => c.Instance) 191.Setup(c => c.Instance)
System\Windows\Forms\Design\MaskPropertyEditorTests.cs (1)
29if (context.Instance is MaskedTextBox maskedTextBox)
System.Windows.Forms.Primitives (1)
System\Windows\Forms\PaddingConverter.cs (1)
73object? original = context?.PropertyDescriptor?.GetValue(context.Instance);
System.Windows.Forms.Tests (8)
System\Windows\Forms\ListViewGroupConverterTests.cs (5)
52.Setup(c => c.Instance) 80.Setup(c => c.Instance) 110.Setup(c => c.Instance) 165.Setup(c => c.Instance) 281.Setup(c => c.Instance)
System\Windows\Forms\PaddingConverterTests.cs (3)
140.Setup(c => c.Instance) 356.Setup(c => c.Instance) 371.Setup(c => c.Instance)