Exemplo n.º 1
0
        private void SaveProfilesOkClick(object sender, RoutedEventArgs e)
        {
            var conf = _runningApplication.Services.ProgramConfiguration.TempConfiguration;

            if (conf.ImageReminderEnabled)
            {
                var wnd = new ModernWindow
                {
                    Style          = (Style)App.Current.Resources["BlankWindow"],
                    Title          = $"Just a little reminder...",
                    IsTitleVisible = true,
                    Width          = Int32.Parse(conf.ImageReminderImageWidth) < 410 ? 410 : Int32.Parse(conf.ImageReminderImageWidth),
                    Height         = Int32.Parse(conf.ImageReminderImageHeight) < 400 ? 400 : Int32.Parse(conf.ImageReminderImageHeight),
                };
                wnd.Content               = new ImageReminderView(wnd, this);
                wnd.ResizeMode            = ResizeMode.CanResize;
                wnd.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                wnd.Closing              += OnImageReminderWindowClosing;
                wnd.Show();

                _runningApplication.UI.MainView.IsInEntryEditingMode = true;
                _runningApplication.UI.MainView.Hide();
            }
            else
            {
                SaveProfiles();
            }
        }
Exemplo n.º 2
0
        void SelectProject()
        {
            if (GlobalVars.projectFile == "")
            {
                SelectProjectPage = new ModernWindow
                {
                    Style   = (Style)App.Current.Resources["EmptyWindow"],
                    Content = new Pages.SelectProject
                    {
                        Margin = new Thickness(32)
                    },
                    ResizeMode = System.Windows.ResizeMode.NoResize,
                    MaxWidth   = 650,
                    Title      = "FPSDesigner - Select a project",
                    MaxHeight  = 200,
                    Icon       = GlobalVars.SoftwareIcon
                };
                SelectProjectPage.Closing += (s, e) => { if (GlobalVars.projectFile == "")
                                                         {
                                                             Application.Current.Shutdown();
                                                         }
                };

                ((Pages.SelectProject)SelectProjectPage.Content).ProjectSelected += App_ProjectSelected;

                SelectProjectPage.Show();
            }
            else
            {
                Software.MainWindow.Instance.Show();
            }
        }
Exemplo n.º 3
0
        private void App_Startup(object sender, StartupEventArgs e)
        {
            // Try to deserialize server settings
            try
            {
                GlobalVars.serverInfo = Codes.CXMLManager.deserializeClass <Codes.ServerInfo>(GlobalVars.SettingsFile);
            }
            catch
            {
                GlobalVars.serverInfo = GlobalVars.defaultServerInfo();
            }

            PropertiesPage = new ModernWindow
            {
                Style   = (Style)App.Current.Resources["EmptyWindow"],
                Content = new Pages.Properties
                {
                    Margin = new Thickness(32)
                },
                ResizeMode = System.Windows.ResizeMode.NoResize,
                MaxWidth   = 500,
                Title      = "Server Properties",
                MaxHeight  = 320,
                Icon       = GlobalVars.SoftwareIcon
            };

            ((Pages.Properties)PropertiesPage.Content).PropertiesSet += App_PropertiesSet;
            PropertiesPage.Closing += ModernWindow_Closed;

            PropertiesPage.Show();

            WinServer.MainWindow.LoadMainWindow();
        }
Exemplo n.º 4
0
        private void saveCurrentFile()
        {
            if ((string)selectedButton.Content != newScriptName)
            {
                if (File.Exists("Scripts/" + selectedButton.Content))
                {
                    System.IO.File.WriteAllText("Scripts/" + selectedButton.Content, textEditor.Text);

                    DoubleAnimation opacityAnim = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromMilliseconds(500)));
                    checkValidSave.BeginAnimation(OpacityProperty, opacityAnim);

                    Timer timerResetCheck = new Timer(2000);
                    timerResetCheck.Elapsed += timerResetCheck_Elapsed;
                    timerResetCheck.Enabled  = true;
                }
            }
            else
            {
                textboxDialog = new ModernWindow
                {
                    Style   = (Style)App.Current.Resources["EmptyWindow"],
                    Content = new TextboxDialog
                    {
                        Margin = new Thickness(32),
                    },
                    MaxHeight  = 100,
                    MaxWidth   = 635,
                    ResizeMode = ResizeMode.NoResize
                };

                textboxDialog.Show();

                ((Pages.TextboxDialog)textboxDialog.Content).EnteredText += CodeEditor_EnteredText;
            }
        }
Exemplo n.º 5
0
        private void btn_Web_Click(object sender, RoutedEventArgs e)
        {
            ModernWindow mw = new ModernWindow();

            WebBrowser wb = new WebBrowser();

            mw.Content = wb;

            wb.Navigate("http://mp.weixin.qq.com/s?__biz=MzAxMzI4MTUxMw==&mid=204472346&idx=1&sn=97445b23d97c280fa920134d2348a298&scene=2#rd");
            mw.Show();
        }
        private void EmptyWindow_Clicked(object sender, RoutedEventArgs e)
        {
            var wnd = new ModernWindow
            {
                Style   = (Style)App.Current.Resources["EmptyWindow"],
                Content = "Hellolllll",
                Height  = 200,
                Width   = 300,
            };

            wnd.Show();
        }
Exemplo n.º 7
0
        private void SettingButton_Click(object sender, RoutedEventArgs e)
        {
            var wnd = new ModernWindow
            {
                Style          = (Style)App.Current.Resources["BlankWindow"],
                Title          = "设置",
                IsTitleVisible = true,
                Content        = new SettingsPage(),
                Width          = 480,
                Height         = 480
            };

            wnd.Show();
        }
Exemplo n.º 8
0
        private void EmptyWindow_Click(object sender, RoutedEventArgs e)
        {
            // create an empty modern window with lorem content
            // the EmptyWindow ModernWindow styles is found in the mui assembly at Assets/ModernWindowEx.xaml

            var wnd = new ModernWindow {
                Style   = (Style)App.Current.Resources["EmptyWindow"],
                Content = new LoremIpsum {
                    Margin = new Thickness(32)
                },
                Width  = 480,
                Height = 480
            };

            wnd.Show();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Compares two or three process models
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <author>Thomas Meents, Christopher Licht</author>
        private void CompareClick(object sender, RoutedEventArgs e)
        {
            switch (ListOfChoosenProcessModels.Count)
            {
            case 2:
            {
                try
                {
                    IDifference diff = DiffFactory.CreateDifferenceObject <SnapshotDiff>();

                    Field diffField = new Field
                    {
                        ProcessModel = diff.CompareProcessModels(ListOfChoosenProcessModels)
                    };
                    if (diffField.ProcessModel != null && diffField.ProcessModel.GetType() == typeof(PetriNet))
                    {
                        String title = String.Join(", ", ListOfChoosenProcessModels.Select(pm => pm.Name));

                        ModernWindow pmDiffWindow = new ModernWindow
                        {
                            Style  = (Style)Application.Current.Resources["EmptyWindow"],
                            Width  = 1000,
                            Height = 600,
                            Owner  = Application.Current.MainWindow,
                            Title  = title
                        };
                        pmDiffWindow.Content = new PMViewer(diffField, pmDiffWindow, true, title);
                        pmDiffWindow.Show();
                    }
                }
                catch (Exception Ex)
                {
                    ErrorHandling.ReportErrorToUser("Error: " + Ex.Message);
                }
            }
            break;

            case 0:
                ModernDialog.ShowMessage("No process model checkboxes are checked", "Tip", MessageBoxButton.OK);
                break;

            default:
                ModernDialog.ShowMessage("Only two process models can be compared.\nCheck some checkboxes and click Compare to see the differences.", "Tip", MessageBoxButton.OK);
                break;
            }
        }
Exemplo n.º 10
0
        protected override void OnStartup(StartupEventArgs e)
        {
            SetupLogger();

            base.OnStartup(e);

            mainWindow = new Window1();

            navigator = new NavigationService(mainWindow);
            var composer = new PageComposer(navigator);

            mainWindow.ContentLoader = new MyContentLoader(composer);
            mainWindow.Show();

            DisablePageCachingByDefaultInWindow(mainWindow);

            navigator.NavigateTo("MainMenu");
        }
Exemplo n.º 11
0
        void App_NeedRegister(object sender, RoutedEventArgs e)
        {
            RegisterPage = new ModernWindow
            {
                Style   = (Style)App.Current.Resources["EmptyWindow"],
                Content = new Pages.Register
                {
                    Margin = new Thickness(32)
                },
                ResizeMode = System.Windows.ResizeMode.NoResize,
                MaxWidth   = 650,
                Title      = "FPSDesigner - Register",
                MaxHeight  = 430,
                Icon       = GlobalVars.SoftwareIcon
            };
            RegisterPage.Closing += ModernWindow_Closed;
            ((Pages.Register)RegisterPage.Content).RegisterSucceed += App_RegisterSucceed;
            RegisterPage.Show();

            LoginPage.Close();
        }
Exemplo n.º 12
0
        void BlankWindow_Click(object sender, RoutedEventArgs e)
        {
            // create a blank modern window with lorem content
            // the BlankWindow ModernWindow styles is found in the mui assembly at Assets/ModernWindowStyles.xaml

            ModernWindow wnd = new ModernWindow
            {
                Style          = (Style)Application.Current.Resources["BlankWindow"],
                Title          = "ModernWindow",
                IsTitleVisible = true == title.IsChecked,
                Content        = new LoremIpsum(),
                Width          = 480,
                Height         = 480
            };

            if (true == logo.IsChecked)
            {
                wnd.LogoData =
                    Geometry.Parse(
                        "F1 M 24.9015,43.0378L 25.0963,43.4298C 26.1685,49.5853 31.5377,54.2651 38,54.2651C 44.4623,54.2651 49.8315,49.5854 50.9037,43.4299L 51.0985,43.0379C 51.0985,40.7643 52.6921,39.2955 54.9656,39.2955C 56.9428,39.2955 58.1863,41.1792 58.5833,43.0379C 57.6384,52.7654 47.9756,61.75 38,61.75C 28.0244,61.75 18.3616,52.7654 17.4167,43.0378C 17.8137,41.1792 19.0572,39.2954 21.0344,39.2954C 23.3079,39.2954 24.9015,40.7643 24.9015,43.0378 Z M 26.7727,20.5833C 29.8731,20.5833 32.3864,23.0966 32.3864,26.197C 32.3864,29.2973 29.8731,31.8106 26.7727,31.8106C 23.6724,31.8106 21.1591,29.2973 21.1591,26.197C 21.1591,23.0966 23.6724,20.5833 26.7727,20.5833 Z M 49.2273,20.5833C 52.3276,20.5833 54.8409,23.0966 54.8409,26.197C 54.8409,29.2973 52.3276,31.8106 49.2273,31.8106C 46.127,31.8106 43.6136,29.2973 43.6136,26.197C 43.6136,23.0966 46.127,20.5833 49.2273,20.5833 Z");
            }
            if (true == noresize.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.NoResize;
            }
            else if (true == canminimize.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.CanMinimize;
            }
            else if (true == canresize.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.CanResize;
            }
            else if (true == canresizewithgrip.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.CanResizeWithGrip;
            }

            wnd.Show();
        }
Exemplo n.º 13
0
        private void ShowLoginPage()
        {
            LoginPage = new ModernWindow
            {
                Style   = (Style)App.Current.Resources["EmptyWindow"],
                Content = new Pages.Login
                {
                    Margin = new Thickness(32)
                },
                ResizeMode = System.Windows.ResizeMode.NoResize,
                MaxWidth   = 850,
                Title      = "FPSDesigner - Login",
                MaxHeight  = 320,
                Icon       = GlobalVars.SoftwareIcon
            };

            ((Pages.Login)LoginPage.Content).LoginSucceed += App_LoginSucceed;
            ((Pages.Login)LoginPage.Content).NeedRegister += App_NeedRegister;
            LoginPage.Closing += ModernWindow_Closed;

            LoginPage.Show();
        }
        private void EntryEditButton_Click(object sender, RoutedEventArgs e)
        {
            Entry currentEntry = CurrentProfile.EntryList[EntryList.SelectedIndex];

            var wnd = new ModernWindow
            {
                Style          = (Style)App.Current.Resources["BlankWindow"],
                Title          = $"Edit entry from profile \"{CurrentProfile.ProfileName}\"",
                IsTitleVisible = true,
                Width          = 410,
                Height         = 400
            };

            wnd.Content               = new EditEntry(currentEntry, wnd);
            wnd.ResizeMode            = ResizeMode.NoResize;
            wnd.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            wnd.Closing              += OnEditWindowClosing;
            wnd.Show();

            _runningApplication.UI.MainView.IsInEntryEditingMode = true;
            _runningApplication.UI.MainView.Hide();
        }
Exemplo n.º 15
0
        public void SwitchWindow(string windowId)
        {
            var windows = Application.Current.Windows;

            for (int i = 0; i < windows.Count; i++)
            {
                var w = windows[i];
                if (windowId.Equals(w.Tag))
                {
                    w.Activate();
                    return;
                }
            }

            if (windowId == "Settings")
            {
                var w = new SettingsWindow {
                    DataContext = CreateSettingViews()
                };
                InitWindow(w);
                w.Show();
                w.Activate();
            }

            var view = layout[windowId];

            if (view != null)
            {
                var w = new ModernWindow
                {
                    Tag     = windowId,
                    Title   = localization.GetLocalized("ViewTitle", windowId) ?? windowId,
                    Content = view.LoadContent(),
                };
                InitWindow(w);
                w.Show();
                w.Activate();
            }
        }
Exemplo n.º 16
0
        private void BlankWindow_Click(object sender, RoutedEventArgs e)
        {
            // create a blank modern window with lorem content
            // the BlankWindow ModernWindow styles is found in the mui assembly at Assets/ModernWindowEx.xaml

            var wnd = new ModernWindow
            {
                Style          = (Style)App.Current.Resources["BlankWindow"],
                Title          = "ModernWindow",
                IsTitleVisible = true == this.title.IsChecked,
                Content        = new LoremIpsum(),
                Width          = 480,
                Height         = 480
            };

            if (true == this.logo.IsChecked)
            {
                wnd.LogoData = PathGeometry.Parse("M 43.8489,37.2997C 43.8489,37.2997 44.2106,34.8791 45.6137,34.8791C 47.0177,34.8791 48.9456,38.1112 48.9456,38.1112C 48.9456,38.1112 44.5479,37.2997 43.8489,37.2997 Z M 51.2373,24.1416C 50.5825,23.013 47.1567,21.7126 45.3788,21.7126C 43.6029,21.7126 40.7975,21.7126 40.7975,21.7126C 40.7975,21.7126 39.3265,19.0499 35.8683,19.0499C 32.4072,19.0499 32.6401,20.5925 32.6401,21.9097L 32.6401,27.2347L 31.0714,28.8905L 23.8278,28.8905C 23.8278,28.8905 21.7871,30.2401 21.7871,33.1576C 21.7871,36.0751 22.6925,46.2416 28.7717,47.1819C 35.9643,48.2962 37.1957,44.9534 37.1957,44.5517C 37.1957,42.8588 37.2382,40.2938 37.2382,40.2938C 37.2382,40.2938 39.3446,44.318 42.5253,44.318C 45.706,44.318 47.5555,46.1452 47.5555,48.0263C 47.5555,49.9095 47.5555,51.5081 47.5555,51.5081C 47.5555,51.5081 47.4372,53.6873 45.5678,53.6873C 43.6956,53.6873 41.5761,53.6873 41.5761,53.6873C 41.5761,53.6873 40.266,52.667 40.266,51.2558C 40.266,49.8451 40.9065,49.4619 41.6544,49.4619C 42.4019,49.4619 43.0163,49.5487 43.0163,49.5487L 43.0163,46.5806C 43.0163,46.5806 36.9923,46.5414 36.9923,51.1539C 36.9923,55.7651 40.1426,56.9501 42.6685,56.9501C 45.1918,56.9501 46.7832,56.9501 46.7832,56.9501C 46.7832,56.9501 54.2129,55.9946 54.2129,41.3163C 54.2129,26.6363 51.8925,25.271 51.2373,24.1416 Z M 29.475,27.2174L 23.3318,27.2107L 31.0285,19.4668L 31.0302,25.7124L 29.475,27.2174 Z ");
            }
            if (true == this.noresize.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.NoResize;
            }
            else if (true == this.canminimize.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.CanMinimize;
            }
            else if (true == this.canresize.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.CanResize;
            }
            else if (true == this.canresizewithgrip.IsChecked)
            {
                wnd.ResizeMode = ResizeMode.CanResizeWithGrip;
            }

            wnd.Show();
        }