Esempio n. 1
0
 private void OnOpenWorkBook(Excel.Workbook Wb)
 {
     try
     {
         if (!GenerateUDFAtStartup())
         {
             Log.Debug("Do not generate user defined functions on workbook opening (as configured).");
         }
         else if (HasGeneratedUDFs())
         {
             Log.DebugFormat("Opening '{0}' workbook. User defined functions have already been generated. Do nothing.", Wb.Name);
         }
         else if (Application.ActiveWorkbook == null)
         {
             Log.DebugFormat("Opening Inactive '{0}' workbook. Waiting for workbook activation...", Wb.Name);
         }
         else
         {
             Log.DebugFormat("Opening '{0}' workbook. Generating user defined functions...", Wb.Name);
             ServiceConfigurationForm.UpdateServices();
             LoadXlWings();
             ImportUserDefinedFunctions();
         }
     }
     catch (Exception ex)
     {
         Log.Error("An error occurred while loading PyxelRest on workbook opening.", ex);
     }
 }
Esempio n. 2
0
 private void OnExcelStart()
 {
     if (!GenerateUDFAtStartup())
     {
         Log.Debug("Do not generate user defined functions at Microsoft Excel start (as configured).");
     }
     else if (Application.ActiveWorkbook == null)
     {
         Log.Debug("Microsoft Excel started with an already existing document. Wait for workbook opening event to generate user defined functions.");
     }
     else
     {
         Log.Debug("Microsoft Excel started with a blank document. Generating user defined functions...");
         ServiceConfigurationForm.UpdateServices();
         LoadXlWings();
         ImportUserDefinedFunctions();
     }
 }
Esempio n. 3
0
 public ServicePanel(ServiceConfigurationForm configurationForm, Service service)
 {
     this.configurationForm = configurationForm;
     this.service           = service;
     servicePanel           = DefaultPanel();
 }