Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pinToMonitor is still mentioned in documentation even though it is no longer supported in code. #460

Open
avargaslopez24 opened this issue Nov 15, 2018 · 5 comments

Comments

@avargaslopez24
Copy link

I don't know if this was an intentional reversion or not, but pinToMonitor is no longer defined in the source code. It does still show up on the website documentation however.

@lefthandedgoat
Copy link
Owner

Good find. Looking at the old code I think I can add it back, but if you tell it to pin to a monitor that does not exist it will move the browser off the screen and it will be lost.

It depended on a function to get monitor count that does not exist in .net core 2.

@avargaslopez24
Copy link
Author

Looking at the code, a workaround may be just make it a user defined value rather than a function call. Something along the lines of forcing users to set a canopy.screenmonitorCount value of non 1 before calling pintoMonitor?

Otherwise it's not a huge deal since I believe most users are running their UI tests headless making this a minor inconvenience.

@lefthandedgoat
Copy link
Owner

ah yes I could check that.

@olivercoad
Copy link
Contributor

Any update on this? pinToMonitor is still in the documentation but not defined.
Will .NET Core 3.0 support this?

@lefthandedgoat
Copy link
Owner

@olivercoad

let pinToMonitor n =
    let n' = if n < 1 then 1 else n
    if System.Windows.Forms.SystemInformation.MonitorCount >= n' then
        let workingArea = System.Windows.Forms.Screen.AllScreens.[n'-1].WorkingArea
        browser.Manage().Window.Position <- new System.Drawing.Point(workingArea.X, 0)
        browser.Manage().Window.Maximize()

That is the old code. I dont know if System.Windows.Forms.SystemInformation.MonitorCount is in .net Core 3.0 or System.Windows.Forms.Screen.AllScreens

For now I will remove from documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants