コード例 #1
0
ファイル: Mail2BugEngine.cs プロジェクト: FukSunFc/mail2bug
		public Mail2BugEngine(Config.InstanceConfig configInstance, MailboxManagerFactory mailboxManagerFactory)
		{
		    _config = configInstance;

		    Logger.InfoFormat("Initalizing MailboxManager");
            _mailboxManager = mailboxManagerFactory.CreateMailboxManager(_config.EmailSettings);

		    Logger.InfoFormat("Initializing WorkItemManager");
            _messageProcessingStrategy = new Lazy<IMessageProcessingStrategy>(InitProcessingStrategy);
		}
コード例 #2
0
        public Mail2BugEngine(Config.InstanceConfig configInstance, MailboxManagerFactory mailboxManagerFactory)
        {
            _config = configInstance;

            Logger.InfoFormat("Initalizing MailboxManager");
            _mailboxManager = mailboxManagerFactory.CreateMailboxManager(_config.EmailSettings);

            Logger.InfoFormat("Initializing WorkItemManager");
            _messageProcessingStrategy = new Lazy <IMessageProcessingStrategy>(InitProcessingStrategy);
        }
コード例 #3
0
 private static void InitSingleInstance(Config.InstanceConfig instance)
 {
     try
     {
         Logger.InfoFormat("Initializing engine for instance '{0}'", instance.Name);
         _instances.Add(new Mail2BugEngine(instance));
         Logger.InfoFormat("Finished initialization of engine for instance '{0}'", instance.Name);
     }
     catch (Exception ex)
     {
         Logger.ErrorFormat("Exception while initializing instance '{0}'\n{1}", instance.Name, ex);
     }
 }
コード例 #4
0
ファイル: Mail2BugEngine.cs プロジェクト: msm2020/mail2bug
        public Mail2BugEngine(Config.InstanceConfig configInstance)
        {
            _config = configInstance;

            Logger.InfoFormat("Initalizing MailboxManager");
            _mailboxManager = MailboxManagerFactory.CreateMailboxManager(_config.EmailSettings);

            Logger.InfoFormat("Initializing WorkItemManager");
            IWorkItemManager workItemManager;

            if (configInstance.TfsServerConfig.SimulationMode)
            {
                Logger.InfoFormat("Working in simulation mode. Using WorkItemManagerMock");
                workItemManager = new WorkItemManagerMock(_config.WorkItemSettings.ConversationIndexFieldName);
            }
            else
            {
                Logger.InfoFormat("Working in standard mode, using TFSWorkItemManager");
                workItemManager = new TFSWorkItemManager(_config);
            }

            Logger.InfoFormat("Initializing MessageProcessingStrategy");
            _messageProcessingStrategy = new SimpleBugStrategy(_config, workItemManager);
        }
コード例 #5
0
 public TemporaryInstanceRunner(Config.InstanceConfig instanceConfig, MailboxManagerFactory mailboxManagerFactory)
 {
     _instanceConfig        = instanceConfig;
     _mailboxManagerFactory = mailboxManagerFactory;
     Name = instanceConfig.Name;
 }
コード例 #6
0
 public PersistentInstanceRunner(Config.InstanceConfig instanceConfig, MailboxManagerFactory mailboxManagerFactory)
 {
     Name    = instanceConfig.Name;
     _engine = new Mail2BugEngine(instanceConfig, mailboxManagerFactory);
 }
コード例 #7
0
        private static Config.InstanceConfig GetConfig()
        {
            var config = new Config.InstanceConfig
            {
                WorkItemSettings = new Config.WorkItemSettings
                {
                    Mnemonics = new List<Config.MnemonicDefinition>(),
                    RecipientOverrides = new List<Config.RecipientOverrideDefinition>(),
                    DateBasedOverrides = new List<Config.DateBasedFieldOverrides>()
                },
                EmailSettings = new Config.EmailSettings
                {
                    ExplicitOverridesRegex = @"###\s*(?<fieldName>[^:]*):\s*(?<value>.*)"
                }
               
            };

            return config;
        }