예제 #1
0
        public void AutoOpen()
        {
            try
            {
                AddinContext.ConfigManager = new ConfigurationManagerWrapper();

                // Settings the path to the Add-In
                AddinContext.Settings.AddinPath = (string)XlCall.Excel(XlCall.xlGetName);

                // Token cancellation is useful to close all existing Tasks<> before leaving the application
                AddinContext.TokenCancellationSource = new CancellationTokenSource();

                // The Excel Application object
                AddinContext.ExcelApp = new Application(null, ExcelDnaUtil.Application);

                // Start the bootstrapper now
                new Bootstrapper(AddinContext.TokenCancellationSource.Token).Start();
            }
            catch (Exception e)
            {
                LogDisplay.RecordLine(e.Message);
                LogDisplay.RecordLine(e.StackTrace);
                LogDisplay.Show();
            }
        }
예제 #2
0
 public void AutoOpen()
 {
     try
     {
         // The Excel Application object
         AddinContext.ExcelApp = new Application(null, ExcelDnaUtil.Application);
     }
     catch (Exception e)
     {
         LogDisplay.RecordLine(e.Message);
         LogDisplay.RecordLine(e.StackTrace);
         LogDisplay.Show();
     }
 }
예제 #3
0
        public void Emit(LogEvent logEvent)
        {
            EnsureNotDisposed();

            var stringWriter = new StringWriter(new StringBuilder(256));

            _formatter.Format(logEvent, stringWriter);

            lock (_syncRoot)
            {
                LogDisplay.DisplayOrder = _displayOrder;
                LogDisplay.RecordLine(stringWriter.ToString());
            }
        }
예제 #4
0
        public void AutoOpen()
        {
            try
            {
                // Token cancellation is useful to close all existing Tasks<> before leaving the application
                AddinContext.TokenCancellationSource = new CancellationTokenSource();

                AddinContext.ExcelApp = new Xl.Application(null, ExcelDnaUtil.Application);

                // Start the bootstrapper now
                new Bootstrapper(AddinContext.TokenCancellationSource.Token).Start();
            }
            catch (Exception e)
            {
                LogDisplay.RecordLine(e.Message);
                LogDisplay.RecordLine(e.StackTrace);
                LogDisplay.Show();
            }
        }
 public override void RecordLine(string format, params object[] args)
 {
     LogDisplay.RecordLine(format, args);
 }
예제 #6
0
 public static void logError(string callerAddress, string callerName, string Message)
 {
     OHRepository.Instance.storeErrorMsg(callerAddress, Message);
     LogDisplay.RecordLine("{0}\t{1}\t{2}", callerAddress, callerName, Message);
 }