コード例 #1
0
        internal void RegisterQueryAspect(Type channelType, Type queryAspectType, QueryAspect qf)
        {
            Known(channelType);

            var channelId = channelType.FullName;

            if (!_channelAspectQuery.ContainsKey(channelId))
            {
                _channelAspectQuery[channelId] = new Dictionary <string, QueryAspect>();
            }

            var aspects  = _channelAspectQuery[channelId];
            var aspectId = queryAspectType.FullName;

            if (!aspects.ContainsKey(aspectId))
            {
                aspects[aspectId] = qf;
            }
            else
            {
                throw new TectureException($"Attempt to bind query aspect {queryAspectType.Name} twice for channel {channelType.Name}");
            }

            qf._aux     = _auxiliary.ForChannel(channelType);
            qf._channel = channelType;
            qf.CallOnRegister();
        }
コード例 #2
0
        internal void RegisterQueryAspect(Type channelType, Type queryAspectType, QueryAspect qf)
        {
            Known(channelType);

            var channeId = channelType.FullName;

            if (!_channelAspectQuery.ContainsKey(channeId))
            {
                _channelAspectQuery[channeId] = new Dictionary <string, QueryAspect>();
            }

            var aspects  = _channelAspectQuery[channeId];
            var aspectId = queryAspectType.FullName;

            if (!aspects.ContainsKey(aspectId))
            {
                aspects[aspectId] = qf;
            }
            else
            {
                throw new TectureException($"Query aspect {queryAspectType.Name} is already implemented for {channelType.Name}");
            }

            qf._aux = _auxilary.ForChannel(channelType);
            qf.CallOnRegister();
        }
コード例 #3
0
 public void RegisterQueryAspect(Type queryAspectType, QueryAspect aspect)
 {
     _multiplexer.RegisterQueryAspect(_channelType, queryAspectType, aspect);
 }