示例#1
0
        public screenMain()
        {
            InitializeComponent();

            pageMain = this;
            List <string> config = CFM.ReadSettings();

            Application.Current.MainWindow.Height = Convert.ToDouble(config[2]);
            Application.Current.MainWindow.Width  = Convert.ToDouble(config[3]);
            //MainWindow.main.frame.Height = 570;
            //MainWindow.main.frame.Width = 992;

            MainWindow.main.ResizeMode = ResizeMode.CanResize;

            List <string> channels = JsonConvert.DeserializeObject <List <string> >((NM.serverInfo["channels"]).ToString());

            foreach (string ch in channels)
            {
                this.lbMainChannels.Items.Add(ch);
            }

            if (config[4] == "Light Theme")
            {
            }
            else if (config[4] == "Dark Theme")
            {
                VM.DarkTheme("screenMain");
            }
        }
示例#2
0
        private void cboSettingsClrSch_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            List <string> config = CFM.ReadSettings();

            if (cboSettingsClrSch.SelectedValue == null)
            {
            }
            else
            {
                if (cboSettingsClrSch.SelectedValue.ToString() == "Light Theme")
                {
                    if (config[4] == "Light Theme")
                    {
                    }
                    else
                    {
                        VM.LightTheme("screenSettings");
                        CFM.UpdateSetting("colourScheme", "Light Theme");
                    }
                }
                else if (cboSettingsClrSch.SelectedValue.ToString() == "Dark Theme")
                {
                    if (config[4] == "Dark Theme")
                    {
                    }
                    else
                    {
                        VM.DarkTheme("screenSettings");
                        CFM.UpdateSetting("colourScheme", "Dark Theme");
                    }
                }
            }
        }
示例#3
0
        public screenSettings()
        {
            InitializeComponent();
            pageSettings = this;
            DBM.SQLInitialise();
            populateServers();

            List <string> config = CFM.ReadSettings();

            cboSettingsClrSch.SelectedValue = config[4];

            if (config[4] == "Light Theme")
            {
            }
            else if (config[4] == "Dark Theme")
            {
                VM.DarkTheme("screenSettings");
            }
        }
示例#4
0
        public screenStartup()
        {
            InitializeComponent();

            pageStartup = this;
            DBM.SQLInitialise();
            populateServers();

            MainWindow.main.ResizeMode = ResizeMode.NoResize;

            config = CFM.ReadSettings();

            if (config[4] == "Light Theme")
            {
            }
            else if (config[4] == "Dark Theme")
            {
                VM.DarkTheme("screenStartup");
            }

            Panel mainContainer = (Panel)this.Content;

            /// GetAll UIElement
            UIElementCollection element = mainContainer.Children;

            /// casting the UIElementCollection into List
            List <FrameworkElement> lstElement = element.Cast <FrameworkElement>().ToList();

            /// Geting all Control from list
            var lstControl = lstElement.OfType <Control>();

            foreach (Control control in lstControl)
            {
                Debug.WriteLine(control.GetType().ToString());
            }

            if (Convert.ToBoolean(config[0]) == true)
            {
                this.cbRememberUser.IsChecked = true;
                this.tbStartupUsername.Text   = config[1];
            }
        }