66 instantiations of Margins
System.Drawing.Common.Tests (35)
System\Drawing\Printing\MarginsConverterTests.cs (1)
123Margins margins = new() { Left = 1, Right = 2, Top = 3, Bottom = 4 };
System\Drawing\Printing\MarginsTests.cs (31)
35Margins margins = new(); 48Margins margins = new(left, right, top, bottom); 58AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("left", null, () => new Margins(-1, 2, 3, 4)); 64AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("right", null, () => new Margins(1, -1, 3, 4)); 70AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("top", null, () => new Margins(1, 2, -1, 4)); 76AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("bottom", null, () => new Margins(1, 2, 3, -1)); 81Margins margins = new(1, 2, 3, 4); 83yield return new object[] { margins, new Margins(1, 2, 3, 4), true }; 84yield return new object[] { margins, new Margins(2, 2, 3, 4), false }; 85yield return new object[] { margins, new Margins(1, 3, 3, 4), false }; 86yield return new object[] { margins, new Margins(1, 2, 4, 4), false }; 87yield return new object[] { margins, new Margins(1, 2, 3, 5), false }; 106Margins margins = new(1, 2, 3, 4); 108yield return new object[] { margins, new Margins(1, 2, 3, 4), true }; 109yield return new object[] { margins, new Margins(2, 2, 3, 4), false }; 110yield return new object[] { margins, new Margins(1, 3, 3, 4), false }; 111yield return new object[] { margins, new Margins(1, 2, 4, 4), false }; 112yield return new object[] { margins, new Margins(1, 2, 3, 5), false }; 115yield return new object[] { null, new Margins(1, 2, 3, 4), false }; 116yield return new object[] { new Margins(1, 2, 3, 4), null, false }; 129yield return new object[] { new Margins(), "[Margins Left=100 Right=100 Top=100 Bottom=100]" }; 130yield return new object[] { new Margins(1, 2, 3, 4), "[Margins Left=1 Right=2 Top=3 Bottom=4]" }; 143Margins margins = new(1, 2, 3, 4); 163Margins margins = new() 177Margins margins = new(); 185Margins margins = new() 199Margins margins = new(); 207Margins margins = new() 221Margins margins = new(); 229Margins margins = new() 243Margins margins = new();
System\Drawing\Printing\PageSettingsTests.cs (1)
41Margins = new Margins(120, 130, 140, 150),
System\Drawing\Printing\PrinterUnitConvertTests.cs (2)
145var converted = PrinterUnitConvert.Convert(new Margins(100, 1000, 100, 1000), fromUnit, toUnit); 146Assert.Equal(new Margins(expectedLeft, expectedRight, expectedTop, expectedBottom), converted);
System.Windows.Forms (2)
System\Windows\Forms\Printing\PageSetupDialog.cs (2)
104set => _minMargins = value ?? new Margins(0, 0, 0, 0); 249Margins newMargins = new()
System.Windows.Forms.Tests (29)
System\Windows\Forms\PageSetupDialogTests.cs (29)
22Assert.Equal(new Margins(0, 0, 0, 0), dialog.MinMargins); 196yield return new object[] { null, new Margins(0, 0, 0, 0) }; 197yield return new object[] { new Margins(), new Margins() }; 198yield return new object[] { new Margins(1, 2, 3, 4), new Margins(1, 2, 3, 4) }; 199yield return new object[] { new Margins(0, 0, 0, 0), new Margins(0, 0, 0, 0) }; 200yield return new object[] { new Margins(1, 0, 0, 0), new Margins(1, 0, 0, 0) }; 201yield return new object[] { new Margins(0, 1, 0, 0), new Margins(0, 1, 0, 0) }; 202yield return new object[] { new Margins(0, 0, 1, 0), new Margins(0, 0, 1, 0) }; 203yield return new object[] { new Margins(0, 0, 0, 1), new Margins(0, 0, 0, 1) }; 228dialog.MinMargins = new Margins(1, 2, 3, 4); 230Assert.Equal(new Margins(1, 2, 3, 4), dialog.MinMargins); 234Assert.Equal(new Margins(0, 0, 0, 0), dialog.MinMargins); 240yield return new object[] { new Margins(), true }; 241yield return new object[] { new Margins(1, 2, 3, 4), true }; 242yield return new object[] { new Margins(0, 0, 0, 0), false }; 243yield return new object[] { new Margins(1, 0, 0, 0), true }; 244yield return new object[] { new Margins(0, 1, 0, 0), true }; 245yield return new object[] { new Margins(0, 0, 1, 0), true }; 246yield return new object[] { new Margins(0, 0, 0, 10), true }; 393Assert.Equal(new Margins(0, 0, 0, 0), dialog.MinMargins); 414MinMargins = new Margins(1, 2, 3, 4), 429Assert.Equal(new Margins(0, 0, 0, 0), dialog.MinMargins);
44 references to Margins
System.Drawing (1)
System.Drawing.cs (1)
110[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Printing.Margins))]
System.Drawing.Common (7)
Special\NotSupported.cs (7)
2727public static bool operator ==(System.Drawing.Printing.Margins? m1, System.Drawing.Printing.Margins? m2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 2728public static bool operator !=(System.Drawing.Printing.Margins? m1, System.Drawing.Printing.Margins? m2) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 2752public System.Drawing.Printing.Margins Margins { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 3125public static System.Drawing.Printing.Margins Convert(System.Drawing.Printing.Margins value, System.Drawing.Printing.PrinterUnit fromUnit, System.Drawing.Printing.PrinterUnit toUnit) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (28)
System\Drawing\Printing\MarginsConverterTests.cs (7)
62Assert.IsType<Margins>(result); 63Margins margins = result as Margins; 91Assert.IsType<Margins>(result); 92Margins margins = result as Margins; 123Margins margins = new() { Left = 1, Right = 2, Top = 3, Bottom = 4 };
System\Drawing\Printing\MarginsTests.cs (20)
35Margins margins = new(); 48Margins margins = new(left, right, top, bottom); 81Margins margins = new(1, 2, 3, 4); 95public void Equals_InvokeObject_ReturnsExpected(Margins margins, object obj, bool expected) 98if (obj is Margins) 106Margins margins = new(1, 2, 3, 4); 121public void Equals_InvokeMargin_ReturnsExpected(Margins margins1, Margins margins2, bool expected) 135public void ToString_Invoke_ReturnsExpected(Margins margins, string expected) 143Margins margins = new(1, 2, 3, 4); 144Margins clonedMargins = Assert.IsType<Margins>(margins.Clone()); 163Margins margins = new() 177Margins margins = new(); 185Margins margins = new() 199Margins margins = new(); 207Margins margins = new() 221Margins margins = new(); 229Margins margins = new() 243Margins margins = new();
System\Drawing\Printing\PrinterUnitConvertTests.cs (1)
145var converted = PrinterUnitConvert.Convert(new Margins(100, 1000, 100, 1000), fromUnit, toUnit);
System.Windows.Forms (5)
System\Windows\Forms\Printing\PageSetupDialog.cs (5)
24private Margins? _minMargins; 101public Margins? MinMargins 249Margins newMargins = new() 304Margins margins = PrinterUnitConvert.Convert(MinMargins, PrinterUnit.Display, toUnit); 313Margins margins = PrinterUnitConvert.Convert(_pageSettings.Margins, PrinterUnit.Display, toUnit);
System.Windows.Forms.Tests (3)
System\Windows\Forms\PageSetupDialogTests.cs (3)
208public void PageSetupDialog_MinMargins_Set_GetReturnsExpected(Margins value, Margins expected) 251public void PageSetupDialog_MinMargins_ShouldSerializeValue_ReturnsExpected(Margins value, bool expected)