63 references to _designer
System.Windows.Forms.Design.Tests (63)
ControlDesignerTests.cs (63)
20
_designer
.Dispose();
69
_designer
.GetAccessibleObjectField().Should().BeNull();
70
_designer
.GetBehaviorServiceProperty().Should().BeNull();
71
_designer
.AccessibilityObject.Should().NotBeNull();
72
_designer
.GetEnableDragRectProperty().Should().BeFalse();
73
_designer
.ParticipatesWithSnapLines.Should().BeTrue();
74
_designer
.AutoResizeHandles.Should().BeFalse();
75
_designer
.GetInheritanceAttributeProperty().Should().NotBeNull();
76
_designer
.NumberOfInternalControlDesigners().Should().Be(0);
77
_designer
.GetHitTestMethod(default).Should().BeFalse();
78
_designer
.HookChildControlsMethod(
_designer
._control);
84
_designer
.AutoResizeHandles = true;
85
_designer
.AutoResizeHandles.Should().BeTrue();
96
_designer
._control.Dock = dockStyle;
97
SelectionRules finalSelectionRules =
_designer
.SelectionRules;
104
_designer
.SelectionRules.Should().Be(finalSelectionRules);
113
_designer
.BaseWndProcMethod(ref m);
126
_designer
.CanBeParentedTo(parentDesigner).Should().BeTrue();
133
Action action = () =>
_designer
.EnableDragDropMethod(val);
167
Action action =
_designer
.OnSetComponentDefaults;
175
Action action = () =>
_designer
.OnContextMenuMethod(0, 0);
182
Action action =
_designer
.OnCreateHandleMethod;
192
_designer
.TestAccessor().Dynamic.WndProc(ref m);
203
_designer
.AssociatedComponents.Count.Should().Be(0);
205
_designer
._control.Controls.Add(childControl);
207
_designer
.AssociatedComponents.Count.Should().Be(0);
213
var mockSite = MockSite.CreateMockSiteWithDesignerHost(
_designer
._mockDesignerHost.Object);
214
_designer
._control.Site = mockSite.Object;
216
_designer
.AssociatedComponents.Count.Should().Be(0);
220
_designer
._control.Controls.Add(childControl);
222
_designer
.AssociatedComponents.Count.Should().Be(1);
231
Mock<DesignerFrame> mockDesignerFrame = new(
_designer
._control.Site!) { CallBase = true };
234
_designer
.TestAccessor().Dynamic._behaviorService = behaviorService;
235
_designer
.TestAccessor().Dynamic.Locked = true;
237
GlyphCollection glyphs =
_designer
.GetGlyphs(GlyphSelectionType.SelectedPrimary);
247
GlyphCollection glyphs =
_designer
.GetGlyphs(GlyphSelectionType.NotSelected);
255
_designer
.TestAccessor().Dynamic._behaviorService = null;
257
Action action = () =>
_designer
.GetGlyphs(GlyphSelectionType.SelectedPrimary);
264
_designer
._control.Dock = DockStyle.Fill;
265
_designer
._control.AutoSize = false;
267
Mock<DesignerFrame> mockDesignerFrame = new(
_designer
._mockSite.Object) { CallBase = true };
270
_designer
._mockSite.Setup(s => s.GetService(typeof(BehaviorService))).Returns(behaviorService);
272
_designer
.TestAccessor().Dynamic._behaviorService = behaviorService;
274
GlyphCollection glyphs =
_designer
.GetGlyphs(GlyphSelectionType.SelectedPrimary);
291
_designer
._control.Dock = DockStyle.None;
292
_designer
._control.AutoSize = false;
296
_designer
._mockSite.Setup(s => s.GetService(typeof(IServiceProvider))).Returns(mockServiceProvider.Object);
298
Mock<DesignerFrame> mockDesignerFrame = new(
_designer
._mockSite.Object) { CallBase = true };
301
_designer
.TestAccessor().Dynamic._behaviorService = behaviorService;
303
GlyphCollection glyphs =
_designer
.GetGlyphs(GlyphSelectionType.SelectedPrimary);
333
TypeDescriptor.AddAttributes(
_designer
._control, new DockingAttribute(dockingBehavior));
336
_designer
._mockDesignerHost.Setup(h => h.GetDesigner(It.IsAny<IComponent>())).Returns(mockParentDesigner.Object);
343
_designer
.InitializeNewComponent(defaultValues);
345
PropertyDescriptor? dockPropDescriptor = TypeDescriptor.GetProperties(
_designer
._control)[nameof(Control.Dock)];
348
dockPropDescriptor?.GetValue(
_designer
._control).Should().Be(dockStyle);
354
TypeDescriptor.AddAttributes(
_designer
._control, new DockingAttribute(DockingBehavior.AutoDock));
357
_designer
._mockDesignerHost.Setup(h => h.GetDesigner(It.IsAny<IComponent>())).Returns(mockParentDesigner.Object);
363
Action action = () =>
_designer
.InitializeExistingComponent(defaultValues);
371
var msg = Message.Create(
_designer
._control.Handle, 0x0202, IntPtr.Zero, IntPtr.Zero);
373
_designer
.WndProc(ref msg);
375
_designer
.OnMouseDragEndCalled.Should().BeTrue();
377
bool _ctrlSelect = (bool)
_designer
.TestAccessor().Dynamic._ctrlSelect;