コード例 #1
0
        private void RunProductivities()
        {
            List <IProductivityAdapter> adapters = new List <IProductivityAdapter>();

            foreach (IProductivity productivity in Productivities)
            {
                IProductivityAdapter adapter = productivity.GetWinAdapter();
                adapters.Add(adapter);
            }
            foreach (IProductivityAdapter adapter in adapters)
            {
                IServiceConsumer serviceConsumer = adapter as IServiceConsumer;
                if (serviceConsumer != null)
                {
                    serviceConsumer.ExportServices(_session.ServiceContainer);
                }
            }
            foreach (IProductivityAdapter adapter in adapters)
            {
                IServiceConsumer serviceConsumer = adapter as IServiceConsumer;
                if (serviceConsumer != null)
                {
                    serviceConsumer.ImportServices(_session.ServiceContainer);
                }
            }
        }
コード例 #2
0
        private void RunProfilingTypes()
        {
            ProfilingTypeSettingsCollection profilingTypesSettings = _configurationSettings.ProfilingTypesSettings;
            List <IProfilingTypeAdapter>    adapters = new List <IProfilingTypeAdapter>();

            foreach (ProfilingTypeSettings profilingTypeSettings in profilingTypesSettings)
            {
                IProfilingType        profilingType = ProfilingTypes[profilingTypeSettings.Uid];
                IProfilingTypeAdapter adapter       = profilingType.GetWinAdapter();
                adapters.Add(adapter);
            }
            foreach (IProfilingTypeAdapter adapter in adapters)
            {
                IServiceConsumer serviceConsumer = adapter as IServiceConsumer;
                if (serviceConsumer != null)
                {
                    serviceConsumer.ExportServices(_session.ServiceContainer);
                }
            }
            foreach (IProfilingTypeAdapter adapter in adapters)
            {
                IServiceConsumer serviceConsumer = adapter as IServiceConsumer;
                if (serviceConsumer != null)
                {
                    serviceConsumer.ImportServices(_session.ServiceContainer);
                }
            }
        }