public void MakeBlankDocument() { CleanUpPrivateVariables(); m_NotepadXXmlDocument.LoadXml("<" + m_catNoteConfiguration.XmlTagName + @" id=""" + m_catNoteConfiguration.RootNoteId + @""" title=""" + m_catNoteConfiguration.DefaultRootNoteTitle + @"""/>"); m_catNoteConfiguration.IsDocumentReadOnly = false; ContentDetail rootNote = this.GetNoteById(this.Configuration.RootNoteId); rootNote.SetCreatedByInfo(); rootNote.SetCustomAttribute("openWithApplicationName", "NotepadX"); rootNote.SetCustomAttribute("openWithApplicationHomePage", @"http://www.ShitalShah.com/notepadx"); m_catNoteConfiguration.SetIsDirty(true); }
public ContentDetail Add(string noteTitle) { if (m_catNoteConfiguration.IsDocumentReadOnly == false) { ContentDetail newNoteForCollection = ContentDetail.CreateCatNoteDetail(m_NotepadXDocumentParentXmlNode, m_catNoteConfiguration); newNoteForCollection.Title = noteTitle; newNoteForCollection.SetCreatedByInfo(); Dictionary.Add(newNoteForCollection.Id, newNoteForCollection); m_catNoteConfiguration.SetIsDirty(true); return(newNoteForCollection); } else { throw new ReadOnlyDocumentException("Can not add new note because this document is read-only"); } }