private HierarchicalContentDocument(DocumentConfiguration thisNotepadXConfiguration, bool isDirty, bool makeNewDocument)
 {
     InitializePrivateVars(thisNotepadXConfiguration);
     if (makeNewDocument)
     {
         MakeBlankDocument();
     }
     m_catNoteConfiguration.SetIsDirty(isDirty);
 }
        protected internal ContentDetailCollection(XmlNode NotepadXParentXmlNode, DocumentConfiguration thisNotepadXConfiguration)
        {
            m_NotepadXDocumentParentXmlNode = NotepadXParentXmlNode;
            m_catNoteConfiguration          = thisNotepadXConfiguration;

            foreach (XmlNode catNoteDetailNode in NotepadXParentXmlNode.ChildNodes)
            {
                ContentDetail newNoteForCollection = new ContentDetail(catNoteDetailNode, m_catNoteConfiguration);
                Dictionary.Add(newNoteForCollection.Id, newNoteForCollection);
            }
        }
        protected internal ContentDetail(XmlNode catNoteDetailXmlNode, DocumentConfiguration thisNotepadXConfiguration)
        {
            m_catNoteConfiguration = thisNotepadXConfiguration;
            m_catNoteDetailXmlNode = catNoteDetailXmlNode;

            if (this.IsEncrypted == true)
            {
                //Restore password from cache
                if (m_catNoteConfiguration.SavedPasswordsForEncryptedNotes.IsSavedPasswordExistForNoteID(this.Id) == true)
                {
                    m_passwordForEncryptedNote = (string)m_catNoteConfiguration.SavedPasswordsForEncryptedNotes.GetSavedPasswordForNoteID(this.Id);
                }
            }
            else
            {
            };                   //no pw processing required
        }
        protected internal static ContentDetail CreateCatNoteDetail(XmlNode parentXmlNode, DocumentConfiguration thisNotepadXConfiguration)
        {
            XmlDocument ownerDocument;

            if (parentXmlNode.OwnerDocument != null)
            {
                ownerDocument = parentXmlNode.OwnerDocument;
            }
            else
            {
                ownerDocument = (XmlDocument)parentXmlNode;
            }
            XmlNode      newCatNoteDetailXmlNode = ownerDocument.CreateElement(thisNotepadXConfiguration.XmlTagName);
            XmlAttribute idXmlAttribute          = ownerDocument.CreateAttribute("id");

            idXmlAttribute.Value = System.Guid.NewGuid().ToString();
            newCatNoteDetailXmlNode.Attributes.Append(idXmlAttribute);

            XmlAttribute titleXmlAttribute = ownerDocument.CreateAttribute("title");

            newCatNoteDetailXmlNode.Attributes.Append(titleXmlAttribute);
            XmlAttribute contentXmlAttribute = ownerDocument.CreateAttribute("content");

            newCatNoteDetailXmlNode.Attributes.Append(contentXmlAttribute);

            parentXmlNode.AppendChild(newCatNoteDetailXmlNode);

            thisNotepadXConfiguration.SetIsDirty(true);

            return(new ContentDetail(newCatNoteDetailXmlNode, thisNotepadXConfiguration));
        }
 public HierarchicalContentDocument(string fileName, DocumentConfiguration config) : this(config, false, false)
 {
     LoadFromFile(fileName);
 }
 public HierarchicalContentDocument(System.IO.Stream inStream, DocumentConfiguration config) : this(config, false, false)
 {
     m_NotepadXXmlDocument.Load(inStream);
     m_catNoteConfiguration.SetIsDirty(false);
 }
 private void InitializePrivateVars(DocumentConfiguration thisNotepadXConfiguration)
 {
     CleanUpPrivateVariables();
     m_NotepadXXmlDocument  = new XmlDocument();
     m_catNoteConfiguration = thisNotepadXConfiguration;
 }
 public HierarchicalContentDocument(DocumentConfiguration thisNotepadXConfiguration) : this(thisNotepadXConfiguration, thisNotepadXConfiguration.IsDirty, true)
 {
 }