コード例 #1
0
 public ProfilerFilter(WorkContext workContext, IAuthorizer authorizer, IShapeFactory shapeFactory, IProfilerService profiler)
 {
     this.workContext = workContext;
     this.shapeFactory = shapeFactory;
     this.authorizer = authorizer;
     this.profiler = profiler;
 }
コード例 #2
0
 public ProfiledOrchardEventBus(IIndex <string, IEnumerable <IEventHandler> > eventHandlers, IExceptionPolicy exceptionPolicy, IProfilerService profiler)
 {
     _eventHandlers   = eventHandlers;
     _exceptionPolicy = exceptionPolicy;
     _profiler        = profiler;
     T = NullLocalizer.Instance;
 }
コード例 #3
0
 public ProfilerFilter(WorkContext workContext, IAuthorizer authorizer, IShapeFactory shapeFactory, IProfilerService profiler)
 {
     this.workContext  = workContext;
     this.shapeFactory = shapeFactory;
     this.authorizer   = authorizer;
     this.profiler     = profiler;
 }
 public ProfilingContentPartDriverCoordinator(IEnumerable <IContentPartDriver> drivers, IContentDefinitionManager contentDefinitionManager, IProfilerService profiler)
 {
     _drivers = drivers;
     _contentDefinitionManager = contentDefinitionManager;
     Logger    = NullLogger.Instance;
     _profiler = profiler;
 }
コード例 #5
0
 public TeamSetupViewModel(IMatchViewModel matchViewModel, IDialogService dialogService, INavigationService navigationService, IProfilerService profilerService)
 {
     MatchViewModel      = matchViewModel;
     m_dialogService     = dialogService;
     m_navigationService = navigationService;
     m_profilerService   = profilerService;
     StartCommand        = new AsyncCommand(_ => NavigateToMatch(), _ => Players.Any(p => p.IsPlaying));
     AddPlayerCommand    = new Command(AddPlayerOrPlayers, () => !string.IsNullOrEmpty(NewPlayerName));
     Players             = new ObservableCollection <PlayerViewModel>();
 }
コード例 #6
0
 private static bool TryInvoke(IEventHandler eventHandler, string interfaceName, string methodName, IDictionary<string, object> arguments, out IEnumerable returnValue, IProfilerService profiler) {
     Type type = eventHandler.GetType();
         foreach (var interfaceType in type.GetInterfaces()) {
             if (String.Equals(interfaceType.Name, interfaceName, StringComparison.OrdinalIgnoreCase)) {
                 return TryInvokeMethod(eventHandler, interfaceType, methodName, arguments, out returnValue, profiler);
             }
         }
         returnValue = null;
         return false;
     }
コード例 #7
0
        public ProfilerIpcClient(string endpointAddress)
        {
            DuplexChannelFactory <IProfilerService> factory = new DuplexChannelFactory <IProfilerService>(
                new InstanceContext(this),
                new NetNamedPipeBinding(),
                new EndpointAddress(endpointAddress));

            this.service = factory.CreateChannel();
            this.service.RegisterClient(Process.GetCurrentProcess().Id);
        }
コード例 #8
0
ファイル: PlayerViewModel.cs プロジェクト: haavamoa/TeamTimer
 public PlayerViewModel(Player player, IHandleTeamSetup teamSetupHandler, IHandleMatch matchHandler, IDialogService dialogService,
                        IProfilerService profilerService)
 {
     m_player                     = player;
     m_teamSetupHandler           = teamSetupHandler;
     m_matchHandler               = matchHandler;
     m_dialogService              = dialogService;
     m_profilerService            = profilerService;
     DeletePlayerCommand          = new Command(_ => m_teamSetupHandler?.OnPlayerDeleted(this));
     OpenInformationCommand       = new AsyncCommand(_ => OpenInformation());
     MarkedForSubstitutionCommand = new Command(MarkForSubstitution);
 }
コード例 #9
0
        public ItemsViewModel(IProfilerService profilerService)
        {
            _profilerService = profilerService;

            Title            = "Browse";
            Items            = new ObservableCollection <Item>();
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());

            MessagingCenter.Subscribe <NewItemPage, Item>(this, "AddItem", async(obj, item) =>
            {
                var newItem = item as Item;
                Items.Add(newItem);
                await DataStore.AddItemAsync(newItem);
            });
        }
コード例 #10
0
        public ProfilingContentDisplay(
            Lazy <IEnumerable <IContentHandler> > handlers,
            IShapeFactory shapeFactory,
            Lazy <IShapeTableLocator> shapeTableLocator,
            RequestContext requestContext,
            IVirtualPathProvider virtualPathProvider,
            IWorkContextAccessor workContextAccessor,
            IProfilerService profiler)
        {
            _innerContentDisplay = new DefaultContentDisplay(
                handlers,
                shapeFactory,
                shapeTableLocator,
                requestContext,
                virtualPathProvider,
                workContextAccessor);

            _profiler = profiler;
        }
コード例 #11
0
        public ProfilingContentDisplay(
            Lazy<IEnumerable<IContentHandler>> handlers,
            IShapeFactory shapeFactory,
            Lazy<IShapeTableLocator> shapeTableLocator, 
            RequestContext requestContext,
            IVirtualPathProvider virtualPathProvider,
            IWorkContextAccessor workContextAccessor,
            IProfilerService profiler)
        {

            _innerContentDisplay = new DefaultContentDisplay(
                handlers,
                shapeFactory,
                shapeTableLocator,
                requestContext,
                virtualPathProvider,
                workContextAccessor);

            _profiler = profiler;
        }
コード例 #12
0
 public DefaultOrchardEventBus(Func<IEnumerable<IEventHandler>> eventHandlers, IExceptionPolicy exceptionPolicy, IProfilerService profiler) {
         _eventHandlers = eventHandlers;
         _exceptionPolicy = exceptionPolicy;
         _profiler = profiler;
         T = NullLocalizer.Instance;
     }
コード例 #13
0
        private static bool TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, string messageName, string interfaceName, string methodName, IDictionary <string, object> arguments, out IEnumerable returnValue, IProfilerService profiler)
        {
            var key            = eventHandler.GetType().FullName + "_" + messageName + "_" + String.Join("_", arguments.Keys);
            var cachedDelegate = _delegateCache.GetOrAdd(key, k => {
                var method = GetMatchingMethod(eventHandler, interfaceType, methodName, arguments);
                return(method != null
                    ? Tuple.Create(method.GetParameters(), DelegateHelper.CreateDelegate <IEventHandler>(eventHandler.GetType(), method))
                    : null);
            });

            if (cachedDelegate != null)
            {
                var args   = cachedDelegate.Item1.Select(methodParameter => arguments[methodParameter.Name]).ToArray();
                var result = cachedDelegate.Item2(eventHandler, args);

                returnValue = result as IEnumerable;
                if (result != null && (returnValue == null || result is string))
                {
                    returnValue = new[] { result }
                }
                ;
                return(true);
            }

            returnValue = null;
            return(false);
        }
コード例 #14
0
        private static bool TryInvoke(IEventHandler eventHandler, string messageName, string interfaceName, string methodName, IDictionary <string, object> arguments, out IEnumerable returnValue, IProfilerService profiler)
        {
            var matchingInterface = eventHandler.GetType().GetInterface(interfaceName);

            return(TryInvokeMethod(eventHandler, matchingInterface, messageName, interfaceName, methodName, arguments, out returnValue, profiler));
        }
コード例 #15
0
        private bool TryNotifyHandler(IEventHandler eventHandler, string messageName, string interfaceName, string methodName, IDictionary <string, object> eventData, out IEnumerable returnValue, IProfilerService profiler)
        {
            try {
                return(TryInvoke(eventHandler, messageName, interfaceName, methodName, eventData, out returnValue, profiler));
            }
            catch (Exception exception) {
                if (!_exceptionPolicy.HandleException(this, exception))
                {
                    throw;
                }

                returnValue = null;
                return(false);
            }
        }
コード例 #16
0
ファイル: DialogService.cs プロジェクト: haavamoa/TeamTimer
 public DialogService(IProfilerService profilerService)
 {
     m_profilerService = profilerService;
 }
コード例 #17
0
 protected override void Awake()
 {
     base.Awake();
     _profilerService = SRServiceManager.GetService<IProfilerService>();
 }
コード例 #18
0
 public ShapeProfiling(IProfilerService profiler)
 {
     this.profiler = profiler;
 }
コード例 #19
0
        private static bool TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, string methodName, IDictionary<string, object> arguments, out IEnumerable returnValue, IProfilerService profiler) {
            MethodInfo method = _interfaceMethodsCache.GetOrAdd(String.Concat(eventHandler.GetType().Name + "_" + interfaceType.Name, "_", methodName, "_", String.Join("_", arguments.Keys)), GetMatchingMethod(eventHandler, interfaceType, methodName, arguments));

                if (method != null) {
                    var parameters = new List<object>();
                    foreach (var methodParameter in method.GetParameters()) {
                        parameters.Add(arguments[methodParameter.Name]);
                    }
                    var key= "EventBus:"+eventHandler.GetType().FullName +"."+ methodName;
                    profiler.StepStart(key,String.Format("EventBus: {0}",eventHandler.GetType().FullName +"."+ methodName),true);
                    var result = method.Invoke(eventHandler, parameters.ToArray());
                    profiler.StepStop(key);
                    returnValue = result as IEnumerable;
                    if (returnValue == null && result != null)
                        returnValue = new[] { result };
                    return true;
                }
                returnValue = null;
                return false;
            }
コード例 #20
0
 public TestCompositePerfViewModel(IProfilerService profilerService)
 {
     _profilerService = profilerService;
 }
コード例 #21
0
 public ShapeProfiling(IProfilerService profiler)
 {
     this.profiler = profiler;
 }
コード例 #22
0
 public NavigationService(IDialogService dialogService, IProfilerService profilerService)
 {
     m_dialogService      = dialogService;
     m_profilerService    = profilerService;
     m_navigationRegister = new Dictionary <IViewModel, Page>();
 }
コード例 #23
0
 protected override void Awake()
 {
     base.Awake();
     _profilerService = SRServiceManager.GetService <IProfilerService>();
 }
コード例 #24
0
 public MainViewModel(IProfilerService profilerService)
 {
     _profilerService = profilerService;
 }
コード例 #25
0
 public ProfilingContentPartDriverCoordinator(IEnumerable<IContentPartDriver> drivers, IContentDefinitionManager contentDefinitionManager, IProfilerService profiler) {
     _drivers = drivers;
     _contentDefinitionManager = contentDefinitionManager;
     Logger = NullLogger.Instance;
     _profiler = profiler;
 }