コード例 #1
0
        public ReliabilityCoordinator(IPeerManager peerManager, IPeerConfiguration peerConfiguration, IAssemblyScanner assemblyScanner)
        {
            _peerManager = peerManager;
            _peerConfiguration = peerConfiguration;
            _assemblyScanner = assemblyScanner;
            _peerManager.PeerConnected += OnPeerChange;

            var messageOptionses = _assemblyScanner.GetMessageOptions();
            foreach (var messageOptionse in messageOptionses)
            {
                _messageOptions.Add(messageOptionse.MessageType.FullName, messageOptionse);
            }
        }
コード例 #2
0
        public SerializationHelper(IAssemblyScanner scanner)
        {
            var knownMessages = scanner.GetMessageOptions();
             foreach (var messageOptionse in knownMessages)
             {
                 try
                 {
                     var fullName = messageOptionse.MessageType.FullName;
                     var idFromString = StringUtils.CreateIdFromString(fullName);
                     _messageTypeToId.Add(fullName, idFromString);
                     _messageTypeIdToMessageType.Add(idFromString, fullName);

                 }
                 catch (ArgumentException ex)
                 {
                     throw new ArgumentException("Problem while loading message type to message type id dictionary, two type names might have the same id");
                 }
             }
        }