Exemple #1
0
        public MainWindow()
        {
            if (!File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + @"\cnfg.xml"))
            {
                Cnfgcs c = new Cnfgcs();
                c.Path_NotesSave = System.AppDomain.CurrentDomain.BaseDirectory + @"\saves\notessave.xml";
                c.Path_SafeSave  = System.AppDomain.CurrentDomain.BaseDirectory + @"\saves\safesave.xml";
                c.Path_Save      = System.AppDomain.CurrentDomain.BaseDirectory + @"\saves\save.xml";
                TheSerialiingClass.serialize <Cnfgcs>(System.AppDomain.CurrentDomain.BaseDirectory + @"\cnfg.xml", c);
            }
            if (!Directory.Exists(System.AppDomain.CurrentDomain.BaseDirectory + @"\saves"))
            {
                Directory.CreateDirectory(System.AppDomain.CurrentDomain.BaseDirectory + @"\saves");
            }
            cnfgcs           = TheSerialiingClass.deserialize <Cnfgcs>(System.AppDomain.CurrentDomain.BaseDirectory + @"\cnfg.xml");
            TheBooks         = TheSerialiingClass.deserialize <Books>(cnfgcs.Path_Save);
            mCatagoies       = new ObservableCollection <string>(Enum.GetNames(typeof(Catagory)).ToList <string>());
            mReadingStatuses = new ObservableCollection <string>(Enum.GetNames(typeof(ReadingStatus)).ToList <string>());
            InitializeComponent();
            lscg = new ListViewColumnGenerator(ref this.BooksLstView);
            this.CatagoryLstBx.ItemsSource      = mCatagoies;
            this.ReadingStatusLstBx.ItemsSource = mReadingStatuses;
            this.TagsLstBx.ItemsSource          = TheBooks.Tags;


            notesHolderConstroller          = new SomeNotesHolderConstroller();
            this.SomeNotesLstBx.ItemsSource = notesHolderConstroller.SomeNotesHolder.SomeNotes;
            Console.WriteLine(cnfgcs.Path_Save);
        }
 public SomeNotesHolderConstroller()
 {
     SomeNotesHolder = TheSerialiingClass.deserialize <SomeNotesHolder>(MainWindow.cnfgcs.Path_NotesSave);
 }