Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        /// <param name="applicationInsightHelper">AI Helper</param>
        public MainWindow(ApplicationInsightHelper applicationInsightHelper)
        {
            log4net.Config.XmlConfigurator.Configure();
            this.InitializeComponent();
            this.applicationInsightHelper = applicationInsightHelper;

            // Load Language
            this.LoadLanguage(Properties.Settings.Default.Culture);

            busyIndicator = this.prg_progress;
            MainWindow.SetProgress(false);

            if (Properties.Settings.Default.DebuggingEnabled)
            {
                Application.Current.Properties["Debugging.Enabled"] = true;
            }
            else
            {
                Application.Current.Properties["Debugging.Enabled"] = false;
            }

            if (!File.Exists(Core.Data.StorageExtensions.StoragePath))
            {
                Btn_OpenConnectionOverview.IsEnabled = false;
            }

            if (string.IsNullOrEmpty(MainWindow.EncryptionKey))
            {
                EncryptionKey encryptionKey = new EncryptionKey();
                encryptionKey.ShowDialog();

                if (!string.IsNullOrEmpty(MainWindow.EncryptionKey))
                {
                    Pages.SolutionSelector solutionSelector = new Pages.SolutionSelector();
                    solutionSelector.ReloadConnections();
                    this.menuItems            = this.GetMenu();
                    this.Lbx_Menu.ItemsSource = this.menuItems;
                    this.CheckForUpdate();
                }
                else
                {
                    this.Close();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates the Side Menu Bar
        /// </summary>
        /// <returns>Returns a <see cref="List{Pages.MenuItem}"/></returns>
        private List <Pages.MenuItem> GetMenu()
        {
            List <Pages.MenuItem> listMenuItems = new List <Pages.MenuItem>();

            // Customizing Extractor
            Pages.SolutionSelector solutionSelector = new Pages.SolutionSelector();
            solutionSelector.ReloadConnections();

            Pages.MenuItem menuItem = new Pages.MenuItem
            {
                Name        = (string)Application.Current.FindResource("MainWindow_Code_Customizing_Downloader"),
                Description = (string)Application.Current.FindResource("MainWindow_Code_Customizing_Downloader_Description"),
                Content     = solutionSelector
            };

            listMenuItems.Add(menuItem);

            // Solution Downloader
            Pages.SolutionDownloader solutionDownloader = new Pages.SolutionDownloader();

            menuItem = new Pages.MenuItem()
            {
                Name        = (string)Application.Current.FindResource("MainWindow_Code_Solution_Downloader"),
                Description = (string)Application.Current.FindResource("MainWindow_Code_Solution_Downloader_Description"),
                Content     = solutionDownloader
            };

            listMenuItems.Add(menuItem);

            // Solution Uploader
            Pages.SolutionUploader solutionUploader = new Pages.SolutionUploader();

            menuItem = new Pages.MenuItem()
            {
                Name        = (string)Application.Current.FindResource("MainWindow_Code_Solution_Uploader"),
                Description = (string)Application.Current.FindResource("MainWindow_Code_Solution_Uploader_Description"),
                Content     = solutionUploader
            };

            listMenuItems.Add(menuItem);
            return(listMenuItems);
        }