我收到一个错误,说底部不能大于或等于顶部。
我正在使用Rectangle
此处记录的构造函数:https ://docs.microsoft.com/en-us/dotnet/api/system.management.automation.host.rectangle.-ctor?view=powershellsdk-1.1.0#System_Management_Automation_Host_Rectangle__ctor_System_Int32_System_Int32_System_Int32_System_Int32 _
这是我的相关代码部分;
Console.WriteLine("setting rectangles: " + sizex +", " +sizey);
int screenTop = sizey;
int screenBottom = 1;
int statusTop = 1;
int statusBottom = 0;
Console.WriteLine ("screen top bottom; "+screenTop + " > " + screenBottom );
Console.WriteLine ("status top bottom; "+statusTop + " > " + statusBottom );
// Rectangle(int left, int top, int right, int bottom);
System.Management.Automation.Host.Rectangle screenWindowRect = new Rectangle(0,screenTop,sizex,screenBottom);
System.Management.Automation.Host.Rectangle statusLineRect = new Rectangle(0,statusTop,sizex,statusBottom);
Console.WriteLine("rectangles set");
我在构造函数之前看到了调试行,但从来没有看到“矩形集”消息。
这是输出;
setting rectangles: 241, 28
screen top bottom; 28 > 1
status top bottom; 1 > 0
Out-Less: "bottom" cannot be greater than or equal to "top".
我可以看到顶部大于底部,但我不断收到错误;"bottom" cannot be greater than or equal to "top"
这是一个错误,还是文档错误,还是我遗漏了什么。