コード例 #1
0
        public void TestResolutionChange()
        {
            DisplayScreen screen = new DisplayScreen();
            if (screen.ScreenWidth == 800)
            {
                screen.ScreenWidth = 1024;
                screen.ScreenHeight = 768;
                screen.UpdateSettingsToFullscreen();

                DisplayScreen tmp = new DisplayScreen();
                Assert.IsTrue((tmp.ScreenWidth == screen.ScreenWidth) &&
                              (tmp.ScreenHeight == screen.ScreenHeight));

                DisplayScreen.ResetSettings();
            }
            else
            {
                screen.ScreenWidth = 800;
                screen.ScreenHeight = 600;
                screen.UpdateSettingsToFullscreen();

                DisplayScreen tmp = new DisplayScreen();
                Assert.IsTrue((tmp.ScreenWidth == screen.ScreenWidth) &&
                              (tmp.ScreenHeight == screen.ScreenHeight));

                DisplayScreen.ResetSettings();
            }
        }
コード例 #2
0
        public static ChangeSettingsResult ChangeResolutionPermanently(RotateDesktopMode rotMode)
        {
            DisplayScreen screen = new DisplayScreen();

            screen.ScreenRotation = rotMode;
            return(screen.UpdateSettingsInRegistry());
        }
コード例 #3
0
ファイル: DesktopTools.cs プロジェクト: CHiiLD/net-toolkit
 public static ChangeSettingsResult ChangeResolutionPermanently(int width, int height, RotateDesktopMode rotMode)
 {
     DisplayScreen screen = new DisplayScreen();
     screen.ScreenWidth = width;
     screen.ScreenHeight = height;
     screen.ScreenRotation = rotMode;
     return screen.UpdateSettingsInRegistry();
 }
コード例 #4
0
        public static ChangeSettingsResult ChangeResolutionTemporary(int width, int height, RotateDesktopMode rotMode)
        {
            DisplayScreen screen = new DisplayScreen();

            screen.ScreenWidth    = width;
            screen.ScreenHeight   = height;
            screen.ScreenRotation = rotMode;
            return(screen.UpdateSettingsToFullscreen());
        }
コード例 #5
0
        public static ChangeSettingsResult ChangeResolutionPermanently(int width, int height, RotateDesktopMode rotMode)
        {
            DisplayScreen screen = new DisplayScreen();

            screen.ScreenWidth    = width;
            screen.ScreenHeight   = height;
            screen.ScreenRotation = rotMode;
            return(screen.UpdateSettingsInRegistry());
        }
コード例 #6
0
        /// <summary>
        /// Equals
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            else if (!(obj is DisplayScreen))
            {
                return(false);
            }
            else if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            DisplayScreen res = obj as DisplayScreen;

            return
                (_devMode.dmPelsWidth.Equals(res._devMode.dmPelsWidth) &&
                 _devMode.dmPelsHeight.Equals(res._devMode.dmPelsHeight) &&
                 _devMode.dmDisplayFrequency.Equals(res._devMode.dmDisplayFrequency));
        }
コード例 #7
0
 public static void ResetResolution()
 {
     DisplayScreen.ResetSettings();
 }
コード例 #8
0
 static DesktopTools()
 {
     DisplayScreen.Init();
 }
コード例 #9
0
 static DisplayScreen()
 {
     oldSettings = new DisplayScreen();
 }
コード例 #10
0
 static DisplayScreen()
 {
     oldSettings = new DisplayScreen();
 }
コード例 #11
0
ファイル: DesktopTools.cs プロジェクト: CHiiLD/net-toolkit
 public static ChangeSettingsResult ChangeResolutionPermanently(RotateDesktopMode rotMode)
 {
     DisplayScreen screen = new DisplayScreen();
     screen.ScreenRotation = rotMode;
     return screen.UpdateSettingsInRegistry();
 }
コード例 #12
0
ファイル: DesktopTools.cs プロジェクト: CHiiLD/net-toolkit
 public static ChangeSettingsResult ChangeResolutionTemporary(int width, int height, RotateDesktopMode rotMode)
 {
     DisplayScreen screen = new DisplayScreen();
     screen.ScreenWidth = width;
     screen.ScreenHeight = height;
     screen.ScreenRotation = rotMode;
     return screen.UpdateSettingsToFullscreen();
 }