コード例 #1
0
ファイル: AddIn.cs プロジェクト: guyvani/quandl-excel-windows
        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;
        }
コード例 #2
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);
        }
コード例 #3
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;
        }
コード例 #4
0
        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}");
            });
        }
コード例 #5
0
        public void AutoOpen()
        {
            try
            {
                SetupExceptions();
                SetupRegistration();
                SetupKernel();
                IntelliSenseServer.Register();

                m_Log.Info("ExcelScript Addin loaded");
            } catch (Exception ex)
            {
                throw;
            }
        }
コード例 #6
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;
            }
        }
コード例 #7
0
ファイル: AddIn.cs プロジェクト: jpgough/quandl-excel-windows
        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;
        }
 public override void Register()
 {
     IntelliSenseServer.Register();
 }
コード例 #9
0
 public void AutoOpen()
 {
     IntelliSenseServer.Register();
 }
コード例 #10
0
 //public static NavigationOfSheet navigationOfSheet=null;
 // public static Microsoft.Office.Tools.CustomTaskPane taskSheet = null;
 // public static Microsoft.Office.Tools.CustomTaskPaneCollection CustomTaskPanes=null;
 /// <summary>
 /// 启动时注册IntelliSense函数,实现自定义函数参数提示
 /// 调试时会报错:托管调试助手“LoaderLock”在“C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE”中检测到问题。勾选不中断调试,重新运行即可
 /// </summary>
 public void AutoOpen()
 {
     IntelliSenseServer.Register();
     //ExcelDna.Logging.LogDisplay.Show();
     //ExcelDna.Logging.LogDisplay.DisplayOrder = ExcelDna.Logging.DisplayOrder.NewestFirst;
 }