예제 #1
0
        // May be called on the main Excel thread or on another thread (e.g. our automation thread)
        // Pass in the xmlFunctionInfo if available (from inside document), else file will be read
        // We make the parsing lazy...
        public void RegisterXmlFunctionInfo(string fileName, string xmlIntelliSense = null)
        {
            if (!File.Exists(fileName) && xmlIntelliSense == null)
            {
                return;
            }

            var regInfo = new XmlRegistrationInfo(fileName, xmlIntelliSense);

            lock (_xmlRegistrationInfos)
            {
                _xmlRegistrationInfos.Add(fileName, regInfo);

                if (!_isDirty)
                {
                    _isDirty = true;
                    _syncContextExcel.Post(OnInvalidate, null);
                }
            }
        }
예제 #2
0
        // May be called on the main Excel thread or on another thread (e.g. our automation thread)
        // Pass in the xmlFunctionInfo if available (from inside document), else file will be read
        // We make the parsing lazy...
        public void RegisterXmlFunctionInfo(string fileName, string xmlIntelliSense = null)
        {
            if (!File.Exists(fileName) && xmlIntelliSense == null)
            {
                Logger.Provider.Verbose($"XmlIntelliSenseProvider.RegisterXmlFunctionInfo - Not IntelliSense file at {fileName}");
                return;
            }

            var regInfo = new XmlRegistrationInfo(fileName, xmlIntelliSense);

            Logger.Provider.Verbose($"XmlIntelliSenseProvider.RegisterXmlFunctionInfo - Created XmlRegistrationInfo info for {fileName}");
            lock (_xmlRegistrationInfos)
            {
                Logger.Provider.Verbose($"XmlIntelliSenseProvider.RegisterXmlFunctionInfo - Recording XmlRegistrationInfo info");
                _xmlRegistrationInfos.Add(fileName, regInfo);

                if (!_isDirty)
                {
                    _isDirty = true;
                    Logger.Provider.Verbose($"XmlIntelliSenseProvider.RegisterXmlFunctionInfo - Posting OnInvalidate to Excel SyncContext");
                    _syncContextExcel.Post(OnInvalidate, null);
                }
            }
        }
        // May be called on the main Excel thread or on another thread (e.g. our automation thread)
        // Pass in the xmlFunctionInfo if available (from inside document), else file will be read
        // We make the parsing lazy...
        public void RegisterXmlFunctionInfo(string fileName, string xmlIntelliSense = null)
        {
            if (!File.Exists(fileName) && xmlIntelliSense == null)
                return;
            
            var regInfo = new XmlRegistrationInfo(fileName, xmlIntelliSense);
            lock (_xmlRegistrationInfos)
            {
                _xmlRegistrationInfos.Add(fileName, regInfo);

                if (!_isDirty)
                {
                    _isDirty = true;
                    _syncContextExcel.Post(OnInvalidate, null);
                }
            }
        }