• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# WindowState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WindowState的典型用法代码示例。如果您正苦于以下问题:C# WindowState类的具体用法?C# WindowState怎么用?C# WindowState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WindowState类属于命名空间,在下文中一共展示了WindowState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ToFullscreen

        public static void ToFullscreen(this Window window)
        {
            if (window.IsFullscreen())
            { 
                return; 
            }
   
            _windowState = window.WindowState;
            _windowStyle = window.WindowStyle;
            _windowTopMost = window.Topmost;
            _windowResizeMode = window.ResizeMode;
            _windowRect.X = window.Left;
            _windowRect.Y = window.Top;
            _windowRect.Width = window.Width;
            _windowRect.Height = window.Height;

            window.WindowState = WindowState.Normal; 
            window.WindowStyle = WindowStyle.None;
            window.ResizeMode = ResizeMode.NoResize;
            window.Topmost = true; 

          
            var handle = new WindowInteropHelper(window).Handle; 
            Screen screen = Screen.FromHandle(handle); 
            window.MaxWidth = screen.Bounds.Width;
            window.MaxHeight = screen.Bounds.Height;
            window.WindowState = WindowState.Maximized;
             
            window.Activated += new EventHandler(window_Activated);
            window.Deactivated += new EventHandler(window_Deactivated); 
            _fullWindow = window;
        }
开发者ID:jasenkin,项目名称:Jasen.Framework,代码行数:32,代码来源:WindowExtension.cs


示例2: OnViewLoaded

        /// <summary>
        /// Called when an attached view's Loaded event fires.
        /// </summary>
        /// <param name="view"/>
        protected override void OnViewLoaded(object view)
        {
            base.OnViewLoaded(view);

            _window = Window.GetWindow((DependencyObject)view);

            if (_window == null)
            {
                return;
            }

            _window.StateChanged += OnWindowStateChanged;
            _previousWindowState = _window.WindowState;

            Stream iconStream = IoC.Get<IResourceManager>()
                .GetStream("Resources/GoHome.ico", Assembly.GetExecutingAssembly().GetAssemblyName());

            _taskbarIcon = new TaskbarIcon { Icon = new Icon(iconStream), ToolTipText = "Show main window" };

            _taskbarIcon.TrayMouseDoubleClick += OnTaskbarIconTrayMouseClick;
            _taskbarIcon.TrayLeftMouseDown += OnTaskbarIconTrayMouseClick;
            _taskbarIcon.TrayRightMouseDown += OnTaskbarIconTrayMouseClick;

            if (Settings.Default.StartHiddenToTray)
            {
                _window.WindowState = WindowState.Minimized;
            }
        }
开发者ID:NightyCode,项目名称:GoHome,代码行数:32,代码来源:ShellViewModel.cs


示例3: GoFullScreen

        public static void GoFullScreen(this Window window)
        {
            if (IsFullScreen(window))
            {
                return;
            }

            windowState = window.WindowState;
            windowStyle = window.WindowStyle;
            windowTopmost = window.Topmost;
            windowResizeMode = window.ResizeMode;
            windowRect.X = window.Left;
            windowRect.Y = window.Top;
            windowRect.Width = window.Width;
            windowRect.Height = window.Height;

            window.WindowState = WindowState.Maximized;
            window.WindowStyle = WindowStyle.None;
            windowTopmost = false;
            windowResizeMode = ResizeMode.NoResize;
            IntPtr handle = new WindowInteropHelper(window).Handle;
            Screen screen = Screen.FromHandle(handle);
            window.Width = screen.Bounds.Width;
            window.Height = screen.Bounds.Height;

            fullWindow = window;
        }
开发者ID:AntZhou,项目名称:AntFramework,代码行数:27,代码来源:WindowExpend.cs


示例4: Sdl2NativeWindow

        public Sdl2NativeWindow(int x, int y, int width, int height,
            string title, GameWindowFlags options, DisplayDevice device)
        {
            lock (sync)
            {
                var bounds = device.Bounds;
                var flags = TranslateFlags(options);
                flags |= WindowFlags.OPENGL;
                flags |= WindowFlags.RESIZABLE;
                flags |= WindowFlags.HIDDEN;
                flags |= WindowFlags.ALLOW_HIGHDPI;

                if ((flags & WindowFlags.FULLSCREEN_DESKTOP) != 0 ||
                    (flags & WindowFlags.FULLSCREEN) != 0)
                    window_state = WindowState.Fullscreen;

                IntPtr handle;
                lock (SDL.Sync)
                {
                    EventFilterDelegate = Marshal.GetFunctionPointerForDelegate(EventFilterDelegate_GCUnsafe);
                    handle = SDL.CreateWindow(title, bounds.Left + x, bounds.Top + y, width, height, flags);
                    SDL.AddEventWatch(EventFilterDelegate, handle);
                    SDL.PumpEvents();
                }
                window = new Sdl2WindowInfo(handle, null);
                window_id = SDL.GetWindowID(handle);
                windows.Add(window_id, this);
                window_title = title;

                exists = true;
            }
        }
开发者ID:shahid-pk,项目名称:opentk,代码行数:32,代码来源:Sdl2NativeWindow.cs


示例5: OpenGeovoxIntegrationWindow

	static void OpenGeovoxIntegrationWindow(){
		Resolution res = Screen.currentResolution;
		
		UpdateCurrentSourceDirectory();
		
		if ( window == null ){
			window = ScriptableObject.CreateInstance<AGF_IntegrationWindow>();
			window.ShowUtility();
			
			window.position = new Rect( res.width * 0.25f, res.height * 0.25f, 500.0f, 200 );
			window.title = "Geovox Scene Loader";
			window.maxSize = new Vector2( window.position.width, window.position.height );
			window.minSize = new Vector2( window.position.width, window.position.height );
			window.integrationType = IntegrationType.Geovox;
			
			m_CurrentWindowState = WindowState.ModeSelect;
			
		} else {
			window.Focus();
		}

		lightShadows = (LightShadows)PlayerPrefs.GetInt (Main.gameName + "ShadowType", 2);
		terrainShadows = PlayerPrefs.GetInt (Main.gameName + "TerrainShadowType", 1) == 1;
		grassShadows = PlayerPrefs.GetInt (Main.gameName + "GrassShadowType", 1) == 1;
		prefabShadows = PlayerPrefs.GetInt (Main.gameName + "PrefabShadowType", 1) == 1;
		terrainSpecular = PlayerPrefs.GetInt (Main.gameName + "TerrainSpecular", 1) == 1;
		
		prevRunInBackground = Application.runInBackground;
		Application.runInBackground = true;
	}
开发者ID:Waltari10,项目名称:LifeRitual,代码行数:30,代码来源:AGF_IntegrationWindow.cs


示例6: Read

 public SavedWindowState Read(ISettingsSection section)
 {
     Bounds = section.Attribute<Rect?>("Bounds") ?? Rect.Empty;
     IsFullScreen = section.Attribute<bool?>("IsFullScreen") ?? false;
     WindowState = section.Attribute<WindowState?>("WindowState") ?? WindowState.Normal;
     return this;
 }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:7,代码来源:SavedWindowState.cs


示例7: Initialize

 public static void Initialize()
 {
     _window = CoreWindow.GetForCurrentThread();
     _windowsBounds = _window.Bounds;
     _windowState = WindowState.Full;
     _window.SizeChanged += _window_SizeChanged;
 }
开发者ID:sinmaplewing,项目名称:Hare-TortoiseGame,代码行数:7,代码来源:GameState.cs


示例8: MainWindowAdapter

        public MainWindowAdapter(
            Project project, IFieldPathFactory pathFactory, 
            PresetView preset, StandardView standard, AdvancedView advanced, 
            RetrieveFieldsView fields)
            : base(project)
        {
            _appWidth = Properties.Settings.Default.AppWidth;
            _appHeight = Properties.Settings.Default.AppHeight;
            _appWindowState = Properties.Settings.Default.AppWindowState;
            _viewColumnSize = new GridLength(Properties.Settings.Default.ViewColumnSize);

            Preset = preset;
            Standard = standard;
            Advanced = advanced;
            RetrieveFields = fields;
            _views.Add("Preset", preset.Adapter);
            _views.Add("Standard", standard.Adapter);
            _views.Add("Advanced", advanced.Adapter);

            Preset.Adapter.Search += Adapter_Search;
            Standard.Adapter.Search += Adapter_Search;
            Advanced.Adapter.Search += Adapter_Search;

            ProjectAdapter = new ProjectAdapter(project);
            ProjectAdapter.Project.CurrentConnectionChanged += delegate
            {
                RefreshPaths();
                OnPropertyChanged("ApplicationTitle");
            };
            PathFactory = pathFactory;

            CurrentView = Preset.Adapter;
            SelectedSubjectChanged += delegate { RefreshPaths(); };
            RefreshPaths();
        }
开发者ID:AdamCollings,项目名称:dbqf,代码行数:35,代码来源:MainWindowAdapter.cs


示例9: MainWindow

 Rect rcnormal;                  //定义一个全局rect记录还原状态下窗口的位置和大小。
 public MainWindow()
 {
     InitializeComponent();
     icon();
     //保证窗体显示在上方。 
     wsl = WindowState;
 }
开发者ID:glxySystem,项目名称:MS,代码行数:8,代码来源:MainWindow.xaml.cs


示例10: Restore

        public void Restore(XmlReader reader)
        {
            int count = reader.AttributeCount;
            for (int i = 0; i < count; ++i)
            {
                reader.MoveToAttribute(i);
                switch (reader.Name)
                {
                    case "top":
                        Top = reader.ReadContentAsDouble();
                        break;

                    case "left":
                        Left = reader.ReadContentAsDouble();
                        break;

                    case "width":
                        Width = reader.ReadContentAsDouble();
                        break;

                    case "height":
                        Height = reader.ReadContentAsDouble();
                        break;

                    case "state":
                        State = (WindowState) Enum.Parse(typeof (WindowState), reader.Value);
                        break;
                }
            }
        }
开发者ID:Kittyfisto,项目名称:Tailviewer,代码行数:30,代码来源:WindowSettings.cs


示例11: SetWindowStateHandler

 private static Action<object> SetWindowStateHandler(WindowState newState)
 {
     return o =>
     {
         Window win = ExtractWindowFromParameter(o);
         win.WindowState = newState;
     };
 }
开发者ID:RazorSpy,项目名称:RazorSpy,代码行数:8,代码来源:GlobalWindowCommands.cs


示例12: Window_StateChanged

 private void Window_StateChanged(object sender, EventArgs e)
 {
     if (this.WindowState != System.Windows.WindowState.Minimized)
     {
         FLastRestoreWindowState = this.WindowState;
     }
     
 }
开发者ID:PeterQin,项目名称:HiClock,代码行数:8,代码来源:ShellWindow.xaml.cs


示例13: OnStateChanged

        protected override void OnStateChanged(EventArgs e)
        {
            base.OnStateChanged(e);

            if(this.WindowState != WindowState.Minimized) {
                this.RestoreWindowState = this.WindowState;
            }
        }
开发者ID:catwalkagogo,项目名称:Heron,代码行数:8,代码来源:Window.cs


示例14: OnSceneLoaded

    public static void OnSceneLoaded()
    {
        m_CurrentWindowState = WindowState.ModeSelect;

        if ( window != null ){
            window.Repaint();
        }
    }
开发者ID:photoapp,项目名称:StepIntoGame,代码行数:8,代码来源:AGF_IntegrationWindow.cs


示例15: UpdateFrom

 public void UpdateFrom(MainWindow window)
 {
     Left = window.Left;
     Top = window.Top;
     Width = window.Width;
     Height = window.Height;
     State = window.WindowState;
 }
开发者ID:Kittyfisto,项目名称:Tailviewer,代码行数:8,代码来源:WindowSettings.cs


示例16: FloatingItemSnapShot

        public FloatingItemSnapShot(object content, Rect location, int zIndex, WindowState state)
        {
            if (content == null) throw new ArgumentNullException("content");

            _content = content;
            _location = location;
            _zIndex = zIndex;
            _state = state;
        }
开发者ID:CensoredHF,项目名称:Snappie,代码行数:9,代码来源:FloatingItemSnapShot.cs


示例17: WindowSysMin

        public WindowSysMin(Window wind)
        {
            window = wind;
            window.Closing += window_Closing;
            window.StateChanged += window_StateChanged;
            //保证窗体显示在上方。
            wsl = window.WindowState;

            Init();
        }
开发者ID:zecak,项目名称:CarryBag,代码行数:10,代码来源:WindowSysMin.cs


示例18: Initialize

        public static void Initialize()
        {
            _window = CoreWindow.GetForCurrentThread();
            _windowsBounds = _window.Bounds;
            _windowState = WindowState.Full;
            _window.SizeChanged += _window_SizeChanged;

            CoreApplication.Suspending += CoreApplication_Suspending;
            CoreApplication.Resuming += CoreApplication_Resuming;
        }
开发者ID:epolekoff,项目名称:SynesthesiaChaos,代码行数:10,代码来源:Windows8.cs


示例19: MainWindowLoaded

 private void MainWindowLoaded(object sender, RoutedEventArgs e)
 {
     dgNotifications.Items.SortDescriptions.Add(new SortDescription("StartTime", ListSortDirection.Descending));
     _showStateForNotifyIcon = WindowState;
     UpdateConnectionSring();
     if (miHideAtStart.IsChecked)
     {
         WindowState = WindowState.Minimized;
     }
 }
开发者ID:guozanhua,项目名称:phmi,代码行数:10,代码来源:MainWindow.xaml.cs


示例20: MenuWindow

 public MenuWindow(SpriteFont spriteFont, string menuTitle, Texture2D backgroundImage)
 {
     itemList = new List<MenuItem>();
     changeSpan = TimeSpan.FromMilliseconds(800.0);
     selectedItem = 0;
     changeProgress = 0;
     windowState = WindowState.Inactive;
     this.spriteFont = spriteFont;
     this.menuTitle = menuTitle;
     this.backgroundImage = backgroundImage;
 }
开发者ID:quaat,项目名称:Creature-Fighter,代码行数:11,代码来源:MenuWindow.cs



注:本文中的WindowState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WindowStatus类代码示例发布时间:2022-05-24
下一篇:
C# WindowMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap