Esempio n. 1
0
        public void Init()
        {
            FileInfo logFile = new System.IO.FileInfo("Log4Net.config");
            if (logFile.Exists)
            {
                // Log4Net is configured using a DOMConfigurator.
                log4net.Config.XmlConfigurator.Configure(logFile);
            }
            else
            {
                // Set up a simple configuration that logs on the console.
                log4net.Config.BasicConfigurator.Configure();
            }

            // Log an baseInfo level message
            if (log.IsDebugEnabled)
            {
                if (string.IsNullOrEmpty(System.Threading.Thread.CurrentThread.Name))
                    System.Threading.Thread.CurrentThread.Name = "Main(" + System.Threading.Thread.CurrentThread.ManagedThreadId + ")";
                log.Debug(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType + " Tests Start");
            }

            descriptorManager = new DescriptorManager();
            channelManager = new ChannelsManager();
            channelManager.StartNewConnection(new Uri("memory:1"));
            helper = new InteractionManager(descriptorManager, channelManager);

            Dictionary<TransportationType, ChannelType> channelMapping = new Dictionary<TransportationType, ChannelType>();
            channelMapping.Add(TransportationType.HLA_RELIABLE, ChannelType.MEMORY);
            channelMapping.Add(TransportationType.HLA_BEST_EFFORT, ChannelType.MEMORY);
            helper.SetTransportMapping(channelMapping);

            myListener = new MyTestBootstrapObjectListener();
            helper.AddInteractionListener(myListener);
        }
Esempio n. 2
0
        public void Init()
        {
            FileInfo logFile = new System.IO.FileInfo("Log4Net.config");

            if (logFile.Exists)
            {
                // Log4Net is configured using a DOMConfigurator.
                log4net.Config.XmlConfigurator.Configure(logFile);
            }
            else
            {
                // Set up a simple configuration that logs on the console.
                log4net.Config.BasicConfigurator.Configure();
            }

            // Log an baseInfo level message
            if (log.IsDebugEnabled)
            {
                if (string.IsNullOrEmpty(System.Threading.Thread.CurrentThread.Name))
                {
                    System.Threading.Thread.CurrentThread.Name = "Main(" + System.Threading.Thread.CurrentThread.ManagedThreadId + ")";
                }
                log.Debug(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType + " Tests Start");
            }

            descriptorManager = new DescriptorManager();
            channelManager    = new ChannelsManager();
            channelManager.StartNewConnection(new Uri("memory:1"));
            helper = new InteractionManager(descriptorManager, channelManager);

            Dictionary <TransportationType, ChannelType> channelMapping = new Dictionary <TransportationType, ChannelType>();

            channelMapping.Add(TransportationType.HLA_RELIABLE, ChannelType.MEMORY);
            channelMapping.Add(TransportationType.HLA_BEST_EFFORT, ChannelType.MEMORY);
            helper.SetTransportMapping(channelMapping);

            myListener = new MyTestBootstrapObjectListener();
            helper.AddInteractionListener(myListener);
        }