Пример #1
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     try
     {
         string timestampNow = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-FFF");
         etc.FileLogger.Instance.Init("log-" + timestampNow + ".log");
         etc.LoggerHelper.EventCategoryCountChanged += LoggerHelper_EventCategoryCountChanged;
         advancedToolStripMenuItem.Visible           = false; // Hide advanced features by default
         accessor              = new OneNoteAccessor();
         accessor.OnCancelled += Accessor_OnCancelled;
         var retInit = accessor.InitializeOneNoteWrapper();
         if (retInit.Item1 == false)
         {
             etc.LoggerHelper.LogError(retInit.Item2);
             SetUIControlEnabled(false);
             toolStripStatusLabelScan.Text = "Fatal Error";
         }
         else
         {
             SetUIControlEnabled(true);
             toolStripStatusLabelScan.Text = "Ready";
         }
     }
     catch (System.Exception exception)
     {
         etc.LoggerHelper.LogUnexpectedException(exception);
     }
 }
Пример #2
0
 private void InitializeOneNoteAccessor()
 {
     try
     {
         _accessor = new OneNoteAccessor();
         _accessor.OnUpdatedScanProgress += _accessor_OnUpdatedScanProgress;;
         _accessor.InitializeOneNoteWrapper();
     }
     catch (System.Exception exception)
     {
         etc.LoggerHelper.LogException(exception);
     }
 }
 private void InitializeOneNoteAccessor()
 {
   try
   {
     onenoteAccessor = new OneNoteAccessor();
     onenoteAccessor.OnProgressEvent += onenoteAccessor_OnProgressEvent;
     onenoteAccessor.OnAbortedEvent += onenoteAccessor_OnAbortedEvent;
     onenoteAccessor.InitializeOneNoteWrapper();
   }
   catch (System.Exception exception)
   {
     etc.LoggerHelper.LogException(exception);
   }
 }
 public FormAbout(OneNoteAccessor accessor)
 {
     this.accessor = accessor;
     InitializeComponent();
 }
 private void InitializeOneNoteAccessor()
 {
     try
     {
         _accessor = new OneNoteAccessor();
         _accessor.OnUpdatedScanProgress += _accessor_OnUpdatedScanProgress; ;
         _accessor.InitializeOneNoteWrapper();
     }
     catch (System.Exception exception)
     {
         etc.LoggerHelper.LogException(exception);
     }
 }