Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            try
            { // Apparently this doesn't work in anything but Windows7
                IconBitmapDecoder ibd = new IconBitmapDecoder(
                new Uri(@"pack://*****:*****@"pack://application:,,/Scutex3.ico", UriKind.RelativeOrAbsolute),
                    BitmapCreateOptions.None,
                    BitmapCacheOption.Default);
                    Icon = ibd.Frames[0];
                }
                catch { }
            }

            this.Title = ApplicationConstants.IsCommunityEdition ? "Scutex Licensing Manager (Community Edition)" : "Scutex Licensing Manager (Professional Edition)";

            try
            {
                Bootstrapper.Configure();

                _eventAggregator = ObjectLocator.GetInstance<IEventAggregator>();
                _eventAggregator.AddListener<ProductsUpdatedEvent>(x => RefreshData());
                _eventAggregator.AddListener<LicenseSavedEvent>(x => SetRecentItemsAndRefresh());
                _eventAggregator.AddListener<ServicesUpdatedEvent>(x => RefreshData());
            }
            catch { }

            Initalize();

            SetRecentItems();

            VerifyFirstTimeRun();

            WelcomeScreenForm welcomeScreenForm = new WelcomeScreenForm();
            root.Content = welcomeScreenForm;
        }
Example #2
0
		private static void CloseProject(object sender, ExecutedRoutedEventArgs e)
		{
			MainWindow mainWindow = (MainWindow)sender;
			mainWindow.root.Content = null;
			UIContext.License = null;
			mainWindow.Initalize();

			WelcomeScreenForm welcomeScreenForm = new WelcomeScreenForm();
			mainWindow.root.Content = welcomeScreenForm;
		}
Example #3
0
        private void myRibbon_RibbonTabItemSelected(object sender, Infragistics.Windows.Ribbon.Events.RibbonTabItemSelectedEventArgs e)
        {
            if (root != null)
            {
                root.Content = null;

                if (e.NewSelectedRibbonTabItem.Name == "HomeTab")
                {
                    if (UIContext.License != null)
                    {
                        ProjectForm projectForm = new ProjectForm();
                        projectForm.License = UIContext.License;
                        root.Content = projectForm;
                    }
                    else
                    {
                        WelcomeScreenForm welcomeScreenForm = new WelcomeScreenForm();
                        root.Content = welcomeScreenForm;
                    }
                }
                else if (e.NewSelectedRibbonTabItem.Name == "ProductsTab")
                {
                    ProductsScreen productsScreen = new ProductsScreen();
                    root.Content = productsScreen;
                }
                else if (e.NewSelectedRibbonTabItem.Name == "ServicesTab")
                {

                }
            }
        }
Example #4
0
		private void ribbon_SelectedTabChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
		{
			if (e.AddedItems != null && e.AddedItems.Count == 1)
			{
				if (((RibbonTabItem)e.AddedItems[0]).Name == "homeTabItem")
				{
					WelcomeScreenForm welcomeScreenForm = new WelcomeScreenForm();
					root.Content = welcomeScreenForm;
				}
				else if (((RibbonTabItem)e.AddedItems[0]).Name == "productsTabItem")
				{
					if (_productsScreen == null)
						_productsScreen = new ProductsScreen();

					root.Content = _productsScreen;
				}
				else if (((RibbonTabItem)e.AddedItems[0]).Name == "servicesTabItem")
				{
					if (_servicesScreen == null)
						_servicesScreen = new ServicesScreen();

					root.Content = _servicesScreen;
				}

				else if (((RibbonTabItem)e.AddedItems[0]).Name == "projectTabItem")
				{
					if (UIContext.License != null)
					{
						ProjectForm projectForm = new ProjectForm();
						projectForm.License = UIContext.License;
						root.Content = projectForm;
					}
				}
			}
		}