示例#1
0
 //https://msdn.microsoft.com/zh-cn/library/bb687830.aspx
 //Called by Microsoft Excel whenever the XLL is deactivated. The add-in is deactivated when an Excel session ends normally. The add-in can be deactivated by the user during an Excel session, and this function will be called in that case.
 //Excel does not require an XLL to implement and export this function, although it is advisable so that your XLL can unregister functions and commands, release resources, undo customizations, and so on.If functions and commands are not explicitly unregistered by the XLL, Excel does this after calling the xlAutoClose function.
 public void AutoClose()
 {
     // The explicit Uninstall call was added in version 1.0.10,
     // to give us a chance to unhook the WinEvents (which needs to happen on the main thread)
     // No easy plan to do this from the AppDomain unload event, which runs on a ThreadPool thread.
     IntelliSenseServer.Uninstall();
 }
示例#2
0
        public void AutoOpen()
        {
            // loading intelli server in debug gives deadlock
#if !DEBUG
            IntelliSenseServer.Install();
#endif
        }
示例#3
0
        public void AutoOpen()
        {
            // This registers the intellisense server. ATM this plugin is slightly buggy and prone to crashes.
            IntelliSenseServer.Register();

            // Reset the stop execution function incase excel crashed last time.
            QuandlConfig.StopCurrentExecution = false;
        }
示例#4
0
        public void AutoOpen()
        {
            var listener = new LogDisplayTraceListener();

            Trace.Listeners.Add(listener);
            ExcelIntegration.RegisterUnhandledExceptionHandler(
                ex => "Unhandled EXCEPTION: " + ex.ToString());
            IntelliSenseServer.Install();
        }
示例#5
0
    public void AutoOpen()
    {
        // Versions before v1.1.0 required only a call to Register() in the AutoOpen().
        // The name was changed (and made obsolete) to highlight the pair of function calls now required.
        IntelliSenseServer.Install();

        // HACK: Next line only to load RDKit2DotNet before using in NCDK-AddIn.
        new GraphMolWrap.ROMol();
    }
示例#6
0
        private static bool Connect()
        {
            bool result = false;

            IntelliSenseServer.Register();

            // Create a client connector which will do an initial request to the Opus ServerSocket and retrieve all available methods.
            var            socketConnector = new SocketConnector();
            MethodRegistry registry        = new MethodRegistry(socketConnector);

            // Execute the INITIALIZE function to retrieve all available functions from the client
            ResponsePayload response = socketConnector.executeFn(new FunctionPayload(SocketConnector.INITIALIZE));

            if (response != null && response.matrix != null && response.matrix.data != null)
            {
                // The inital request returns the available functions.
                // Example Message from Client:
                // { "name":"INITIALIZE",
                //   "matrix":[["getVersion",[]],["getPortfolio",[["accountSegmentId","The Account Segment Id for which the Portfolio will be fetched."]]],["getCurrencies",[]]],"error":""}
                response.matrix.data.ForEach(entry =>
                {
                    // TODO: Create a serializable Wrapper Class to do this.
                    var arguments = new List <OpuxlArgumentAttribute>();
                    // First Element is the function name
                    string functionName        = (string)entry.ElementAt(0);
                    string functionDescription = (string)entry.ElementAt(1);
                    // and second Element is an array of parameterName/parameterDescription pairs.
                    JArray argsArray = (JArray)entry.ElementAt(2);

                    foreach (JArray arg in argsArray)
                    {
                        // Create an Excel Argument for each Function Parameter.
                        arguments.Add(new OpuxlArgumentAttribute
                        {
                            Name        = arg.ElementAt(0).ToString(),
                            Description = arg.ElementAt(1).ToString(),
                            Type        = Main.ParseEnum <ExcelType>(arg.ElementAt(2).ToString()),
                            Optional    = Boolean.Parse(arg.ElementAt(3).ToString())
                        });
                    }
                    // Create a delegate in our registry for each function
                    registry.addDelegate(functionName, functionDescription, arguments);
                });
                result = true;
            }
            else
            {
                Debug.WriteLine("Response not set, cant register functions.");
            }


            // Register all retrieves functions as delegates which are going to be available in excel.
            registry.createDelegates();
            return(result);
        }
示例#7
0
        public void AutoOpen()
        {
            if (AddIn.IsFirstRun == true)
            {
                IntelliSenseServer.Register();
                AddIn.IsFirstRun = false;
            }

            ExcelApp = ExcelDnaUtil.Application as Excel.Application;
            ExcelApp.SheetActivate        += ExcelApp_SheetActivate;
            ExcelApp.SheetSelectionChange += ExcelApp_SheetSelectionChange;
        }
示例#8
0
 /// <summary>Initialize the <see cref="IExcelAddIn"/>.
 /// </summary>
 public void AutoOpen()
 {
     try
     {
         IntelliSenseServer.Install();
         ExcelIntegration.RegisterUnhandledExceptionHandler(UnhandledExceptionHandler);  // add a 'standard-output' if a try-catch block is missing
     }
     catch (Exception e)
     {
         MessageBox.Show(String.Format("{0} Stack trace: {1}", e.Message, e.StackTrace), "Dodoni.net (XL-BasicComponents): Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public void Initialize()
        {
            IntelliSenseServer.Register();
            ExcelIntegration.RegisterUnhandledExceptionHandler(ex =>
            {
                var message = (ex as Exception)?.Message;
                if (ex is AggregateException)
                {
                    message = ((AggregateException)ex).GetBaseException().Message;
                }

                return($"#ERROR: {message}");
            });
        }
示例#10
0
        public void AutoOpen()
        {
            try
            {
                SetupExceptions();
                SetupRegistration();
                SetupKernel();
                IntelliSenseServer.Register();

                m_Log.Info("ExcelScript Addin loaded");
            } catch (Exception ex)
            {
                throw;
            }
        }
示例#11
0
        public void AutoOpen()
        {
            var functions = ExcelRegistration.GetExcelFunctions().ToList();

            if (HasNativeXMatch())
            {
                foreach (var func in functions)
                {
                    func.FunctionAttribute.Name = func.FunctionAttribute.Name + ".FROM.ADDIN";
                }
            }
            functions.RegisterFunctions();

            IntelliSenseServer.Install();
        }
示例#12
0
文件: Init.cs 项目: KitCognac/XLIG
        public void AutoClose()
        {
            // Dispose Mouse Hook
            MouseHook_Main.M_AppHook.Dispose();

            // Unsubribe ws/wb event
            AddinContext.XlApp.SheetDeactivate    -= XlAppEvent_SheetDeactivate;
            AddinContext.XlApp.WorkbookDeactivate -= XlAppEvent_WorkbookDeactivate;
            AddinContext.XlApp.WorkbookActivate   -= XlAppEvent_WorkbookActivate;

            // It is recommended to unattacth this IntelliSense server
            IntelliSenseServer.Uninstall();
            // Kill Shadow Excel Instance
            AddinContext.XlApp.Quit();
        }
示例#13
0
        public void AutoOpen()
        {
            try
            {
                //This is disbaled until resolved in Excel 2016
                IntelliSenseServer.Register();

                InitData();
                InitSettings();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
                throw e;
            }
        }
示例#14
0
        public void AutoOpen()
        {
#if DEBUG
            // uncomment to break into debugger with debug build (easier to debug)
            //System.Diagnostics.Debug.Assert(false);
#endif
            Shared.Helpers.HttpHelper.EnableTlsSupport();
            Shared.Globals.Instance.HostService = new ExcelDnaHostService();
            // This registers the intellisense server. ATM this plugin is slightly buggy and prone to crashes.
            // For IntelliSense 1.0.9
            IntelliSenseServer.Register();
            // For IntelliSense 1.1.0
            //IntelliSenseServer.Install();

            // Reset the stop execution function incase excel crashed last time.
            QuandlConfig.StopCurrentExecution = false;
        }
示例#15
0
        public void AutoOpen()
        {
            var functions = ExcelRegistration.GetExcelFunctions().ToList();

            if (HasNativeXMatch())
            {
                foreach (var func in functions)
                {
                    func.FunctionAttribute.Name = "HUST." + func.FunctionAttribute.Name;
                }
            }
            functions.RegisterFunctions();

            ///Cho phép hiển thị các dòng gợi ý hàm và gợi ý tham số của các thuộc tính
            ///<see cref="ExcelDna.Integration.ExcelFunctionAttribute"/> và <see cref="ExcelDna.Integration.ExcelArgumentAttribute"/>
            IntelliSenseServer.Install();
        }
示例#16
0
文件: Init.cs 项目: KitCognac/XLIG
        public void AutoOpen()
        {
            // Add Export Tables to SQL Custom Pane
            System.Windows.Forms.Application.EnableVisualStyles();
            XLIG.ExportTables.CTPManager.InitCTManager();
            // Enable IntelliSense for UDF
            IntelliSenseServer.Install();
            // Ref Current Excel App to Global Var for further usage
            AddinContext.XlApp = (Excel.Application)ExcelDnaUtil.Application;
            // Hook Mouse on First Load
            MouseHook_Main.M_AppHook = Hook.AppEvents();
            MouseHook_Main.Init_Unload(XLIG.Properties.Settings.Default.HScroll);

            // Hook ws event to Ctrl+Tab switch back to old sheet
            AddinContext.XlApp.SheetDeactivate    += XlAppEvent_SheetDeactivate;
            AddinContext.XlApp.WorkbookDeactivate += XlAppEvent_WorkbookDeactivate;
            AddinContext.XlApp.WorkbookActivate   += XlAppEvent_WorkbookActivate;
        }
示例#17
0
        public void AutoClose()
        {
            IntelliSenseServer.Uninstall();
            Java.Dispose();
            WDSJniPMMLMenuToDelete.Delete(true);
            ExcelCommandBarUtil.UnloadCommandBars();

            __JniPMML            = null;
            Java                 = null;
            pair                 = null;
            java_class_path      = null;
            java_init_classid    = IntPtr.Zero;
            java_init_class_name = null;

            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
示例#18
0
        public void AutoOpen()
        {
            if (AddIn.IsFirstRun == true)
            {
                IntelliSenseServer.Install();
                AddIn.IsFirstRun = false;
            }

            ExcelApp = ExcelDnaUtil.Application as Excel.Application;
            //ExcelApp.SheetActivate += ExcelApp_SheetActivate;
            ExcelApp.SheetSelectionChange += ExcelApp_SheetSelectionChange;
            ExcelApp.WindowActivate       += ExcelApp_WindowActivate;
            ExcelRegistration.GetExcelFunctions()//在此处显示注册函数
            .Where(func => func.FunctionAttribute.Name.StartsWith("Params"))
            .ProcessParamsRegistrations()
            .RegisterFunctions();


            //ComAddInConnection com_addin = new ComAddInConnection();
            //ExcelComAddInHelper.LoadComAddIn(com_addin);
        }
示例#19
0
 public void AutoClose()
 {
     IntelliSenseServer.Uninstall();
 }
示例#20
0
 public void AutoOpen()
 {
     IntelliSenseServer.Install();
 }
 public override void Refresh()
 {
     IntelliSenseServer.Refresh();
 }
 public override void Uninstall()
 {
     IntelliSenseServer.Uninstall();
 }
 public override void Install()
 {
     IntelliSenseServer.Install();
 }
 public override void Register()
 {
     IntelliSenseServer.Register();
 }
示例#25
0
 public void AutoOpen()
 {
     IntelliSenseServer.Register();
 }
示例#26
0
        public void AutoClose()
        {
#if !DEBUG
            IntelliSenseServer.Uninstall();
#endif
        }
示例#27
0
 //https://msdn.microsoft.com/zh-cn/library/bb687860(v=office.15)
 //Callback function that must be implemented and exported by every valid XLL. The xlAutoOpen function is the recommended place from where to register XLL functions and commands, initialize data structures, customize the user interface, and so on.
 public void AutoOpen()
 {
     IntelliSenseServer.Install();
     //ExcelDna.Logging.LogDisplay.Show();
     //ExcelDna.Logging.LogDisplay.DisplayOrder = ExcelDna.Logging.DisplayOrder.NewestFirst;
 }
示例#28
0
 void IExcelAddIn.AutoClose()
 {
     IntelliSenseServer.Uninstall();
     Container.Instance.Dispose();
     Settings.Default.Save();
 }
示例#29
0
 void IExcelAddIn.AutoOpen()
 {
     Container.Instance.Install(FromAssembly.InThisApplication());
     DataFunctionsRegistration.RegisterDataFunctions();
     IntelliSenseServer.Install();
 }
示例#30
0
        public void AutoOpen()
        {
            RegisterFunctions();

            IntelliSenseServer.Install();
        }