Ejemplo n.º 1
0
        /// <summary>
        /// Creates a OneNote content reader for a particular onenote instantiation and item in the hierarchy.
        /// </summary>
        /// <param name="drive">Can be used to get to the OneNote instantiation.</param>
        /// <param name="node">The OneNote XML node that identifies the node to "get."</param>
        public ContentReader(OneNoteDriveInfo drive, XmlNode node)
        {
            string id = node.Attributes["ID"].Value;
            string xml;

            Microsoft.Office.Interop.OneNote.ApplicationClass _app = new Microsoft.Office.Interop.OneNote.ApplicationClass( );
            _app.GetPageContent(id, out xml, Microsoft.Office.Interop.OneNote.PageInfo.piBasic);
            XmlDocument doc = new XmlDocument( );

            doc.LoadXml(xml);
            _text = Microsoft.Office.OneNote.PowerShell.Utilities.PrettyPrintXml(doc).Split(new char[] { '\n' });
        }
 protected override void BeginProcessing( )
 {
     _app = new Microsoft.Office.Interop.OneNote.ApplicationClass( );
 }
 protected override void BeginProcessing( )
 {
     _app = new Microsoft.Office.Interop.OneNote.ApplicationClass( );
 }
 /// <summary>
 /// Creates a OneNote content reader for a particular onenote instantiation and item in the hierarchy.
 /// </summary>
 /// <param name="drive">Can be used to get to the OneNote instantiation.</param>
 /// <param name="node">The OneNote XML node that identifies the node to "get."</param>
 public ContentReader(OneNoteDriveInfo drive, XmlNode node)
 {
     string id = node.Attributes["ID"].Value;
     string xml;
     Microsoft.Office.Interop.OneNote.ApplicationClass _app = new Microsoft.Office.Interop.OneNote.ApplicationClass( );
     _app.GetPageContent(id, out xml, Microsoft.Office.Interop.OneNote.PageInfo.piBasic);
     XmlDocument doc = new XmlDocument( );
     doc.LoadXml(xml);
     _text = Microsoft.Office.OneNote.PowerShell.Utilities.PrettyPrintXml(doc).Split(new char[] { '\n' });
 }