示例#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);
        }
示例#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
            {
            }
        }