Exemplo n.º 1
0
        protected PresentationToOneNoteCapability(DynamicProperties dynaProps, string version) : base(dynaProps)
        {
            base.isSender        = false;
            base.ObjectReceived += new CapabilityObjectReceivedEventHandler(OnObjectReceived);

            // Get OneNote import server
            oneNoteServer = new OneNote.ImportServer();
            importer      = (OneNote.ISimpleImporter)oneNoteServer;

            // Get current OneNote notebook directory from Registry
            using (RegistryKey regKey = Registry.CurrentUser.OpenSubKey(
                       string.Format(notebookRegKeyPath, version)))
            {
                string notebookPath = (string)regKey.GetValue(notebookRegKeyName);

                if (notebookPath == null || notebookPath == "My Notebook")
                {
                    oneNoteNotebookDir = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal)
                                         + "\\My Notebook";
                }
                else
                {
                    oneNoteNotebookDir = notebookPath;
                }
            }

            if (!Directory.Exists(tfc.BasePath))
            {
                Directory.CreateDirectory(tfc.BasePath);
            }

            // Delete the old log file, if it exists
            if (System.IO.File.Exists("log.xml"))
            {
                System.IO.File.Delete("log.xml");
            }

            // We don't create the blank RTDoc here like Presentation does becuase the
            //  user may decide to open a document, causing the user of OneNote to have
            //  a section with a blank page in it for no purpose.
        }
Exemplo n.º 2
0
        protected PresentationToOneNoteCapability(DynamicProperties dynaProps, string version)
            : base(dynaProps)
        {
            base.isSender = false;
            base.ObjectReceived += new CapabilityObjectReceivedEventHandler(OnObjectReceived);

            // Get OneNote import server
            oneNoteServer = new OneNote.ImportServer();
            importer = (OneNote.ISimpleImporter)oneNoteServer;

            // Get current OneNote notebook directory from Registry
            using (RegistryKey regKey = Registry.CurrentUser.OpenSubKey(
                string.Format(notebookRegKeyPath, version )))
            {
                string notebookPath = (string)regKey.GetValue( notebookRegKeyName );

                if( notebookPath == null || notebookPath == "My Notebook" )
                {
                    oneNoteNotebookDir = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal)
                        + "\\My Notebook";
                }
                else
                {
                    oneNoteNotebookDir = notebookPath;
                }
            }

            if (!Directory.Exists(tfc.BasePath))
                Directory.CreateDirectory(tfc.BasePath);

            // Delete the old log file, if it exists
            if( System.IO.File.Exists("log.xml") )
                System.IO.File.Delete("log.xml");

            // We don't create the blank RTDoc here like Presentation does becuase the
            //  user may decide to open a document, causing the user of OneNote to have
            //  a section with a blank page in it for no purpose.
        }