Beispiel #1
0
        public NewNoteWindow(TAG selectedTag, XuLy_DuLieu_Tag xlTag, XuLy_DuLieu_TextNote xlTextNote)
        {
            InitializeComponent();
            listNameTag = new List <string>();
            newNote     = new TEXTNOTE();

            infoContentNote.Children.Clear();
            infoContentNote.Children.Add(new EditText(newNote));

            curProcessTextNote = xlTextNote;
            curProcessTag      = xlTag;
        }
        public void createListViewAllNotesSort()
        {
            selectedTag = xlTag.getTagByContent(tagName);

            List <TEXTNOTE> listTnote;

            if (tagName.Equals("ViewAllNote") == true)
            {
                listTnote = xlTextNote.getAllTextNote();
            }
            else
            {
                listTnote = xlTag.getAllTextNoteByTag(tagName);
            }

            List <TEXTNOTE> listNoteClone = new List <TEXTNOTE>();

            foreach (TEXTNOTE note in listTnote)
            {
                TEXTNOTE newNote = new TEXTNOTE();
                newNote.assignTextNote(note);
                listNoteClone.Add(newNote);
            }

            // Dieu chinh lai cach hien thi
            // Load xaml text
            foreach (TEXTNOTE curNote in listNoteClone)
            {
                RichTextBox rtbContent = new RichTextBox();

                if (curNote.mContent != null)
                {
                    TextRange textRange = new TextRange(rtbContent.Document.ContentStart, rtbContent.Document.ContentEnd);
                    using (MemoryStream memStream = GetMemoryStreamFromString(curNote.mContent))
                    {
                        textRange.Load(memStream, DataFormats.Xaml);
                        curNote.mContent = textRange.Text;
                    }
                }
            }

            // Them vao list view.

            lvAllNote.ItemsSource = listNoteClone;
        }
Beispiel #3
0
        public NewNoteWindow(XuLy_DuLieu_Tag xlTag, XuLy_DuLieu_TextNote xlTextNote)
        {
            InitializeComponent();

            addNoteWindow.Left = 400;
            addNoteWindow.Top  = 200;

            listNameTag         = new List <string>();
            newNote             = new TEXTNOTE();
            newNote.mAccessTime = DateTime.Now;

            curProcessTextNote = xlTextNote;
            curProcessTag      = xlTag;

            infoContentNote.Children.Clear();
            edittextIns = new EditText(newNote);
            infoContentNote.Children.Add(edittextIns);
        }
Beispiel #4
0
        public EditText(TEXTNOTE curNote)
        {
            InitializeComponent();
            textNoteIns = new TEXTNOTE();
            textNoteIns.assignTextNote(curNote);

            // Load xaml text
            if (textNoteIns.mContent != null)
            {
                TextRange textRange = new TextRange(rtbEditor.Document.ContentStart, rtbEditor.Document.ContentEnd);
                using (MemoryStream memStream = GetMemoryStreamFromString(textNoteIns.mContent))
                {
                    textRange.Load(memStream, DataFormats.Xaml);
                }
            }
            cmbFontFamily.ItemsSource = Fonts.SystemFontFamilies.OrderBy(f => f.Source);
            cmbFontSize.ItemsSource   = new List <double>()
            {
                8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72
            };
            cmbFontFamily.SelectedIndex = 0;
            cmbFontSize.SelectedIndex   = 0;
        }