Beispiel #1
0
 public void loadSettings()
 {
     if (System.IO.File.Exists(myFolder + "\\settings.json") == false)
     {
         saveSettings();
     }
     this.settings = (mySettings) new JavaScriptSerializer().Deserialize(System.IO.File.ReadAllText(myFolder + "\\settings.json"), typeof(mySettings));
 }
Beispiel #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        { //this.DataContext = newBook;
            //Hilfstabellen laden/aktivieren
            sett = new mySettings();

            Admin.LoadGenre(ugridGenre);
            LoadAuxTab();
            btnPublNew.Visibility = Visibility.Hidden;
            NameRolle nr = new NameRolle();

            nr_list    = new List <NameRolle>();
            verl_list  = new List <DnbVerlag>();
            print_list = new List <DnbPrinter>();
            var language = from lg in Admin.conn.Language orderby lg.Language1 select new { lng = lg.Language1, iso = lg.iso, id = lg.LanguageID };

            cbLang.ItemsSource = language.ToList();
            var bind = from b in Admin.conn.Bindung orderby b.SortBy select new { bnd = b.SortBy, id = b.BindingID };

            cbBindung.ItemsSource = bind.ToList();
            var typ = from t in Admin.conn.BuchTyp orderby t.SortBy select new { typ = t.SortBy, id = t.ID };

            cbBuchTyp.ItemsSource = typ.ToList();
            var sach = from s in Admin.conn.Sachgruppe orderby s.SortBy select new { sg = s.SortBy, id = s.GenreID };

            cbSachgruppe.ItemsSource = sach.ToList();
            var sto = from st in Admin.conn.Standort orderby st.SortBy select new { so = st.SortBy, id = st.ID };

            cbStandort.ItemsSource = sto.ToList();
            var kat = from k in Admin.conn.DDC_Haupt orderby k.DDC select new { kat = k.DDC_Name, id = k.ID };

            cbKategorie.ItemsSource = kat.ToList();
            var serie = from s in Admin.conn.Serien orderby s.SortBy select new { serie = s.SortBy, id = s.ID };

            cbSerie.ItemsSource = serie.ToList();



            db = DNBDataHandling.GetDataDNB(dnbID);
            ShowPerson();
            FindPublisher(db.dnb_verlagsname);
            FindLanguage(db.dnb_sprache);
            FindOrigLanguage(db.dnb_sprache_org);
            imgLoad();
            LoadNewData();
        }
        public void loadSettings()
        {
            mySettings mySettings = new mySettings(new mySettings_Settings())
            {
                sqlc = sqlc, userid = userid, username = username
            };

            if (!mySettings.hasSettings())
            {
                mySettings.initializeSettings();
            }
            mySettings_Settings settings = mySettings.getSettings();

            if (File.Exists("ibeam.cur"))
            {
                myCursor = new Cursor(File.OpenRead(System.AppDomain.CurrentDomain.BaseDirectory + "ibeam.cur"));
            }

            tb_Data.CaretBrush  = nightMode ? Brushes.WhiteSmoke : Brushes.Red;
            tb_Title.CaretBrush = tb_Data.CaretBrush;

            useLightCursor = Properties.Settings.Default.s_textboxLightCursor;
            lightCursorWithNightModeOnly = Properties.Settings.Default.s_textboxLightCursorNightOnly;

            if (useLightCursor && (!lightCursorWithNightModeOnly || nightMode))
            {
                tb_Data.Cursor  = myCursor;
                tb_Title.Cursor = myCursor;
            }
            else
            {
                tb_Data.Cursor  = Cursors.IBeam;
                tb_Title.Cursor = Cursors.IBeam;
            }

            System.Drawing.Color c = nightMode ? Properties.Settings.Default.s_night_DayColor : Properties.Settings.Default.s_day_DayColor;
            dayColor = colortobrush(c);

            c           = nightMode ? Properties.Settings.Default.s_night_SundayColor : Properties.Settings.Default.s_day_SundayColor;
            sundayColor = colortobrush(c);

            c = nightMode ? Properties.Settings.Default.s_night_MainBackgroundColor : Properties.Settings.Default.s_day_MainBackgroundColor;
            mainBackgroundColor = colortobrush(c);

            c = nightMode ? Properties.Settings.Default.s_night_TextboxBackgroundColor : Properties.Settings.Default.s_day_TextboxBackgroundColor;
            textboxBackgroundColor = colortobrush(c);

            c         = nightMode ? Properties.Settings.Default.s_night_TextColor : Properties.Settings.Default.s_day_TextColor;
            textColor = colortobrush(c);

            c            = nightMode ? Properties.Settings.Default.s_night_DayTextColor : Properties.Settings.Default.s_day_DayTextColor;
            dayTextColor = colortobrush(c);

            c = nightMode ? Properties.Settings.Default.s_night_SelectedDayColor : Properties.Settings.Default.s_day_SelectedDayColor;
            selectedDayColor = colortobrush(c);

            c = nightMode ? Properties.Settings.Default.s_night_TextSelectionBrush : Properties.Settings.Default.s_day_TextSelectionBrush;
            textSelectionColor = colortobrush(c);

            foreach (var v in langs)
            {
                Console.WriteLine(System.Windows.Markup.XmlLanguage.GetLanguage(v.Key));
            }

            Background                = mainBackgroundColor;
            tb_Data.Background        = textboxBackgroundColor;
            tb_Title.Background       = textboxBackgroundColor;
            tb_Data.Foreground        = textColor;
            tb_Title.Foreground       = textColor;
            tb_Data.SelectionBrush    = textSelectionColor;
            tb_Data.TextWrapping      = Properties.Settings.Default.s_tbWordWrap ? TextWrapping.Wrap : TextWrapping.NoWrap;
            tb_Data.Language          = System.Windows.Markup.XmlLanguage.GetLanguage(Properties.Settings.Default.s_tbLanguage);
            tb_Data.Padding           = new Thickness(5, 5, 5, 5);
            tb_Data.AutoWordSelection = true;
            tb_Data.IsInactiveSelectionHighlightEnabled = true;
            tb_Data.IsUndoEnabled = true;
            tb_Data.UndoLimit     = 1000;

            if (Properties.Settings.Default.s_PanelClosed)
            {
                hidePanel();
            }
            else
            {
                showPanel();
            }
        }
Beispiel #4
0
 public io()
 {
     this.settings = new mySettings();
 }