示例#1
0
        public void SsqExcelFunctionTest(string ssqFunction, string wkn_isin_ticker)
        {
            IEnumerable <SsqExcelFunction> ssqExcelFunctions = SsqLoader.GetExcelFunctions()
                                                               .Where(f => ((ExcelFunctionAttribute)f.ExcelFunctionAttribute).Name.Equals(ssqFunction));
            var    ssqExcelFuntion = ssqExcelFunctions.Single();
            object actual          = ssqExcelFuntion.Delegate.DynamicInvoke(wkn_isin_ticker);

            Assert.IsType <decimal>(actual);
        }
示例#2
0
        public void ReRegisterFunctions(IRibbonControl control)
        {
            ExcelAsyncUtil.QueueAsMacro(() =>
            {
                SsqLoader.Load();

                FfeAddIn ffeAddIn = new FfeAddIn();
                ffeAddIn.RegisterFunctions();
                ffeAddIn.RegisterDelegates();
            });
        }
示例#3
0
 public void RegisterDelegates()
 {
     try
     {
         SsqLoader.GetExcelFunctions()
         .RegisterFunctions();
     }
     catch (Exception ex)
     {
         Log.Error("Exception while registering SSQ Excel functions. Message: {@ExceptionMessage}", ex.Message);
     }
 }
示例#4
0
        private IEnumerable <string> GetFfeFunctionNames()
        {
            /*functionNames = GetExecutingAssembly().GetTypes()
             *                                    .SelectMany(t => t.GetMethods())
             *                                    .Where(m => m.GetCustomAttributes(typeof(ExcelFunctionAttribute), false).Length > 0)
             *                                    .Select(mi => mi.Name);*/
            // FFE functions
            functionNames = ExcelRegistration.GetExcelFunctions()
                            .Where(x => x.FunctionAttribute.Category.Equals("FFE"))
                            .Select(f => f.FunctionAttribute.Name);
            // + SSQ UDFs
            functionNames = functionNames.Union(SsqLoader.GetUdfs().Select(udf => udf.Value.QueryInformation.Name));

            return(functionNames);
        }
示例#5
0
 public void SsqLoaderTest()
 {
     Assert.NotEmpty(SsqLoader.GetExcelFunctions());
 }