Beispiel #1
0
        private void Initialize()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;

            VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
            ResourceRegistrator.Initialization();

            /* Without this user won't be able to input decimal point for float bindings if UpdateSourceTrigger set to PropertyChanged */
            System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;

            unityContainer = new UnityContainer();

            unityContainer.RegisterType <IEventAggregator, EventAggregator>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IHudServiceHost, HudServiceHost>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IDataService, DataService>(new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <ISettingsService, SettingsService>(new ContainerControlledLifetimeManager(), new InjectionConstructor(StringFormatter.GetAppDataFolderPath()));
            unityContainer.RegisterType <IHandHistoryParserFactory, HandHistoryParserFactoryImpl>();

            UnityServicesBootstrapper.ConfigureContainer(unityContainer);
            ModelBootstrapper.ConfigureContainer(unityContainer);

            var locator = new UnityServiceLocator(unityContainer);

            ServiceLocator.SetLocatorProvider(() => locator);

            RuntimeTypeModel.Default.Add(typeof(System.Windows.Point), false).SetSurrogate(typeof(PointDto));
            RuntimeTypeModel.Default.Add(typeof(System.Windows.Media.Color), false).SetSurrogate(typeof(ColorDto));
            RuntimeTypeModel.Default.Add(typeof(System.Windows.Media.SolidColorBrush), false).SetSurrogate(typeof(SolidColorBrushDto));
        }
Beispiel #2
0
        void ThemeSelector_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            var selectedItem   = (RadComboBoxItem)((RadComboBox)sender).SelectedItem;
            var themeNameParts = ((string)selectedItem.Content).Split('_');
            var themeName      = themeNameParts[0];
            var themeVariation = string.Empty;

            MergeResourceDictionaries(themeName);

            if (themeNameParts.Length > 1)
            {
                switch (themeName)
                {
                case "VisualStudio2013":
                    VisualStudio2013Palette.LoadPreset((VisualStudio2013Palette.ColorVariation)GetPresetEnum(typeof(VisualStudio2013Palette.ColorVariation), themeNameParts[1]));
                    break;

                case "Office2013":
                    Office2013Palette.LoadPreset((Office2013Palette.ColorVariation)GetPresetEnum(typeof(Office2013Palette.ColorVariation), themeNameParts[1]));
                    break;

                case "Green":
                    GreenPalette.LoadPreset((GreenPalette.ColorVariation)GetPresetEnum(typeof(GreenPalette.ColorVariation), themeNameParts[1]));
                    break;
                }

                themeVariation = themeNameParts[1];
            }

            this.SetLayoutBackground(themeName, themeVariation);
        }
Beispiel #3
0
        private void InitializeApplication(GeneralSettingsModel generalSettingsModel)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;

            Version = Assembly.GetExecutingAssembly().GetName().Version;

            LogProvider.Log.Info(string.Format("---------------=============== Initialize DriveHUD (v.{0}) ===============---------------", Version));
            LogProvider.Log.Info(string.Format("OsVersion: {0}", Environment.OSVersion));
            LogProvider.Log.Info(string.Format("Current Culture: {0}", Thread.CurrentThread.CurrentCulture));
            LogProvider.Log.Info(string.Format("Current UI Culture: {0}", Thread.CurrentThread.CurrentUICulture));

            ValidateLicenseAssemblies();

            if (generalSettingsModel.IsAutomaticallyDownloadUpdates)
            {
                CheckUpdates();
            }

            VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);

            LogCleaner.ClearLogsFolder();

            /* Without this user won't be able to input decimal point for float bindings if UpdateSourceTrigger set to PropertyChanged */
            System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);

            StyleManager.IsEnabled        = true;
            StyleManager.ApplicationTheme = new VisualStudio2013Theme();
        }
Beispiel #5
0
 public MainWindow()
 {
     VisualStudio2013Palette.LoadPreset(FileSystemExplorerControl.VisualStudio2013ColorVariation);
     InitializeComponent();
     //DirectoryExplorer.PropertyChanged += DirectoryExplorerOnPropertyChanged;
     //var binding = DirectoryExplorer.GetBindingExpression(FileSystemExplorerListControl.SelectedItemProperty);
     //DirectoryExplorer.SourceUpdated += (s,e) => DirectoryExplorerOnTargetUpdated(s,e,false);
     //DirectoryExplorer.TargetUpdated += (s, e) => DirectoryExplorerOnTargetUpdated(s, e, true);
     InitializeViewModel();
     LoadSettings();
 }
Beispiel #6
0
 private void VisualStudio2013_Blue_Checked(object sender, RoutedEventArgs e)
 {
     Application.Current.Resources.MergedDictionaries.Clear();
     Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
     {
         Source = new Uri("/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml", UriKind.RelativeOrAbsolute)
     });
     Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
     {
         Source = new Uri("/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml", UriKind.RelativeOrAbsolute)
     });
     VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
     this.container.Background = new SolidColorBrush(Colors.White);
 }
Beispiel #7
0
        public string setLightOrDark(string themeName)
        {
            if (themeName.Contains("Office2013"))
            {
                switch (themeName)
                {
                case "Office2013_LightGray":
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.LightGray);
                    break;

                case "Office2013_DarkGray":
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.DarkGray);
                    break;

                default:
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.White);
                    break;
                }
                return("Office2013");
            }
            if (themeName.Contains("VisualStudio2013"))
            {
                switch (themeName)
                {
                case "VisualStudio2013_Blue":
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
                    break;

                case "VisualStudio2013_Dark":
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
                    break;

                default:
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Light);
                    break;
                }
                return("VisualStudio2013");
            }
            if (themeName.Contains("Green"))
            {
                switch (themeName)
                {
                case "Green_Light":
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Light);
                    break;

                case "Green_Dark":
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                    break;

                default:
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                    break;
                }
                return("Green");
            }
            if (themeName.Contains("Fluent"))
            {
                switch (themeName)
                {
                case "Fluent_Dark":
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark);
                    break;

                default:
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Light);
                    break;
                }
                return("Fluent");
            }
            if (themeName.Contains("Crystal"))
            {
                if (themeName.Contains("Crystal_Dark"))
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Dark);
                }
                else
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Light);
                }
                return("Crystal");
            }
            return(themeName);
        }
Beispiel #8
0
        private string GetDefaultThemeNameAndSetColorVariation(string themeName)
        {
            // Office2013 Theme
            if (themeName.Contains(ApplicationThemeManager.Office2013DefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.Office2013LightGrayThemeName):
                {
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.LightGray);
                }
                break;

                case (ApplicationThemeManager.Office2013DarkGrayThemeName):
                {
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.DarkGray);
                }
                break;

                default:
                {
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.White);
                }
                break;
                }

                return(ApplicationThemeManager.Office2013DefaultThemeName);
            }

            // VisualStudio2013 Theme
            if (themeName.Contains(ApplicationThemeManager.VisualStudio2013DefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.VisualStudio2013BlueThemeName):
                {
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
                }
                break;

                case (ApplicationThemeManager.VisualStudio2013DarkThemeName):
                {
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Light);
                }
                break;
                }

                return(ApplicationThemeManager.VisualStudio2013DefaultThemeName);
            }

            // Green Theme
            if (themeName.Contains(ApplicationThemeManager.GreenDefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.GreenLightThemeName):
                {
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Light);
                }
                break;

                case (ApplicationThemeManager.GreenDarkThemeName):
                {
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                }
                break;
                }

                return(ApplicationThemeManager.GreenDefaultThemeName);
            }

            // Fluent Theme
            if (themeName.Contains(ApplicationThemeManager.FluentDefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.FluentDarkThemeName):
                {
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Light);
                }
                break;
                }

                return(ApplicationThemeManager.FluentDefaultThemeName);
            }

            // Crystal Theme
            if (themeName.Contains(ApplicationThemeManager.CrystalDefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.CrystalDarkThemeName):
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Light);
                }
                break;
                }

                return(ApplicationThemeManager.CrystalDefaultThemeName);
            }

            return(themeName);
        }