当前位置: 首页>>代码示例>>C#>>正文


C# WindowState类代码示例

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


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


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