Exemplo n.º 1
0
 public void MyTestInitialize()
 {
     CampfireState_Accessor.Instance = null;
     if (System.IO.File.Exists(BackingStorePath))
     {
         System.IO.File.Delete(BackingStorePath);
     }
     mockNotifier = new MockNotifier();
     CampfireState.Initialize(TestContext.TestDir, mockNotifier);
     SmokeSignalConfig.Initialize(TestContext.TestDir);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Init SmokeSignal config to determine any "current" settings
        /// </summary>
        private void LoadSmokeSignalConfig()
        {
            string path = Utils.DataLocation;

            SmokeSignalConfig.Initialize(path);

            CampfireNameTextBox.Text         = SmokeSignalConfig.Instance.CampfireName;
            CampfireTokenTextBox.Text        = SmokeSignalConfig.Instance.CampfireToken;
            DefaultDelayTextBox.Text         = SmokeSignalConfig.Instance.DelayBeforeSmokeSignalInMinutes.ToString();
            SendWelcomeEmailCheckBox.Checked = SmokeSignalConfig.Instance.SendNewUserEmail;
            ExtraEmailMessage.Text           = SmokeSignalConfig.Instance.ExtraEmailMessage;
        }
Exemplo n.º 3
0
        protected override void OnStart(string[] args)
        {
            string        path   = Utils.DataLocation;
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            StringBuilder sb = new StringBuilder();

            if (args != null)
            {
                sb.AppendFormat("args: {0}, {1}", args.Length > 0 ? args[0] : "xxx", args.Length > 1 ? args[1] : "xxx");
            }
            else
            {
                sb.AppendFormat("args: NONE");
            }

            sb.AppendLine();

            Configuration userConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);

            sb.AppendFormat("config.FilePath: {0}", config.FilePath);
            sb.AppendLine();
            sb.AppendFormat("userConfig.FilePath: {0}", userConfig.FilePath);
            sb.AppendLine();
            sb.AppendFormat("DataLocation: {0}", path);
            sb.AppendLine();

            theEventLog.WriteEntry(string.Format("SmokeSignal starting. {0}", sb.ToString()));

            if (args != null && args.Length > 0)
            {
                ProcessArguments(args);
            }

            SmokeSignalConfig.Initialize(path);
            CampfireState.Initialize(path, null);
            MessageProcessor mp = new MessageProcessor(CampfireState.Instance);

            mp.Run(false);
        }