Ejemplo n.º 1
0
        private void ActualizeConfigurationSettings(ConfigurationSettings configurationSettings, ProcessPlatform processPlatform)
        {
            //Actualize profiling target settings
            IProfilingTarget profilingTarget = _profilingTargets[configurationSettings.ProfilingTargetSettings.Uid];

            if (profilingTarget.HasAgent)
            {
                configurationSettings.ProfilingTargetSettings.AgentDll = profilingTarget.GetAgentDll(processPlatform);
            }
            //Actualize frameworks settings
            foreach (FrameworkSettings frameworkSettings in configurationSettings.FrameworksSettings)
            {
                IFramework framework = _frameworks[frameworkSettings.Uid];
                if (framework.HasAgent)
                {
                    frameworkSettings.AgentDll = framework.GetAgentDll(processPlatform);
                }
            }
            //Actualize profiling types settings
            foreach (ProfilingTypeSettings profilingTypeSettings in configurationSettings.ProfilingTypesSettings)
            {
                IProfilingType profilingType = _profilingTypes[profilingTypeSettings.Uid];
                if (profilingType.HasAgent)
                {
                    profilingTypeSettings.AgentDll = profilingType.GetAgentDll(processPlatform);
                }
                profilingTypeSettings.Dependencies = profilingType.Definition.Dependencies.Select(x => x.Uid).ToArray();
                profilingTypeSettings.FrameworkUid = profilingType.Definition.FrameworkUid;
            }
        }
        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);
                }
            }
        }
 public bool TryGet(Guid uid, out IProfilingType item)
 {
     lock (Lock)
     {
         VerifyDisposed();
         return(_collection.TryGetValue(uid, out item));
     }
 }
Ejemplo n.º 4
0
 public ProfilingTypeViewModel(IProfilingType profilingType, FrameworkViewModel framework,
                               List <ProfilingTypeViewModel> profilingTypes, ProfilingTypeSettingsCollection profilingTypesSettings)
 {
     _references             = 0;
     _profilingType          = profilingType;
     _framework              = framework;
     _profilingTypes         = profilingTypes;
     _profilingTypesSettings = profilingTypesSettings;
 }
Ejemplo n.º 5
0
 public IProfilingType this[Guid uid]
 {
     get
     {
         lock (_collection)
         {
             VerifyDisposed();
             ProfilingType profilingType;
             if (_collection.TryGetValue(uid, out profilingType))
             {
                 return(profilingType);
             }
             IProfilingType remoteProfilingType = Execute(() => RemoteObject[uid]);
             profilingType = new ProfilingType(remoteProfilingType);
             _collection.Add(uid, profilingType);
             return(profilingType);
         }
     }
 }
Ejemplo n.º 6
0
 public bool TryGet(Guid uid, out IProfilingType item)
 {
     lock (_collection)
     {
         ProfilingType profilingType;
         if (_collection.TryGetValue(uid, out profilingType))
         {
             item = profilingType;
             return(true);
         }
         IProfilingType remoteProfilingType = null;
         if (Execute(() => RemoteObject.TryGet(uid, out remoteProfilingType)))
         {
             profilingType = new ProfilingType(remoteProfilingType);
             _collection.Add(uid, profilingType);
             item = profilingType;
             return(true);
         }
     }
     item = null;
     return(false);
 }
 public static IProfilingTypeAdapter GetSafeAdapter(this IProfilingType profilingType)
 {
     return((IProfilingTypeAdapter)profilingType);
 }
 public static IProfilingTypeAdapter GetRealAdapter(this IProfilingType profilingType)
 {
     return((IProfilingTypeAdapter)((IWrapper)profilingType).UndrelyingObject);
 }
Ejemplo n.º 9
0
 public static IProfilingTypeAdapter GetWinAdapter(this IProfilingType profilingType)
 {
     return((IProfilingTypeAdapter)profilingType.GetRealAdapter());
 }
Ejemplo n.º 10
0
 public ProfilingTypeEventArgs(IProfilingType profilingType)
 {
     ProfilingType = profilingType;
 }
Ejemplo n.º 11
0
 internal static void RaiseEvent(EventHandler <ProfilingTypeEventArgs> handler, object sender, IProfilingType profilingType)
 {
     if (handler != null)
     {
         handler(sender, new ProfilingTypeEventArgs(profilingType));
     }
 }
 public ProfilingTypeFacade(IProfilingType profilingType, ProfilingTypeSettings settings)
 {
     _profilingType = profilingType;
     _settings      = settings;
 }