Exemple #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ContentWindow contentWindow = new ContentWindow();

            NavigationModel navigationModel = new NavigationModel(contentWindow);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            navigationModel.Navigate(ModesEnum.Main);

            Current.MainWindow.Closing += (s, a) =>
            {
                if (MessageBox.Show("Вийти?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    StationManager.InvokeStopThreads();
                    Environment.Exit(0);
                }
                else
                {
                    a.Cancel = true;
                }
            };
        }
Exemple #2
0
 public NavigationModel(ContentWindow contentWindow, Storage storage)
 {
     _contentWindow = contentWindow;
     _loginView     = new LoginView(storage);
     _signUpView    = new SignUpView(storage);
     _mainView      = new MainView(storage);
 }
Exemple #3
0
 public void DefaultAction()
 {
     if (Data.Type == EventTypes.Click)
     {
         WrappedObject     tempTarget    = Target;
         HTMLAnchorElement anchorElement = tempTarget as HTMLAnchorElement;
         tempTarget = tempTarget.Parent;
         while (anchorElement == null && tempTarget != null)
         {
             anchorElement = tempTarget as HTMLAnchorElement;
             tempTarget    = tempTarget.Parent;
         }
         if (anchorElement != null)
         {
             string newHref = anchorElement.Href;
             if (newHref != null)
             {
                 ContentWindow window = mdr.Runtime.Instance.GlobalContext as ContentWindow;
                 Debug.Assert(window != null, "In handling the default action for Click Content Window cannot be retrived!");
                 if (window != null)
                 {
                     Location loc = window.Location;
                     Debug.Assert(loc != null, "In handling the default action for Click Content Window location cannot be retrived!");
                     if (loc != null)
                     {
                         loc.Href = newHref;
                         Debug.WriteLine("Setting href of window location to {0}", newHref);
                     }
                 }
             }
         }
     }
 }
 public StudentClasses(ContentWindow window, Model.studenci student)
 {
     _student = student;
     _window  = window;
     InitializeComponent();
     UpdateView();
 }
        /// <inheritdoc />
        public override void OnInit()
        {
            Assert.IsNull(MainWindow);

            _windowsLayoutPath = StringUtils.CombinePaths(Globals.ProjectCacheFolder, "WindowsLayout.xml");

            // Create main window
            var dpiScale = Platform.DpiScale;
            var settings = CreateWindowSettings.Default;

            settings.Title         = "Flax Editor";
            settings.Size          = new Vector2(1300 * dpiScale, 900 * dpiScale);
            settings.StartPosition = WindowStartPosition.CenterScreen;

            if (!Editor.Instance.Options.Options.Interface.UseNativeWindowSystem)
            {
                settings.HasBorder      = false;
                settings.HasSizingFrame = false;
            }

            MainWindow = Window.Create(settings);

            if (MainWindow == null)
            {
                // Error
                Editor.LogError("Failed to create editor main window!");
                return;
            }
            UpdateWindowTitle();

            // Link for main window events
            MainWindow.Closing += MainWindow_OnClosing;
            MainWindow.Closed  += MainWindow_OnClosed;

            // Create default editor windows
            ContentWin         = new ContentWindow(Editor);
            EditWin            = new EditGameWindow(Editor);
            GameWin            = new GameWindow(Editor);
            PropertiesWin      = new PropertiesWindow(Editor);
            SceneWin           = new SceneTreeWindow(Editor);
            DebugLogWin        = new DebugLogWindow(Editor);
            OutputLogWin       = new OutputLogWindow(Editor);
            ToolboxWin         = new ToolboxWindow(Editor);
            GraphicsQualityWin = new GraphicsQualityWindow(Editor);
            GameCookerWin      = new GameCookerWindow(Editor);
            ProfilerWin        = new ProfilerWindow(Editor);
            EditorOptionsWin   = new EditorOptionsWindow(Editor);
            PluginsWin         = new PluginsWindow(Editor);

            // Bind events
            SceneManager.SceneSaveError     += OnSceneSaveError;
            SceneManager.SceneLoaded        += OnSceneLoaded;
            SceneManager.SceneLoadError     += OnSceneLoadError;
            SceneManager.SceneLoading       += OnSceneLoading;
            SceneManager.SceneSaved         += OnSceneSaved;
            SceneManager.SceneSaving        += OnSceneSaving;
            SceneManager.SceneUnloaded      += OnSceneUnloaded;
            SceneManager.SceneUnloading     += OnSceneUnloading;
            ScriptsBuilder.ScriptsReloadEnd += OnScriptsReloadEnd;
        }
        public SupervisorClassBlade(SupervisorClassesPage supervisorClassesPage, ContentWindow window)
        {
            _window = window;
            _page   = supervisorClassesPage;
            InitializeComponent();

            SubjectComboViewModel vmComboSubject = new SubjectComboViewModel();

            foreach (var item in vmComboSubject.Subject)
            {
                SubjectCombo.Items.Add(item);
            }

            TeacherComboViewModel vmComboTeacher = new TeacherComboViewModel();

            TeacherCombo.ItemsSource = vmComboTeacher.Teacher;

            ClassTypeComboViewModel vmComboClassType = new ClassTypeComboViewModel();

            ClassTypeCombo.ItemsSource = vmComboClassType.ClassType;

            GroupComboViewModel vmCombo = new GroupComboViewModel();

            GroupCombo.ItemsSource = vmCombo.Group;
        }
Exemple #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ContentWindow   contentWindow   = new ContentWindow();
            NavigationModel navigationModel = new NavigationModel(contentWindow);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            if (AUTHORIZATION_STUB != null)
            {
                var authResp = HotelApiClient.GetInstance().Login(AUTHORIZATION_STUB.Login, AUTHORIZATION_STUB.Password);
                if (authResp != null)
                {
                    var userRole = authResp.User.Role;
                    Storage.Instance.ChangeUser(new User(LoginModel.RightsDictionary[userRole]));

                    NavigationManager.Instance.Navigate(ModesEnum.Main);
                }
            }
            else
            {
                navigationModel.Navigate(ModesEnum.Login);
            }
        }
Exemple #8
0
 public NavigationModel(Storage storage, ContentWindow contentWindow)
 {
     _storage       = storage;
     _contentWindow = contentWindow;
     _welcomeView   = new WelcomeView(storage);
     _mainView      = new MainView(storage);
 }
 public NavigationModel(ContentWindow contentWindow)
 {
     _contentWindow = contentWindow;
     _loginView     = new LoginView();
     _mainView      = new MainView();
     _settingsView  = new SettingsView();
 }
 public NavigationModel(ContentWindow contentWindow, Storage storage)
 {
     _contentWindow = contentWindow;
     _mainView      = new MainView(storage);
     _addUserView   = new AddUserView(storage);
     _editUserView  = new EditUserView(storage);
 }
Exemple #11
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ContentWindow contentWindow = new ContentWindow();

            contentWindow.Show();
            contentWindow.ContentControl.Content = new MainView();
        }
Exemple #12
0
        public SupervisorMenu(ContentWindow window)
        {
            _window = window;



            InitializeComponent();
        }
 public TeacherProjectsPage(Model.prowadzacy teacher, ContentWindow window)
 {
     _teacher           = teacher;
     _window            = window;
     _newProjectTeacher = new Blades.TeacherNewProjectBlade(teacher, this);  //Tutaj inicjalizacja
     InitializeComponent();
     UpdateProjectsView();
 }
        public SupervisorClassesPage(ContentWindow window)
        {
            _window        = window;
            _newClassBlade = new Blades.SupervisorNewClassBlade(this);
            _classBlade    = new Blades.SupervisorClassBlade(this, _window);
            InitializeComponent();

            UpdateClassView();
        }
Exemple #15
0
        public TeacherMenu(ContentWindow window, Model.prowadzacy teacher)
        {
            _window  = window;
            _teacher = teacher;



            InitializeComponent();
        }
Exemple #16
0
 /// <summary>
 /// Opens a new window and display the provided content.
 /// </summary>
 /// <param name="content">The content to display.</param>
 /// <param name="options">The options used to configure the host <see cref="UnityEditor.EditorWindow"/></param>
 /// <exception cref="ArgumentNullException">The content cannot be <see langword="null"/>.</exception>
 /// <typeparam name="T">The typeof the content. Must be default constructable.</typeparam>
 public static void ShowInWindow <T>(T content, ContentWindowParameters options)
     where T : ContentProvider, new()
 {
     if (EqualityComparer <T> .Default.Equals(content, default))
     {
         throw new ArgumentNullException(nameof(content));
     }
     ContentWindow.Show(content, options);
 }
    public virtual IWindow CreateChild(object viewModel)
    {
        var cw = new ContentWindow();

        cw.Owner       = this.wpfWindow;
        cw.DataContext = viewModel;
        WindowAdapter.ConfigureBehavior(cw);
        return(new WindowAdapter(cw));
    }
Exemple #18
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            ContentWindow   contentWindow   = new ContentWindow();
            NavigationModel navigationModel = new NavigationModel(contentWindow);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            navigationModel.Navigate(ModesEnum.Calendar);
        }
Exemple #19
0
 /// <summary>
 /// Opens a new window and display the provided <see cref="UnityEngine.Object"/>.
 /// </summary>
 /// <param name="content">The <see cref="UnityEngine.Object"/> to display.</param>
 /// <param name="options">The options used to configure the host <see cref="UnityEditor.EditorWindow"/></param>
 /// <exception cref="ArgumentNullException">The content cannot be <see langword="null"/>.</exception>
 public static void ShowInWindow(UnityEngine.Object content, ContentWindowParameters options)
 {
     if (null == content || !content)
     {
         throw new ArgumentNullException(nameof(content));
     }
     ContentWindow.Show(new UnityObjectContentProvider {
         Object = content
     }, options);
 }
Exemple #20
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     Storage storage = new Storage();
     ContentWindow contentWindow = new ContentWindow();
     NavigationModel navigationModel = new NavigationModel(contentWindow, storage);
     NavigationManager.Instance.Initialize(navigationModel);
     contentWindow.Show();
     navigationModel.Navigate();
 }
Exemple #21
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            UserInfoModel   userInfoModel   = new UserInfoModel();
            ContentWindow   contentWindow   = new ContentWindow();
            NavigationModel navigationModel = new NavigationModel(contentWindow, userInfoModel);

            NavigationManager.Instance.Initialize(navigationModel);
            contentWindow.Show();
            navigationModel.Navigate(ViewsEnum.Start);
        }
Exemple #22
0
        private void XmlContentDisplayDialog_FormClosing(object sender, FormClosingEventArgs e)
        {
            var windowSettings = new ContentWindow
            {
                LiveUpdate     = chkLiveUpdate.Checked,
                FormatExpanded = gbFormatting.IsExpanded(),
                ActionExpanded = gbActions.IsExpanded()
            };

            fxb.settings.ContentWindows.SetContentWindow(contenttype, windowSettings);
        }
 public NavigationModel(ContentWindow contentWindow)
 {
     _contentWindow  = contentWindow;
     _mainView       = new MainView();
     _settingsView   = new SettingsView();
     _bookingView    = new BookingView();
     _payView        = new PayView();
     _reportView     = new ReportView();
     _addBookingView = new AddBookingView();
     _clientView     = new ClientView();
     _personnelView  = new PersonnelView();
 }
Exemple #24
0
        /// <inheritdoc />
        public override void OnInit()
        {
            Assert.IsNull(MainWindow);

            _windowsLayoutPath = StringUtils.CombinePaths(Globals.ProjectCacheFolder, "WindowsLayout.xml");

            // Create main window
            var settings = CreateWindowSettings.Default;

            settings.Title         = "Flax Editor";
            settings.Size          = new Vector2(1300, 900);
            settings.StartPosition = WindowStartPosition.CenterScreen;
            MainWindow             = Window.Create(settings);
            if (MainWindow == null)
            {
                // Error
                Debug.LogError("Failed to create editor main window!");
                return;
            }
            UpdateWindowTitle();

            // Link for main window events
            MainWindow.OnClosing += MainWindow_OnClosing;
            MainWindow.OnClosed  += MainWindow_OnClosed;

            // Create default editor windows
            ContentWin         = new ContentWindow(Editor);
            EditWin            = new EditGameWindow(Editor);
            GameWin            = new GameWindow(Editor);
            PropertiesWin      = new PropertiesWindow(Editor);
            SceneWin           = new SceneTreeWindow(Editor);
            DebugWin           = new DebugLogWindow(Editor);
            ToolboxWin         = new ToolboxWindow(Editor);
            GraphicsQualityWin = new GraphicsQualityWindow(Editor);
            GameCookerWin      = new GameCookerWindow(Editor);
            ProfilerWin        = new ProfilerWindow(Editor);
            EditorOptionsWin   = new EditorOptionsWindow(Editor);

            // Bind events
            SceneManager.SceneSaveError += OnSceneSaveError;
            SceneManager.SceneLoaded    += OnSceneLoaded;
            SceneManager.SceneLoadError += OnSceneLoadError;
            SceneManager.SceneLoading   += OnSceneLoading;
            SceneManager.SceneSaved     += OnSceneSaved;
            SceneManager.SceneSaving    += OnSceneSaving;
            SceneManager.SceneUnloaded  += OnSceneUnloaded;
            SceneManager.SceneUnloading += OnSceneUnloading;
        }
Exemple #25
0
        /// <summary>
        /// 判断当前是否已经打开此窗体,如果已经打开则返回该窗体,否则返回空
        /// </summary>
        private ContentWindow HasOpenedWindow(string windowName)
        {
            ContentWindow hasOpenedWindow = null;

            _OpenedWindows = System.Windows.Application.Current.Windows;

            foreach (Window window in _OpenedWindows)
            {
                if (window is ContentWindow && window.Title == windowName)
                {
                    hasOpenedWindow = window as ContentWindow;
                }
            }

            return(hasOpenedWindow);
        }
Exemple #26
0
        public void ShowWindow <T>(T windowContext) where T : IWindowContext
        {
            var window = new ContentWindow();

            windowContext.SetCloseAction(() => RunOnUi(window.Close));
            window.DataContext = windowContext;
            window.Owner       = CurrentWindow;


            _windows.Push(window);
            OnPropertyChanged(nameof(CurrentWindow));

            window.ShowDialog();

            _windows.Pop();
            OnPropertyChanged(nameof(CurrentWindow));
        }
 /// <summary>
 /// 返回加载视图
 /// </summary>
 /// <param name="element">返回的元素</param>
 protected void LoadUICallBack(Watch_ViewBase element)
 {
     try
     {
         ContentWindow window = new ContentWindow();
         window.ContentAdd(element);
         window.Title = element.Title;
         window.Window_Show();
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
     finally
     {
     }
 }
Exemple #28
0
 private void Button_Add_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         AddNoteVM     addVM   = new AddNoteVM(this.connector);
         AddNoteVC     addNote = new AddNoteVC(addVM);
         ContentWindow window  = new ContentWindow("Add Note", addNote);
         window.SetIcon("addIcon");
         window.SetSize(500, 500);
         window.ShowDialog();
         this.mainVM.RefreshNotes();
     }
     catch (Exception ex)
     {
         MainVC.logFile.Error(ex);
         MessageBox.Show(ex.Message);
     }
 }
Exemple #29
0
        private NcHitTest HandleNcHitTest(IntPtr hWnd, IntPtr lParam)
        {
            Point screenPoint = lParam.ToPoint();
            Point windowPoint = ContentWindow.PointFromScreen(screenPoint);
            var   capH        = (double)WindowCaptionHeightConverter.Instance.Convert(Chrome.GetCaptionHeight(ContentWindow), typeof(Double), null, CultureInfo.CurrentCulture);
            //double capH = (windowCapH > -1 ? windowCapH : ContentWindow.ActualHeight);

            NcHitTest location = NcHitTest.HTCLIENT;
            var       hitTest  = ContentWindow.InputHitTest(windowPoint);

            if (hitTest != null && (windowPoint.Y <= capH || Chrome.GetIsCaption(hitTest)) &&
                !Chrome.GetIsHitTestVisible(hitTest))
            {
                location = NcHitTest.HTCAPTION;
                if (windowPoint.Y <= 40)
                {
                    // check for sysmenu style
                    if (((WindowStyles)User32.GetWindowLong(hWndContent, CommonWin32.WindowClasses.WindowLong.GWL_STYLE)).HasFlag(WindowStyles.WS_SYSMENU))
                    {
                        if (ContentWindow.FlowDirection == System.Windows.FlowDirection.LeftToRight)
                        {
                            if (windowPoint.X <= 40)
                            {
                                location = NcHitTest.HTSYSMENU;
                            }
                        }
                        else if (windowPoint.X >= (ContentWindow.ActualWidth - 40))
                        {
                            location = NcHitTest.HTSYSMENU;
                        }
                    }
                }
            }

            if (_resizeGrip != null && _resizeGrip.Visibility == System.Windows.Visibility.Visible &&
                VisualTreeHelper.HitTest(_resizeGrip, _resizeGrip.PointFromScreen(screenPoint)) != null)
            {
                location = _resizeGrip.FlowDirection == System.Windows.FlowDirection.LeftToRight ?
                           NcHitTest.HTBOTTOMRIGHT : NcHitTest.HTBOTTOMLEFT;
            }

            //Debug.WriteLine(location);
            return(location);
        }
Exemple #30
0
        private void RescaleForDpi()
        {
            var test = Shcore.ProcessDpiAwareness;

            if (test == CommonWin32.HighDPI.PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE)
            {
                var child = VisualTreeHelper.GetChild(ContentWindow, 0) as FrameworkElement;
                if (child != null)
                {
                    DpiEvents.ScaleElement(child, _dpiScaleFactor, true);
                }
            }

            var dpiArgs = new DpiChangeEventArgs(ContentWindow, _monitorDPI, _dpiScaleFactor);

            ContentWindow.RaiseEvent(dpiArgs);
            DpiEvents.SetWindowDpi(ContentWindow, dpiArgs.NewDpi);
            DpiEvents.SetWindowDpiScale(ContentWindow, dpiArgs.Scale);
        }