23 implementations of Instance
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TypeContext.cs (1)
112public object Instance
PresentationFramework (10)
MS\Internal\Data\DefaultValueConverter.cs (1)
792public object Instance { get { return null; } }
System\Windows\Controls\ContentPresenter.cs (1)
1134object ITypeDescriptorContext.Instance { get { return _instance; } }
System\Windows\Documents\DPTypeDescriptorContext.cs (1)
154object System.ComponentModel.ITypeDescriptorContext.Instance
System\Windows\Markup\Baml2006\DeferredBinaryDeserializerExtension.cs (1)
90object ITypeDescriptorContext.Instance
System\Windows\Markup\Baml2006\TypeConverterMarkupExtension.cs (1)
54object ITypeDescriptorContext.Instance
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
193object ITypeDescriptorContext.Instance 1213public object Instance
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1477public object Instance
System\Windows\Markup\TypeContext.cs (1)
112public object Instance
System\Windows\TemplateContent.cs (1)
1486object ITypeDescriptorContext.Instance
ReachFramework (1)
Serialization\Manager\XpsTokenContext.cs (1)
115Instance
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)
102object ITypeDescriptorContext.Instance
System\Xaml\XamlObjectReader.cs (1)
2802public 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();
116 references to Instance
PresentationCore (33)
System\Windows\Input\Command\KeyGestureConverter.cs (2)
56if (context != null && context.Instance != null) 58KeyGesture keyGesture = context.Instance as KeyGesture;
System\Windows\Input\Command\MouseActionConverter.cs (2)
40if (context is null || context.Instance is null) 44return IsDefinedMouseAction((MouseAction)context.Instance);
System\Windows\Input\Command\MouseGestureConverter.cs (2)
119if (context != null && context.Instance != null) 121MouseGesture mouseGesture = context.Instance as MouseGesture;
System\Windows\Input\InputScopeNameConverter.cs (2)
64if (typeof (string) == destinationType && null != context && null != context.Instance && context.Instance is InputScopeName)
System\Windows\Media\FontFamilyConverter.cs (1)
47FontFamily fontFamily = context.Instance as FontFamily;
System\Windows\Media\Generated\BrushConverter.cs (4)
51if (context != null && context.Instance != null) 53if (!(context.Instance is Brush)) 58Brush value = (Brush)context.Instance; 123if (context != null && context.Instance != null)
System\Windows\Media\Generated\CacheModeConverter.cs (4)
51if (context != null && context.Instance != null) 53if (!(context.Instance is CacheMode)) 58CacheMode value = (CacheMode)context.Instance; 123if (context != null && context.Instance != null)
System\Windows\Media\Generated\GeometryConverter.cs (4)
51if (context != null && context.Instance != null) 53if (!(context.Instance is Geometry)) 58Geometry value = (Geometry)context.Instance; 123if (context != null && context.Instance != null)
System\Windows\Media\Generated\PathFigureCollectionConverter.cs (4)
51if (context != null && context.Instance != null) 53if (!(context.Instance is PathFigureCollection)) 58PathFigureCollection value = (PathFigureCollection)context.Instance; 123if (context != null && context.Instance != null)
System\Windows\Media\Generated\TransformConverter.cs (4)
51if (context != null && context.Instance != null) 53if (!(context.Instance is Transform)) 58Transform value = (Transform)context.Instance; 123if (context != null && context.Instance != null)
System\Windows\Media\ImageSourceConverter.cs (4)
54if (context != null && context.Instance != null) 56if (!(context.Instance is ImageSource)) 62ImageSource value = (ImageSource)context.Instance; 202if (context != null && context.Instance != null)
PresentationFramework (5)
System\Windows\Input\Command\CommandConverter.cs (1)
71RoutedCommand command = context != null ? context.Instance as RoutedCommand : null;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (4)
828Context.Instance is FrameworkTemplate 830(Context.Instance as FrameworkTemplate).HasContent ) 836value = (Context.Instance as FrameworkTemplate).LoadContent(); 1218return _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)
487if (_context?.Instance is BindingSource instance && _designerHost is not null) 614if (comp == _context?.Instance) 805bool omitMemberContents = (isBindingSourceListMember && !pickingFieldMembers) || _context?.Instance is BindingSource; 1092if (isListofLists && _context?.Instance is BindingSource) 1721if (_context?.Instance is BindingSource) 1727if (dataMemberCount == 0 || _context?.Instance is BindingSource) 2581if (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 (18)
System\Windows\Forms\Design\FormatStringEditorTests.cs (1)
34_context.Setup(c => c.Instance).Returns(_cellStyle);
System\Windows\Forms\Design\ListControlStringCollectionEditorTests.cs (3)
30context.Setup(c => c.Instance).Returns(new object()); 45context.Setup(c => c.Instance).Returns(listControl); 62context.Setup(c => c.Instance).Returns(listControl);
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)