コード例 #1
0
        private async Task StartGettingRibbon(string entityName)
        {
            try
            {
                var service = await GetServiceAsync();

                if (service == null)
                {
                    return;
                }

                var ribbonData = _RibbonIntellisenseDataCache[entityName];

                ribbonData.ClearData();

                var repository = new RibbonCustomizationRepository(service);

                XDocument docRibbon = await repository.GetEntityRibbonAsync(entityName);

                ribbonData.LoadDataFromRibbon(docRibbon);
            }
            catch (Exception ex)
            {
                DTEHelper.WriteExceptionToOutput(_service.ConnectionData, ex);
            }
            finally
            {
                var syncObject = GetEntitySyncObject(entityName);

                lock (syncObject)
                {
                    _taskGettingRibbonInformationCache.TryRemove(entityName, out _);
                }
            }
        }
コード例 #2
0
        private async Task StartGettingRibbon(string entityName)
        {
            var service = await GetServiceAsync();

            if (service == null)
            {
                return;
            }

            try
            {
                var repository = new RibbonCustomizationRepository(service);

                XDocument docRibbon = await repository.GetEntityRibbonAsync(entityName);

                this._nextLoadDateTime[entityName] = DateTime.Now.AddSeconds(_loadPeriodInSeconds);
            }
            catch (Exception ex)
            {
                DTEHelper.WriteExceptionToOutput(service.ConnectionData, ex);
            }
            finally
            {
                var syncObject = GetEntitySyncObject(entityName);

                lock (syncObject)
                {
                    _taskGettingRibbonInformationCache.TryRemove(entityName, out _);
                }
            }
        }