Beispiel #1
0
        private void Init()
        {
            //FontLabel.Content = NoteContents.FontSize;
            if (!User.Instance.IsInstalled())
            {
                User.Instance.Install();
            }

            User.Instance.Deserialize();
            FlowDocumentBuilder fdb = new FlowDocumentBuilder();

            //AddDummyCourses(); //TODO: Delete this

            NoteContents.Document = fdb.BuildDocument(User.Instance.Courses);
        }
Beispiel #2
0
        private void Load_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter           = "XML Files|*.xml";
            ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            if (ofd.ShowDialog() == true)
            {
                string filepath = ofd.FileName;
                DLogger.Log("File opened: " + filepath);

                //Build the document
                FlowDocumentBuilder fdb = new FlowDocumentBuilder();
                FlowDocument        doc = fdb.BuildDocument(filepath);

                //Set the text
                NoteContents.Document = doc;
            }
            else
            {
            }
        }