Пример #1
0
 private void Awake()
 {
     _textMeshProUGUI            = GetComponent <TextMeshProUGUI>();
     _gameEnd                    = transform.parent.GetComponent <EndManager>();
     _themeManager               = transform.parent.GetComponent <ThemesManager>();
     _themeManager.ThemeChanged += ChangeTheme;
 }
Пример #2
0
 void Start()
 {
     _spriteRenderer             = GetComponent <SpriteRenderer>();
     _themeManager               = GameObject.FindGameObjectWithTag(Tags.GAME_CONTROLLER).GetComponent <ThemesManager>();
     _themeManager.ThemeChanged += ChangeTheme;
     _spriteRenderer.color       = _themeManager.CurrentTheme.TextColor;
 }
Пример #3
0
    void Awake()
    {
        _player            = GameObject.FindGameObjectWithTag(Tags.PLAYER);
        _cursorPositioning = _player.transform.GetChild(0).GetChild(0).GetComponent <CursorPositioning>();
        _gameEnd           = GetComponent <EndManager>();

        _themesManager = GetComponent <ThemesManager>();
    }
Пример #4
0
 private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ApplyButton.IsEnabled = true;
     if (ThemesComboBox != null && ThemesComboBox.SelectionBoxItem != null)
     {
         object enableGlass = ThemesManager.GetThemeParameter(Sidebar.SidebarWindow.sett.path, ((ComboBoxItem)e.AddedItems[0]).Content.ToString(), "boolean", "EnableGlass");
         if (enableGlass != null)
         {
             AeroGlassCheckBox.IsChecked = Convert.ToBoolean(enableGlass);
         }
     }
 }
Пример #5
0
        private async void Clear_OnClicked(object sender, EventArgs e)
        {
            UserSettings.UserName       = "";
            UserSettings.StartDate      = DateTime.Now;
            UserSettings.LastUpdateDate = DateTime.MinValue;

            foreach (var theme in ThemesManager.EnabledThemes)
            {
                ThemesManager.DisableTheme(theme);
            }

            await StorageService.Instance.ClearMessagesAsync();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CertificateStoreListControl"/> class.
        /// </summary>
        public CertificateStoreListControl()
        {
            InitializeComponent();

            ShowPhysicalStores = false; // default value
            ShowOtherLocations = false; // default value

            ThemesManager.RegisterThemeAwareControl(this, (renderer) =>
            {
                if (renderer is ToolStripProfessionalRenderer)
                {
                    ((ToolStripProfessionalRenderer)renderer).RoundedEdges = false;
                }
                tstrip.Renderer = renderer;
            });

            tstrip.SetRoundedEdges(false);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CertificateListControl"/> class.
        /// </summary>
        public CertificateListControl()
        {
            InitializeComponent();

            ThemesManager.RegisterThemeAwareControl(this, (renderer) =>
            {
                if (renderer is ToolStripProfessionalRenderer)
                {
                    ((ToolStripProfessionalRenderer)renderer).RoundedEdges = false;
                }
                tstrip.Renderer = renderer;
            });

            tstrip.SetRoundedEdges(false);

            InitializeViewMenu();
            UpdateViewMenu();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Asn1DocumentControl"/> class.
        /// </summary>
        public Asn1DocumentControl()
        {
            InitializeComponent();

            ThemesManager.RegisterThemeAwareControl(this, (renderer) =>
            {
                if (renderer is ToolStripProfessionalRenderer)
                {
                    ((ToolStripProfessionalRenderer)renderer).RoundedEdges = false;
                }
                tstrip.Renderer = renderer;
            });

            tstrip.SetRoundedEdges(false);
            parseOctetStringsToolStripButton.Checked        = viewer.ParseOctetStrings;
            showInvalidTaggedObjectsToolStripButton.Checked = viewer.ShowInvalidTaggedObjects;
            parseIcaoMrtdToolStripButton.Checked            = viewer.IsIcaoMrtd;
        }
        public LogWindowControl()
        {
            InitializeComponent();
            CanOverrideRenderer = true;

            ThemesManager.RegisterThemeAwareControl(this, (renderer) =>
            {
                if (CanOverrideRenderer)
                {
                    if (renderer is ToolStripProfessionalRenderer)
                    {
                        ((ToolStripProfessionalRenderer)renderer).RoundedEdges = false;
                    }

                    ts.Renderer = renderer;
                }
            });
        }
Пример #10
0
 private void LongBar_Drop(object sender, DragEventArgs e)
 {
     string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, true);
     if (files.Length > 0)
     {
         for (int i = 0; i < files.Length; i++)
         {
             if (files[i].EndsWith(".tile"))
             {
                 FileInfo info = new FileInfo(files[i]);
                 TaskDialogs.TileInstallDialog.ShowDialog(this, info.Name, files[i]);
             }
             if (files[i].EndsWith(".locale.xaml"))
             {
                 if (LocaleManager.InstallLocale(Sidebar.SidebarWindow.sett.path, files[i]))
                 {
                     MessageBox.Show("Localization was succesfully installed!", "Installing localization", MessageBoxButton.OK, MessageBoxImage.Information);
                     string name = System.IO.Path.GetFileName(files[i]);
                     sett.locale = name.Substring(0, name.IndexOf(@".locale.xaml"));
                     SetLocale(sett.locale);
                 }
                 else
                 {
                     MessageBox.Show("Can't install localization.", "Installing localization", MessageBoxButton.OK, MessageBoxImage.Error);
                 }
             }
             if (files[i].EndsWith(".theme.xaml"))
             {
                 if (ThemesManager.InstallTheme(Sidebar.SidebarWindow.sett.path, files[i]))
                 {
                     MessageBox.Show("Theme was succesfully installed!", "Installing theme", MessageBoxButton.OK, MessageBoxImage.Information);
                     string name = System.IO.Path.GetFileName(files[i]);
                     sett.theme = name.Substring(0, name.IndexOf(@".theme.xaml"));
                     SetTheme(sett.theme);
                 }
                 else
                 {
                     MessageBox.Show("Can't install theme.", "Installing theme", MessageBoxButton.OK, MessageBoxImage.Error);
                 }
             }
         }
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyGridEx"/> class.
        /// </summary>
        public PropertyGridEx() : base()
        {
            // Properties' default values
            CanOverrideRenderer      = true;
            ProtectConnectionStrings = true;

            InitializeComponentModel();

            ThemesManager.RegisterThemeAwareControl(this, (renderer) =>
            {
                if (CanOverrideRenderer)
                {
                    if (renderer is ToolStripProfessionalRenderer)
                    {
                        ((ToolStripProfessionalRenderer)renderer).RoundedEdges = false;
                    }

                    base.ToolStripRenderer = renderer;
                }
            });
        }
        public SettingsThemeSelectionViewModel(Command <SettingsItemViewModel> clicked) : base(clicked)
        {
            ItemTappedCommand = new Command <ThemeViewModel>(async(vm) =>
            {
                if (vm.IsSelected)
                {
                    if (await Shell.Current.DisplayAlert("", $"Ønsker du å skru av meldinger fra \n'{vm.Title}'", "ja",
                                                         "nei"))
                    {
                        vm.IsSelected = false;
                        ThemesManager.DisableTheme(vm.Model);
                        await Task.Run(async() => { await ScheduleManager.UnScheduleThemeAsync(vm.Model); });

                        // track enabled or disabled
                        Analytics.TrackEvent(TrackingEvents.Adjustment,
                                             new TrackingEvents.AdjustmentArgs(vm.Model, false));
                    }
                }
                else if (SelectedCount < Config.MaximumThemes)
                {
                    vm.IsSelected = true;
                    ThemesManager.EnableTheme(vm.Model);
                    await Task.Run(async() => { await ScheduleManager.ScheduleThemeAsync(vm.Model); });
                    await MainViewModel.LoadMessagesAsync();

                    // track enabled or disabled
                    Analytics.TrackEvent(TrackingEvents.Adjustment,
                                         new TrackingEvents.AdjustmentArgs(vm.Model, true));
                }
                else
                {
                    await Shell.Current.DisplayAlert("", "Sett deg maks to mål. Da gaper du ikke over for mye.", "ok");
                }
            });

            UpdateSelectedThemes();
        }
Пример #13
0
        public void SetTheme(string theme)
        {
            ThemesManager.LoadTheme(Sidebar.SidebarWindow.sett.path, theme);

            object useSystemColor = ThemesManager.GetThemeParameter(Sidebar.SidebarWindow.sett.path, sett.theme, "boolean", "UseSystemGlassColor");

            if (useSystemColor != null && Convert.ToBoolean(useSystemColor))
            {
                Bg.Fill = new SolidColorBrush(DwmManager.ColorizationColor);
                DwmManager.ColorizationColorChanged += new EventHandler(SideBar_DwmColorChanged);
            }
            else
            {
                Bg.SetResourceReference(Rectangle.StyleProperty, "Background");
                DwmManager.ColorizationColorChanged -= new EventHandler(SideBar_DwmColorChanged);
            }

            string file = string.Format(@"{0}\{1}.theme.xaml", sett.path, theme);

            foreach (Tile tile in TilesGrid.Children)
            {
                tile.ChangeTheme(file);
            }
        }
Пример #14
0
        private void LongBar_SourceInitialized(object sender, EventArgs e)
        {
            Handle = new WindowInteropHelper(this).Handle;
            ReadSettings();
            ThemesManager.LoadTheme(Sidebar.SidebarWindow.sett.path, sett.theme);
            object enableGlass = ThemesManager.GetThemeParameter(Sidebar.SidebarWindow.sett.path, sett.theme, "boolean", "EnableGlass");

            if (enableGlass != null && !Convert.ToBoolean(enableGlass))
            {
                sett.enableGlass = false;
            }
            object useSystemColor = ThemesManager.GetThemeParameter(Sidebar.SidebarWindow.sett.path, sett.theme, "boolean", "UseSystemGlassColor");

            if (useSystemColor != null && Convert.ToBoolean(useSystemColor))
            {
                Bg.Fill = new SolidColorBrush(DwmManager.ColorizationColor);
                DwmManager.ColorizationColorChanged += new EventHandler(SideBar_DwmColorChanged);
            }

            LocaleManager.LoadLocale(Sidebar.SidebarWindow.sett.path, sett.locale);

            this.Width = sett.width;
            SystemTray.AddIcon(this);
            // Force set sidebar window style to tool window, bypassing the restriction placed on AllowTransparency
            NativeMethods.SetWindowLong(Handle, GetWindowLongMessage.GWL_EXSTYLE, 128);
            SetSide(sett.side);
            this.MaxWidth = SystemParameters.PrimaryScreenWidth / 2;
            this.MinWidth = 31;

            DwmManager.ExcludeFromFlip3D(Handle);
            DwmManager.ExcludeFromPeek(Handle);

            SystemTray.SidebarVisibilityChanged += new SystemTray.SidebarVisibilityChangedEventHandler(SystemTray_SidebarvisibleChanged);

            GetTiles();
        }
Пример #15
0
 private void Awake()
 {
     _themesManager = transform.parent.parent.parent.GetComponent <ThemesManager>(); //get canvas
 }
Пример #16
0
 private void Start()
 {
     _themesManager = GetComponent <ThemesManager>();
 }
        private void CreateContainerPages( )
        {
            ControlPanelView         controlPanelView  = new ControlPanelView( );
            ServerInformationView    serverInfoView    = new ServerInformationView( );
            ServerAddinsView         serverAddInView   = new ServerAddinsView( );
            ServerSettingsDialog     serverSettingsDlg = new ServerSettingsDialog( );
            ServerInformationControl serverInfoControl = new ServerInformationControl();

            ControlPanelPresenter      controlPanelPresenter   = new ControlPanelPresenter( );
            ServerInformationPresenter serverInfoPresenter     = new ServerInformationPresenter( );
            ServerAddinPresenter       serverAddInPresenter    = new ServerAddinPresenter( );
            ServerSettingsPresenter    serverSettingsPresenter = new ServerSettingsPresenter( );

#if LEADTOOLS_V19_OR_LATER
            RealTimeViewPresenter realTimePresenter = new RealTimeViewPresenter();
#endif

            StorageDatabaseManager dbManager = new StorageDatabaseManager( );
#if TUTORIAL_CUSTOM_DATABASE
            // To use a custom database schema with the Database Manager, you must define a custom MyPrepareSearch method
            // and assign it to the StorageDatabaseManager.PrepareSearch delegate.
            // For more details, see the "Changing the LEAD Medical Storage Server to use a different database schema" tutorial.

            dbManager.PrepareSearch = new PrepareSearchDelegate(MyPrepareSearch);
#endif
            EventLogViewer logViewer = new EventLogViewer( );

#if LEADTOOLS_V19_OR_LATER
            RealTimeViewerControl realTimeView = new RealTimeViewerControl()
            {
                Visible = false
            };
#endif

            dbManager.BackColor         = Color.FromArgb(75, 75, 75);
            logViewer.BackColor         = Color.White;
            logViewer.PathLogDump       = this.PathLogDump;
            serverInfoControl.BackColor = Color.White;

            ThemesManager.ApplyTheme(controlPanelView);
            ThemesManager.ApplyTheme(logViewer);
            ThemesManager.ApplyTheme(dbManager);
            ThemesManager.ApplyTheme(serverInfoControl);

#if LEADTOOLS_V19_OR_LATER
            ThemesManager.ApplyTheme(realTimeView);
#endif

            ConfigureServerInfoConrol(serverInfoControl);

            View.SetHeader(serverInfoView);

            AddPage(new PageData(controlPanelView, "Control Panel", null));

            //AddPage ( new PageData ( new Control ( ), "Security", null ) ) ;
            AddPage(new PageData(logViewer, "Event Log", null));
            AddPage(new PageData(serverInfoControl, "System Information", null));

            dbManager.MergeImportDicom = true;

#if (LEADTOOLS_V19_OR_LATER_EXPORT) || (LEADTOOLS_V19_OR_LATER)
            dbManager.EnableExport = true;
#endif // #if (LEADTOOLS_V19_OR_LATER_EXPORT) || (LEADTOOLS_V19_OR_LATER)

            dbManager.Enabled = ServerState.Instance.ServerService != null;

            if (ServerState.Instance.ServerService != null)
            {
                dbManager.AETitle = ServerState.Instance.ServerService.Settings.AETitle;
            }

            AddPage(new PageData(dbManager, "Database Manager", null));

            dbManager.Enabled = true;

#if LEADTOOLS_V19_OR_LATER
            AddPage(new PageData(realTimeView, "Live View", null));
#endif
            InitializeLicenseView();

            serverAddInView.Enabled = UserManager.User.IsAdmin();
            AddPage(new PageData(serverAddInView, "Add-ons", null));

            controlPanelPresenter.RunView(controlPanelView);
            serverInfoPresenter.RunView(serverInfoView);
            serverAddInPresenter.RunView(serverAddInView);
            serverSettingsPresenter.RunView(serverSettingsDlg);

#if LEADTOOLS_V19_OR_LATER
            realTimePresenter.RunView(realTimeView);
#endif

            if (DataAccessServices.IsDataAccessServiceRegistered <IStorageDataAccessAgent>())
            {
                _AccessAgent = DataAccessServices.GetDataAccessService <IStorageDataAccessAgent>();
            }

            dbManager.CancelStore           += new EventHandler <CancelStoreEventArgs>  (dbManager_CancelStore);
            dbManager.ConfigureStoreCommand += new EventHandler <StoreCommandEventArgs> (dbManager_ConfigureStoreCommand);

#if (LEADTOOLS_V19_OR_LATER_EXPORT) || (LEADTOOLS_V19_OR_LATER)
            dbManager.ConfigureStoreExportCommand += new EventHandler <StoreCommandEventArgs> (dbManager_ConfigureStoreCommandExport);
#endif // #if (LEADTOOLS_V19_OR_LATER_EXPORT) || (LEADTOOLS_V19_OR_LATER)


#if TUTORIAL_CUSTOM_DATABASE
            // To use a custom database schema with the Database Manager, you must define a custom MyPrepareSearch method
            // and assign it to the StorageDatabaseManager.PrepareSearch delegate. After doing this, the search fields in the Database Manager
            //will properly refine any database manager search.  The MyPrepareSearch() method gets the search fields specified in the database manager
            // by calling StorageDatabaseManager.GetDicomQueryParams().  This returns any query parameters specified.
            // For more details, see the "Changing the LEAD Medical Storage Server to use a different database schema" tutorial.

            dbManager.GetDicomQueryParams();
#endif
            __DbManager      = dbManager;
            __ServerInfoView = serverInfoView;

            ApplyPermissions( );

            ApplyStorageSettingsPermissions( );

            Instance_LicenseChanged(this, EventArgs.Empty);
            ServerState.Instance.LicenseChanged += new EventHandler(Instance_LicenseChanged);
        }
Пример #18
0
        /// <summary>
        /// This is the first bit of code being executed when the application is invoked (main entry point).
        ///
        /// Use the <paramref name="e"/> parameter to evaluate command line options.
        /// Invoking a program with an associated file type extension (eg.: *.txt) in Explorer
        /// results, for example, in executing this function with the path and filename being
        /// supplied in <paramref name="e"/>.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                // Set shutdown mode here (and reset further below) to enable showing custom dialogs (messageboxes)
                // durring start-up without shutting down application when the custom dialogs (messagebox) closes
                this.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
            }
            catch
            {
            }

            Options        options       = null;
            IThemesManager themesManager = new ThemesManager();

            try
            {
                options = SettingsManager.LoadOptions(AppHelpers.DirFileAppSettingsData, themesManager);

                Thread.CurrentThread.CurrentCulture   = new CultureInfo(options.LanguageSelected);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(options.LanguageSelected);

                if (options.RunSingleInstance == true)
                {
                    if (enforcer.ShouldApplicationExit() == true)
                    {
                        if (this.AppIsShuttingDown == false)
                        {
                            this.AppIsShuttingDown = true;
                            this.Shutdown();
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                Logger.Error(exp);
            }

            try
            {
                this.mBoot = new Bootstapper(this, e, options, themesManager);
                this.mBoot.Run();
            }
            catch (Exception exp)
            {
                Logger.Error(exp);

                // Cannot set shutdown mode when application is already shuttong down
                if (this.AppIsShuttingDown == false)
                {
                    this.ShutdownMode = ShutdownMode.OnExplicitShutdown;
                }

                // 1) Application hangs when this is set to null while MainWindow is visible
                // 2) Application throws exception when this is set as owner of window when it
                //    was never visible.
                //
                if (Application.Current.MainWindow != null)
                {
                    if (Application.Current.MainWindow.IsVisible == false)
                    {
                        Application.Current.MainWindow = null;
                    }
                }

                MsgBox.Msg.Show(exp, Strings.STR_MSG_ERROR_FINDING_RESOURCE, MsgBoxButtons.OKCopy);

                if (this.AppIsShuttingDown == false)
                {
                    this.Shutdown();
                }
            }
        }
Пример #19
0
 void Start()
 {
     _textMeshPro  = GetComponent <TextMeshPro>();
     _themeManager = GameObject.FindGameObjectWithTag(Tags.GAME_CONTROLLER).GetComponent <ThemesManager>();
     _themeManager.ThemeChanged += ChangeTheme;
 }
Пример #20
0
        /// <summary>
        /// This is the first bit of code being executed when the application is invoked (main entry point).
        ///
        /// Use the <paramref name="e"/> parameter to evaluate command line options.
        /// Invoking a program with an associated file type extension (eg.: *.txt) in Explorer
        /// results, for example, in executing this function with the path and filename being
        /// supplied in <paramref name="e"/>.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                // Set shutdown mode here (and reset further below) to enable showing custom dialogs (messageboxes)
                // durring start-up without shutting down application when the custom dialogs (messagebox) closes
                this.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
            }
            catch
            {
            }

            Options        options       = null;
            IThemesManager themesManager = new ThemesManager();

            try
            {
                options = SettingsManager.LoadOptions(AppHelpers.DirFileAppSettingsData, themesManager);

                Thread.CurrentThread.CurrentCulture   = new CultureInfo(options.LanguageSelected);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(options.LanguageSelected);

                if (options.RunSingleInstance == true)
                {
                    if (enforcer.ShouldApplicationExit() == true)
                    {
                        if (this.AppIsShuttingDown == false)
                        {
                            this.AppIsShuttingDown = true;
                            this.Shutdown();
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                Logger.Error(exp);
                Console.WriteLine("");
                Console.WriteLine("Unexpected Error 1 in App.Application_Startup()");
                Console.WriteLine("   Message:{0}", exp.Message);
                Console.WriteLine("StackTrace:{0}", exp.StackTrace);
                Console.WriteLine("");
            }

            try
            {
                this.mBoot = new Bootstapper(this, e, options, themesManager);
                this.mBoot.Run();
            }
            catch (Exception exp)
            {
                Logger.Error(exp);
                Console.WriteLine("");
                Console.WriteLine("Unexpected Error 2 in App.Application_Startup()");
                Console.WriteLine("   Message:{0}", exp.Message);
                Console.WriteLine("StackTrace:{0}", exp.StackTrace);
                Console.WriteLine("");

                // Typically thrown by MEF when module binding does not work
                if (exp is System.Reflection.ReflectionTypeLoadException)
                {
                    var loaderExcept = (exp as System.Reflection.ReflectionTypeLoadException).LoaderExceptions;

                    Console.WriteLine("Loader Exception(s):");
                    Logger.Error("Loader Exception(s):");

                    foreach (var item in loaderExcept)
                    {
                        Console.WriteLine("Message {0}:", item.Message);
                        Console.WriteLine("StackTrace {0}:", item.StackTrace);
                    }
                }

                // Cannot set shutdown mode when application is already shuttong down
                try
                {
                    if (this.AppIsShuttingDown == false)
                    {
                        this.ShutdownMode = ShutdownMode.OnExplicitShutdown;
                    }
                }
                catch
                {
                }

                // 1) Application hangs when this is set to null while MainWindow is visible
                // 2) Application throws exception when this is set as owner of window when it
                //    was never visible.
                //
                if (Application.Current.MainWindow != null)
                {
                    if (Application.Current.MainWindow.IsVisible == false)
                    {
                        Application.Current.MainWindow = null;
                    }
                }

//                var msgBox = ServiceLocator.Current.GetInstance<IMessageBoxService>();
//                msgBox.Show(exp, Strings.STR_MSG_ERROR_FINDING_RESOURCE, MsgBoxButtons.OKCopy, MsgBoxImage.Error);

                if (this.AppIsShuttingDown == false)
                {
                    this.Shutdown();
                }
            }
        }
Пример #21
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //AboutWindow.xaml
            VersionString.Text = string.Format("{0} {1} ({2})",
                                               TryFindResource("Version"), VersionInfo.Core, VersionInfo.Configuration);
            CopyrightLongBar.Text = string.Format("© 2010 LongBar Project Group. {0}",
                                                  TryFindResource("AllRightsReserved"));
            CopyrightProject.Text = string.Format("© 2016-{1} The AvalonBar Project. {0}",
                                                  TryFindResource("AllRightsReserved"), DateTime.Now.Year);
            //-----------------

            AutostartCheckBox.IsChecked = SidebarWindow.sett.startup;
            TopMostCheckBox.IsChecked   = SidebarWindow.sett.topMost;
            LockedCheckBox.IsChecked    = SidebarWindow.sett.locked;

            if (SidebarWindow.sett.side == AppBarSide.Left)
            {
                LocationComboBox.SelectedIndex = 0;
            }
            else
            {
                LocationComboBox.SelectedIndex = 1;
            }

            string[] locales = LocaleManager.GetLocales(Sidebar.SidebarWindow.sett.path);
            for (int i = 0; i <= locales.Length - 1; i++)
            {
                ComboBoxItem item2 = new ComboBoxItem();
                item2.Content = locales[i];
                LangComboBox.Items.Add(item2);
            }
            LangComboBox.Text = SidebarWindow.sett.locale;

            if (DwmManager.IsBlurAvailable)
            {
                AeroGlassCheckBox.IsEnabled = true;
                AeroGlassCheckBox.IsChecked = SidebarWindow.sett.enableGlass;
            }
            else
            {
                AeroGlassCheckBox.IsEnabled = false;
                AeroGlassCheckBox.IsChecked = false;
            }

            if (SidebarWindow.sett.topMost)
            {
                OverlapCheckBox.IsEnabled = true;
                OverlapCheckBox.IsChecked = SidebarWindow.sett.overlapTaskbar;
            }
            else
            {
                OverlapCheckBox.IsEnabled = false;
                OverlapCheckBox.IsChecked = false;
            }

            if (SidebarWindow.sett.enableShadow)
            {
                ShadowCheckBox.IsChecked = true;
            }
            else
            {
                ShadowCheckBox.IsChecked = false;
            }

            UpdatesCheckBox.IsChecked = SidebarWindow.sett.enableUpdates;

            string[] themes = ThemesManager.GetThemes(Sidebar.SidebarWindow.sett.path);
            for (int i = 0; i <= themes.Length - 1; i++)
            {
                ComboBoxItem newItem = new ComboBoxItem();
                newItem.Content = themes[i];
                ThemesComboBox.Items.Add(newItem);
            }
            ThemesComboBox.Text   = SidebarWindow.sett.theme;
            ApplyButton.IsEnabled = false;

            string[] screenNames = Utils.GetScreenFriendlyNames();
            System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens;
            for (int i = 0; i < screenNames.Length; i++)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Content = screenNames[i];
                item.Tag     = screens[i].DeviceName;
                ScreenComboBox.Items.Add(item);
            }
            if (SidebarWindow.sett.screen == "Primary")
            {
                ScreenComboBox.SelectedIndex = 0;
            }
            else
            {
                ScreenComboBox.SelectedIndex = 0;
                foreach (ComboBoxItem cbItem in ScreenComboBox.Items)
                {
                    if ((string)cbItem.Content != "Primary" && (string)cbItem.Tag == SidebarWindow.sett.screen)
                    {
                        ScreenComboBox.SelectedItem = cbItem;
                        break;
                    }
                }
            }
        }
Пример #22
0
        internal DataAccessResponseType InitializePlatform()
        {
            DataAccessResponseType response = new DataAccessResponseType();

            /*======================================
             *          CREATE DATABASES
             * ========================================*/

            //Create Platform Database:
            DatabaseModel platformDatabase = new DatabaseModel();

            platformDatabase.DatabaseTier = DatabaseTier.Basic;
            platformDatabase.DatabaseName = "Platform";
            platformDatabase.DatabaseSize = MaxSize_Basic._2GB;

            Sql.Scripts.Create.CreateDatabase(platformDatabase, Sahara.Core.Settings.Azure.Databases.DatabaseConnections.MasterSqlConnection);



            //Create Accounts Database:
            DatabaseModel accountsDatabase = new DatabaseModel();

            accountsDatabase.DatabaseTier = DatabaseTier.Basic;
            accountsDatabase.DatabaseName = "Accounts";
            accountsDatabase.DatabaseSize = MaxSize_Basic._2GB;

            Sql.Scripts.Create.CreateDatabase(accountsDatabase, Sahara.Core.Settings.Azure.Databases.DatabaseConnections.MasterSqlConnection);


            /*======================================
             *      Schema & Tables & Seed
             * ========================================*/

            //Run Schema for Accounts on Accounts DB:
            var accountDBInitialization = new Sql.Scripts.AccountsDB.Initialization.Initialization();

            accountDBInitialization.InitializeAccountsDB(Sahara.Core.Settings.Azure.Databases.DatabaseConnections.AccountsSqlConnection);

            //using (Sahara.Core.Settings.Azure.Databases.DatabaseConnections.AccountsSqlConnection)
            //{

            //}

            //Run Schema for Platform on Platform DB:
            var platformDBInitialization = new Sql.Scripts.PlatformDB.Initialization.Initialization();

            platformDBInitialization.InitializePlatformDB(Sahara.Core.Settings.Azure.Databases.DatabaseConnections.PlatformSqlConnection);



            /*======================================
             *  Create Initial Platform Roles
             * ========================================*/

            var createPlatformRolesResult = PlatformUserManager.CreateRoles(Sahara.Core.Settings.Platform.Users.Authorization.Roles.GetRoles()).Result;

            /*======================================
             *   Create Initial AccountUser Roles
             * ========================================*/

            var createAccountRolesResult = AccountUserManager.CreateRoles(Sahara.Core.Settings.Accounts.Users.Authorization.Roles.GetRoles()).Result;


            /*=====================================
             *  Initialize Available Themes
             * ========================================*/


            #region Create Default Theme(s)

            ThemesManager.CreateTheme(new ThemeModel
            {
                Name   = "Light",
                Font   = "segoe",
                Colors = new ThemeColorsModel
                {
                    Background               = "FFFFFF",
                    BackgroundGradianetTop   = "FFFFFF",
                    BackgroundGradientBottom = "DEDEDE",
                    Shadow     = "858585",
                    Highlight  = "000000",
                    Foreground = "000000",
                    Overlay    = "3D3D3D",
                    Trim       = "5E5E5E"
                }
            });


            ThemesManager.CreateTheme(new ThemeModel
            {
                Name   = "Charcoal",
                Font   = "segoe",
                Colors = new ThemeColorsModel
                {
                    Background               = "000000",
                    BackgroundGradianetTop   = "000000",
                    BackgroundGradientBottom = "4A4A4A",
                    Shadow     = "A8A8A8",
                    Highlight  = "D9D9D9",
                    Foreground = "FFFFFF",
                    Overlay    = "828282",
                    Trim       = "4D4D4D"
                }
            });

            ThemesManager.CreateTheme(new ThemeModel
            {
                Name   = "Cyan",
                Font   = "segoe",
                Colors = new ThemeColorsModel
                {
                    Background               = "9DD9ED",
                    BackgroundGradianetTop   = "9DD9ED",
                    BackgroundGradientBottom = "4F94AB",
                    Shadow     = "1D4E5E",
                    Highlight  = "CFF3FF",
                    Foreground = "1D4E5E",
                    Overlay    = "A18F28",
                    Trim       = "FF8800"
                }
            });


            #endregion


            response.isSuccess = true;

            return(response);
        }