Exemplo n.º 1
0
        private void Navigate(string executionResultRunId)
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;
            Uri          u1 = new Uri(String.Format("/ExecutionResultsView.xaml#executionResultRunId={0}", executionResultRunId), UriKind.Relative);

            mw.ContentSource = u1;
        }
Exemplo n.º 2
0
        private async void PrintPackingListAction(object obj)
        {
            var list = await MainVM.ManifestOutgoingCollection.GetPackingList(SelectedItem.Id);

            var config  = HelperPrint.GetReportSetting();
            var sources = new List <Microsoft.Reporting.WinForms.ReportDataSource>()
            {
                new Microsoft.Reporting.WinForms.ReportDataSource()
                {
                    Name = "DataSet1", Value = list
                },
                new Microsoft.Reporting.WinForms.ReportDataSource()
                {
                    Name = "Config", Value = config
                }
            };

            var content = new Reports.Contents.ReportContent(sources,
                                                             "TrireksaApp.Reports.Layouts.PackingListLayout.rdlc", null);
            var dlg = new ModernWindow
            {
                Content     = content,
                Title       = "Bukti Titipan Kapal",
                Style       = (Style)App.Current.Resources["BlankWindow"],
                ResizeMode  = System.Windows.ResizeMode.CanResizeWithGrip,
                WindowState = WindowState.Maximized,
            };

            dlg.ShowDialog();
        }
Exemplo n.º 3
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.º 4
0
        public LoginPage()
        {
            InitializeComponent();



            viewModel        = new LoginViewModel();
            this.DataContext = viewModel;
            OkButton.Width   = 80;
            OkButton.Height  = 30;
            OkButton.Content = "Login";



            CancelButton.Height = 30;
            CancelButton.Width  = 80;


            mainWindow       = MainWindow.mainWindow;
            OkButton.Command = viewModel.LoginCommand;
            OkButton.Click  += LoginButton_Click;

            Buttons = null;
            Buttons = new List <Button>()
            {
                OkButton, CancelButton
            };

            ShowDialog();
        }
Exemplo n.º 5
0
        private void PreviewAction()
        {
            var listSource = new List <Microsoft.Reporting.WinForms.ReportDataSource>();
            var setting    = HelperPrint.GetReportSetting();

            setting.FirstOrDefault().SignName = ResourcesBase.User.FullName ?? ResourcesBase.User.UserName;
            listSource.Add(new Microsoft.Reporting.WinForms.ReportDataSource()
            {
                Value = Manifest.Source, Name = "DataSet1"
            });
            listSource.Add(new Microsoft.Reporting.WinForms.ReportDataSource()
            {
                Value = setting, Name = "Config"
            });

            var content = new Reports.Contents.ReportContent(listSource,
                                                             "TrireksaApp.Reports.Layouts.ManifestOutgoingLayout.rdlc", null);
            var dlg = new ModernWindow
            {
                Content     = content,
                Title       = "Manifest Outgoing",
                Style       = (Style)App.Current.Resources["BlankWindow"],
                ResizeMode  = System.Windows.ResizeMode.CanResizeWithGrip,
                WindowState = WindowState.Maximized,
            };

            dlg.ShowDialog();
        }
Exemplo n.º 6
0
 private void OK_Click(object sender, RoutedEventArgs e)
 {
     if (name.Text == "")
     {
         TextBox t = new TextBox();
         errorDialog = new PromptDialog("Error", ModernWindow.GetWindow(this));
         errorDialog.AddColoredHeader("Invalid Name");
         errorDialog.AddTextBlock("Please enter a valid name.");
         errorDialog.ShowDialog();
         if (errorDialog.DialogResult == true && t.Text != "")
         {
             a.name = t.Text;
         }
         else
         {
             errorDialog.ShowDialog();
         }
         return;
     }
     SaveAll();
     ItemEditor.UpdateItemNameAt(ItemEditor.index);
     if (ApplicationSettings.instance.autoSave)
     {
         Utils.SaveToFile(ItemEditor.kv_list, ApplicationSettings.instance.currentModPath + "\\scripts\\npc\\" + ItemEditor.file, rootKey);
     }
     this.Close();
 }
Exemplo n.º 7
0
        private void CallReportInvoice(string title, List <ModelsShared.Models.Invoice> data)
        {
            var list = new List <InvoiceReport>();

            foreach (var item in data)
            {
                list.Add(new InvoiceReport(item));
            }



            var content = new Reports.Contents.ReportContent(new Microsoft.Reporting.WinForms.ReportDataSource {
                Value = list
            },
                                                             "TrireksaApp.Reports.Layouts.InvoiceReportLayout.rdlc", new Microsoft.Reporting.WinForms.ReportParameter[] { new Microsoft.Reporting.WinForms.ReportParameter("Title", new string[] { title }) });
            var dlg = new ModernWindow
            {
                Content     = content,
                Title       = "Nota",
                Style       = (Style)App.Current.Resources["BlankWindow"],
                ResizeMode  = System.Windows.ResizeMode.CanResizeWithGrip,
                WindowState = WindowState.Maximized,
            };

            dlg.ShowDialog();
        }
Exemplo n.º 8
0
        private void Navigate()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;
            Uri          u1 = new Uri("/TestsExecutionView.xaml", UriKind.Relative);

            mw.ContentSource = u1;
        }
Exemplo n.º 9
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.º 10
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.º 11
0
        private void DisplayAdminWindow()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;
            Uri          u1 = new Uri("/AdminApproveMembersView.xaml", UriKind.Relative);

            mw.ContentSource = u1;
            mw.MenuLinkGroups.Clear();
            LinkGroup lg = new LinkGroup();
            Link      l1 = new Link();

            l1.DisplayName = "Manage Members";
            l1.Source      = u1;
            lg.Links.Add(l1);
            Uri  u2 = new Uri("/AdminProjectSettingsView.xaml", UriKind.Relative);
            Link l2 = new Link();

            l2.DisplayName = "Manage Project Settings";
            l2.Source      = u2;
            lg.Links.Add(l2);
            mw.MenuLinkGroups.Add(lg);
            Uri  logoutUri  = new Uri("/LoginView.xaml", UriKind.Relative);
            Link logoutLink = new Link();

            logoutLink.DisplayName = "Log out";
            logoutLink.Source      = logoutUri;
            mw.TitleLinks.Add(logoutLink);
        }
Exemplo n.º 12
0
        private async void PrintTitipanKapalAction(object obj)
        {
            var item = await MainVM.ManifestOutgoingCollection.GetTitipanKapal(SelectedItem.Id);

            if (item != null)
            {
                var list = new List <titipankapal>();
                list.Add(item);
                var content = new Reports.Contents.ReportContent(new Microsoft.Reporting.WinForms.ReportDataSource {
                    Value = list
                },
                                                                 "TrireksaApp.Reports.Layouts.TitipanKapalLayout.rdlc", null);
                var dlg = new ModernWindow
                {
                    Content     = content,
                    Title       = "Bukti Titipan Kapal",
                    Style       = (Style)App.Current.Resources["BlankWindow"],
                    ResizeMode  = System.Windows.ResizeMode.CanResizeWithGrip,
                    WindowState = WindowState.Maximized,
                };

                dlg.ShowDialog();
            }
            else
            {
                ModernDialog.ShowMessage("Data Tidak Ditemukan", "Info", MessageBoxButton.OK);
            }
        }
Exemplo n.º 13
0
        public PMViewer(Field field, ModernWindow window, bool isDiff = false, string headingtext = "")
        {
            InitializeComponent();

            CurrentField            = field;
            _associatedWindow       = window;
            _associatedWindow.Title = "Model View";

            ShowProcessModelInCanvas();
            _associatedWindow.PreviewKeyDown    += HandleShortcuts;
            _associatedWindow.PreviewMouseWheel += Zoom;
            HeadingText.Text = headingtext != "" ? headingtext : field.Infotext;

            //IsDiff = isDiff;


            //if (IsDiff)
            //{

            //    CloseButton1.Visibility = Visibility.Visible;
            //    ShowLegend();
            //}
            //else
            //{
            //    CloseButton1.Visibility = Visibility.Hidden;
            //}
        }
        void BackstageButton_Click(object sender, RoutedEventArgs e)
        {
            ModernWindow window    = Window.GetWindow(e.Source as DependencyObject) as ModernWindow;
            var          template  = window.Template;
            Border       container = template.FindName("BackstageContainer", window) as Border;

            if (container.Visibility == Visibility.Collapsed)
            {
                container.Visibility = Visibility.Visible;
            }
            else
            {
                if (window.BackstagePanel != null)
                {
                    foreach (var item in window.BackstagePanel.Items)
                    {
                        if (item is TabItem tabItem && tabItem.Content is ModernContent mc && !mc.CanBeClosed())
                        {
                            return;
                        }
                    }
                }


                if (HideContentStoryboard == null)
                {
                    HideContentStoryboard            = ((Storyboard)container.FindResource("HideContentStoryboard")).Clone();
                    HideContentStoryboard.Completed += (s, e2) => HideContentStoryboard_Completed(container, e2);
                }
                container.BeginStoryboard(HideContentStoryboard);
            }
        }
Exemplo n.º 15
0
        private void PrintPictureAction(object obj)
        {
            var settingData = HelperPrint.GetReportSetting();

            SelectedPhoto.STT = PenjualanItem.STT;
            var listSource = new List <ReportDataSource> {
                new ReportDataSource {
                    Value = new List <ModelsShared.Photo> {
                        SelectedPhoto
                    }, Name = "DataSet1"
                },
                new ReportDataSource {
                    Value = settingData, Name = "Config"
                }
            };

            var content = new Reports.Contents.ReportContent(listSource,
                                                             "TrireksaApp.Reports.Layouts.PrintImageLayout.rdlc", null);
            var dlg = new ModernWindow
            {
                Content     = content,
                Title       = "Manifest Outgoing",
                Style       = (Style)App.Current.Resources["BlankWindow"],
                ResizeMode  = System.Windows.ResizeMode.CanResizeWithGrip,
                WindowState = WindowState.Maximized,
            };

            dlg.ShowDialog();
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initialization.
        /// </summary>
        public AddHeroWindow()
        {
            InitializeComponent();
            heroNameComboBox.AddHandler(TextBoxBase.TextChangedEvent, new TextChangedEventHandler(newHeroNameTextChanged));

            try { heroesListLines = File.ReadAllLines("Data\\DefaultHeroesList.txt"); }
            catch
            {
                /*Button b = new Button();
                 * b.Content = "DefaultHeroesList.txt";
                 * b.Click += ErrorButtonClicked;
                 *
                 * errorDialog = new PromptDialog("Error");
                 * errorDialog.AddColoredHeader("File Not Found");
                 * errorDialog.AddButton(b);
                 * errorDialog.AddBBCode("An empty file will be created. Feel free to edit it.");
                 * errorDialog.AddBBCode("[url=http://pastebin.com/raw.php?i=EU59vmAb]Default Values.[/url]");*/

                errorDialog = new PromptDialog(true, false, ModernWindow.GetWindow(this));
                errorDialog.MissingFile("DefaultHeroesList.txt", "http://pastebin.com/raw.php?i=EU59vmAb");
                errorDialog.ShowDialog();
            }

            if (heroesListLines.Length > 0)
            {
                for (int i = 0; i < heroesListLines.Length; i++)
                {
                    heroNameComboBox.Items.Add(heroesListLines[i]);
                }
                heroNameComboBox.SelectedIndex = 0;
            }
        }
Exemplo n.º 17
0
        private void OnButtonClick(object sender, EventArgs e)
        {
            var wizard = Resources["Wizard"] as Wizard;

            if (wizard != null)
            {
                wizard.CurrentPage = wizard.Items[0] as WizardPage;
                wizard.Margin      = new Thickness(0, 32, 0, 0);

                if (m_window != null)
                {
                    m_window.Content = null;
                    m_window         = null;
                }
                m_window = new ModernWindow
                {
                    Style   = (Style)App.Current.Resources["EmptyWindow"],
                    Title   = "Wizard demonstration",
                    Content = wizard,
                    Width   = 600,
                    Height  = 400,
                    WindowStartupLocation = WindowStartupLocation.CenterScreen
                };
                // Window will be closed by Wizard because FinishButtonClosesWindow = true and CancelButtonClosesWindow = true
                m_window.ShowDialog();
            }
        }
Exemplo n.º 18
0
 public EditEntry(Entry currentEntry, ModernWindow wnd)
 {
     InitializeComponent();
     _currentEntry = currentEntry;
     _window       = wnd;
     Setup();
 }
Exemplo n.º 19
0
        /// <summary>
        /// Adds the new links to window.
        /// </summary>
        private void AddNewLinksToWindow()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;

            mw.MenuLinkGroups.Clear();
            LinkGroup lg = new LinkGroup();

            Link l1 = new Link();

            l1.DisplayName = "Edit Playlists";
            Uri u1 = new Uri("/Views/YouTubePlaylistsEditView.xaml", UriKind.Relative);

            l1.Source        = u1;
            mw.ContentSource = u1;
            lg.Links.Add(l1);

            Link l3 = new Link();

            l3.DisplayName = "YouTube Player";
            Uri u3 = new Uri("/Views/YouTubePlayerView.xaml", UriKind.Relative);

            l3.Source = u3;
            lg.Links.Add(l3);
            mw.MenuLinkGroups.Add(lg);
        }
Exemplo n.º 20
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.º 21
0
        public PMInfo(Dictionary <string, string> information, ModernWindow window)
        {
            InitializeComponent();
            PMInformationList.ItemsSource = information;

            _parentWindow = window;
            _parentWindow.PreviewKeyDown += HandleShortcuts;
        }
Exemplo n.º 22
0
        private void ViewButton_Click(object sender, RoutedEventArgs e)
        {
            ExecutionResultRunViewModel currentExecutionResultViewModel = ((FrameworkElement)sender).DataContext as ExecutionResultRunViewModel;
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;
            Uri          u1 = new Uri(String.Format("/ExecutionResultsView.xaml#executionResultRunId={0}", currentExecutionResultViewModel.ExecutionResultRunId), UriKind.Relative);

            mw.ContentSource = u1;
        }
Exemplo n.º 23
0
        /// <summary>
        /// Displays the after login active user window.
        /// </summary>
        private void DisplayAfterLoginActiveUserWindow()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;

            Uri u1 = new Uri("Views/YouTubePlayerView.xaml", UriKind.Relative);

            mw.ContentSource = u1;
        }
Exemplo n.º 24
0
        /// <summary>
        /// Displays the after login active user window.
        /// </summary>
        private void DisplayAfterLoginActiveUserWindow()
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;

            mw.MenuLinkGroups.Clear();
            Uri u1 = new Uri("Views/YouTubeSongsImportView.xaml", UriKind.Relative);

            mw.ContentSource = u1;
        }
Exemplo n.º 25
0
        void ModernWindow_Closed(object sender, EventArgs e)
        {
            ModernWindow windowClosed = (ModernWindow)sender;

            if (windowClosed.Content is Pages.Properties && PropertiesSet == false)
            {
                Application.Current.Shutdown();
            }
        }
Exemplo n.º 26
0
        public NavigationService(ModernWindow window)
        {
            if (window == null)
            {
                throw new ArgumentNullException(nameof(window));
            }

            this.window = window;
        }
Exemplo n.º 27
0
        protected override void InitializeShell()
        {
            base.Container.SatisfyImportsOnce(this);

            base.InitializeShell();

            if (this.viewContext == null)
            {
                Trace.WriteLine("ERROR - ViewContext failed!");
            }
            else
            {
                this.viewContext.Initialize();
            }

            if (this.resMgr == null)
            {
                Trace.WriteLine("ERROR - ResourceManager failed!");
            }
            else
            {
                Application.Current.Properties.Add("ResourceManager", resMgr.Initialize());
            }

            if (this.viewContext != null)
            {
                this.viewContext.CurrentUserParam = currentUserParam;
                //this.viewContext.Container = this.Container;
            }

            ModernWindow window = new ModernWindow();

            ((IShellCtrl)this.Shell).Container = this.Container;

            Application.Current.MainWindow.Close();
            Application.Current.MainWindow = window;
            window.Title   = resMgr.GetStringID("APP_Name");
            window.Loaded += (o, args) =>
            {
                this.ShellCtrl.DataContext  = this.viewContext;
                window.ContentFrame.Content = this.ShellCtrl;
                FrameContext frameContext = new FrameContext();
                frameContext.Initialize(this.regionManager);
                window.Closing += frameContext.OnCloseWindow;
                window.NavigateBack.DataContext = frameContext;

                //IViewModelBase viewModel = this.serviceLocator.GetInstance<IViewModelBase>("StatusBarViewModel");
                //window.StatusBar.Content = viewModel.View;
            };

            window.Top     = 0;
            window.Left    = 0;
            window.Width   = 1200;
            window.Height  = 760;
            window.Topmost = false;
            Application.Current.MainWindow.Show();
        }
Exemplo n.º 28
0
        private void btnResultsMode_Click_1(object sender, RoutedEventArgs e)
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;

            mw.MenuLinkGroups.Clear();
            Uri u1 = new Uri("/AllResultsView.xaml", UriKind.Relative);

            mw.ContentSource = u1;
        }
Exemplo n.º 29
0
        private void btnExecutionMode_Click_1(object sender, RoutedEventArgs e)
        {
            ModernWindow mw = Window.GetWindow(this) as ModernWindow;

            mw.MenuLinkGroups.Clear();
            Uri u1 = new Uri("/BeforeExecutionProjectSettingsView.xaml", UriKind.Relative);

            mw.ContentSource = u1;
        }
 public SettingsView(SettingsViewModel viewModel, ModernWindow window)
 {
     this.DataContext = viewModel;
     InitializeComponent();
     viewModel.CloseAction = () =>
     {
         window.DialogResult = true;
         window.Close();
     };
 }