示例#1
0
        public void EmitCurrentCallInfo <TCallingInstance>(TCallingInstance instance,
                                                           [CallerMemberName] string memberName = "")
        {
            IList <IComponentRegistration> components = _monitoring.GetComponents(instance, memberName);

            if (_onActivityEmit == null)
            {
                return;
            }

            for (int index = 0; index < components.Count; index++)
            {
                IComponentRegistration   component   = components[index];
                IApplicationRegistration application = component.Application;
                ISystemRegistration      system      = application.SystemRegistration;
                string eventName = component.GetEventName(memberName);
                IList <Tuple <string, object> > parameters = component.GetObservedParameterValues(instance);

                _onActivityEmit(
                    system.Name,
                    application.Name,
                    component.Name,
                    (string.IsNullOrEmpty(eventName) ? memberName : eventName),
                    parameters);
            }
        }
示例#2
0
        public ISystemRegistration RegisterApplication(IApplicationRegistration application)
        {
            if ((application == null) || (string.IsNullOrEmpty(application.Name)))
            {
                throw new ArgumentException("'application' instance and 'application name' is required");
            }

            if (_registrationContainers.ContainsKey(application.Name))
            {
                _registrationContainers.Remove(application.Name);
            }

            application.SystemRegistration = this;

            _registrationContainers.Add(application.Name, application);

            return(this);
        }
 public ComponentRegistration(string businessComponentName, IApplicationRegistration application) : base(businessComponentName)
 {
     _className = RegistrationService.GetInstance().GetClassName <T>();
     _applicationRegistration = application;
 }