Esempio n. 1
0
        public void OnWorkbookOpen(Workbook wb)
        {
            try
            {
                Shared.QuandlConfig.PreventCurrentExecution = true;
                SetExecutionToggleIcon();



                if (!FunctionUpdater.HasQuandlFormulaInWorkbook(wb) ||
                    Shared.QuandlConfig.AutoUpdateFrequency !=
                    Shared.QuandlConfig.AutoUpdateFrequencies.WorkbookOpen)
                {
                    return;
                }

                var result = MessageBox.Show(Properties.Resources.UpdateWorkbookFormulas,
                                             Properties.Resources.UpdateCaption,
                                             MessageBoxButtons.YesNo,
                                             MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    Shared.QuandlConfig.PreventCurrentExecution = false;
                    SetExecutionToggleIcon();

                    FunctionUpdater.RecalculateQuandlFunctions(wb);
                }
            }
            catch (Exception ex)
            {
                this.UpdateStatusBar(ex);
            }
        }
Esempio n. 2
0
        private void CheckWorkbookForFormulaUpdates(Workbook wb)
        {
            TurnOffAutoUpdates();

            if (!FunctionUpdater.HasQuandlFormulaInWorkbook(wb) || QuandlConfig.AutoUpdateFrequency != QuandlConfig.AutoUpdateFrequencies.WorkbookOpen)
            {
                return;
            }

            const string message = @"Your workbook(s) contain Quandl formulas. Would you like to update your data?";
            const string caption = @"Update Data";
            var          result  = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                QuandlConfig.PreventCurrentExecution = false;
                Globals.Ribbons.Ribbon2.SetExecutionToggleIcon();

                FunctionUpdater.RecalculateQuandlFunctions(wb);
            }
        }