RegisterXmlFunctionInfo() публичный Метод

public RegisterXmlFunctionInfo ( string fileName, string xmlIntelliSense = null ) : void
fileName string
xmlIntelliSense string
Результат void
        // Must be called on the main Excel thread
        public void Initialize()
        {
            Debug.Assert(Thread.CurrentThread.ManagedThreadId == 1);
            Logger.Provider.Info("ExcelDnaIntelliSenseProvider.Initialize");

            _xmlProvider.Initialize();

            lock (_xllRegistrationInfos)
            {
                Logger.Provider.Info("ExcelDnaIntelliSenseProvider.Initialize - inside lock");
                foreach (var xllPath in GetLoadedXllPaths())
                {
                    if (!_xllRegistrationInfos.ContainsKey(xllPath))
                    {
                        Logger.Provider.Verbose(string.Format("ExcelDnaIntelliSenseProvider.Initialize: Adding XllRegistrationInfo for {0}", xllPath));
                        XllRegistrationInfo regInfo = new XllRegistrationInfo(xllPath);
                        _xllRegistrationInfos[xllPath] = regInfo;

                        _xmlProvider.RegisterXmlFunctionInfo(GetXmlPath(xllPath));

                        regInfo.Refresh();
                    }
                }
            }
            Logger.Provider.Info("ExcelDnaIntelliSenseProvider.Initialize - after lock");
        }
        void RegisterWithXmlProvider(Workbook wb)
        {
            var path    = wb.FullName;
            var xmlPath = GetXmlPath(path);

            _xmlProvider.RegisterXmlFunctionInfo(xmlPath);  // Will check if file exists

            var customXmlParts = wb.CustomXMLParts.SelectByNamespace(XmlIntelliSense.Namespace);

            if (customXmlParts.Count > 0)
            {
                // We just take the first one - register against the Bworkbook name
                _xmlProvider.RegisterXmlFunctionInfo(path, customXmlParts[1].XML);
            }
        }
Пример #3
0
        void RegisterWithXmlProvider(Workbook wb)
        {
            Logger.Provider.Verbose($"WorkbookIntelliSenseProvider.RegisterWithXmlProvider");

            var path    = wb.FullName;
            var xmlPath = GetXmlPath(path);

            _xmlProvider.RegisterXmlFunctionInfo(xmlPath);  // Will check if file exists

            Logger.Provider.Verbose($"WorkbookIntelliSenseProvider.RegisterWithXmlProvider - Checking CustomXMLParts");

            var customXmlParts = wb.CustomXMLParts.SelectByNamespace(XmlIntelliSense.Namespace);

            if (customXmlParts.Count > 0)
            {
                Logger.Provider.Verbose($"WorkbookIntelliSenseProvider.RegisterWithXmlProvider - CustomXMLPart found");
                // We just take the first one - register against the Bworkbook name
                _xmlProvider.RegisterXmlFunctionInfo(path, customXmlParts[1].XML);
            }
            else
            {
                Logger.Provider.Verbose($"WorkbookIntelliSenseProvider.RegisterWithXmlProvider - No CustomXMLPart found");
            }
        }