Example #1
0
        public MainWindow(string playerName, string playerDynasty, int age)
        {
            this.FormClosed += MainWindow_FormClosed;
            InitializeComponent();
            logger = new TextBoxLogger(this);
            game = new Game(logger, NUM_PLAYERS);

            player = new PlayerCharacter(this, playerName, -Game.GetYearInTicks(age), new Dynasty(playerDynasty), 500, game, Gender.Male);
            game.AddPlayer(player);
            UpdateDate();
            UpdateStatus();

            if (Debugger.IsAttached)
            {
                restartButton.Visible = true;
                debugButton.Visible = true;
            }
            speedStep.Visible = false;
            restartButton.Visible = false;
            nextButton.Visible = false;
            playerStatusStrip.Visible = true;

            gameThread = new Thread(GameThread);
            gameThread.Start();
        }
        public RunResults()
        {
            ViewModel = new TestRunViewModel();
            InitializeComponent();

            ViewModel.PropertyChanged += ViewModelOnPropertyChanged;

            TextLogger = new TextBoxLogger(errorScreen3);
        }
        /// <summary>
        /// Do some preparation work when the Form is loaded
        /// Enable logging mechanisms and test if ConfigMgr Console is installed on the current system
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmMain_Loaded(object sender, RoutedEventArgs e)
        {
            _logger = new Logger();
            //Create and Register a Textboxlogger + CmTrace Logger for this application
#if (TRACELOG)
            _cmtrace          = new CMTraceLog(Environment.CurrentDirectory, "Test.log", "ConfigMgrEasyScript");
            _logger.LogEntry += _cmtrace.WriteLog;
#endif
            _txtLogger        = new TextBoxLogger(TxtLogging);
            _logger.LogEntry += _txtLogger.WriteLog;
            CheckForConsoleInstallation();
        }
Example #4
0
        private void Window_Initialized(object sender, EventArgs e)
        {
            TextBoxLogger.Initialize(LogsTextBox, StatusLabel, StatusImage);

            _ruleSet = BuildRuleSet();
            _renamer = new Renamer(TextBoxLogger.Get(), FileSystemWrapper.Create(), _ruleSet);
            _renamer.TargetFolderAdded += Renamer_TargetFolderAdded;
            _renamer.RenamesSet        += Renamer_RenamesSet;
            _renamer.SolutionRenamed   += Renamer_SolutionRenamed;

            _renameTimer.Tick    += RenameTimer_Tick;
            _renameTimer.Interval = TimeSpan.FromSeconds(1.5);
        }
        public MainForm()
        {
            InitializeComponent();

            refreshAppSettings();

            string imageDirectory = string.Format(@"{0}{1}\", AppSettings["ImageDirectory"], DateTime.UtcNow.ToString("yyyyMMdd"));

            System.IO.Directory.CreateDirectory(imageDirectory);

            _logger    = new TextBoxLogger(txtLog);
            _logWriter = new LogWriter(_logger);
            _parser    = new NewsletterParser(_logWriter, imageDirectory);

            statusLabel.Text = "Click Newsletter > Slice Elements to begin.";
        }
 /// <summary>
 /// Do some preparation work when the Form is loaded
 /// Enable logging mechanisms and test if ConfigMgr Console is installed on the current system
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void FrmMain_Loaded(object sender, RoutedEventArgs e)
 {
     _logger = new Logger();
     //Create and Register a Textboxlogger + CmTrace Logger for this application
     _cmtrace   = new CMTraceLog(Environment.CurrentDirectory, "Test.log", "ConfigMgrEasy");
     _txtLogger = new TextBoxLogger(txtLogging);
     // Both will register for the OnLogEvent
     _logger.LogEntry += _txtLogger.WriteLog;
     _logger.LogEntry += _cmtrace.WriteLog;
     if (Environment.GetEnvironmentVariable("SMS_ADMIN_UI_PATH") != null)
     {
         _logger.WriteLog($"ConfigMgr Console installed on System {Environment.GetEnvironmentVariable("Computername")}.");
     }
     else
     {
         _logger.WriteLog($"Console not installed on System {Environment.GetEnvironmentVariable("Computername")}.");
     }
 }
Example #7
0
        public MainWindow()
        {
            this.FormClosed += MainWindow_FormClosed;
            InitializeComponent();
            logger = new TextBoxLogger(this);
            game = new Game(logger, NUM_PLAYERS);
            UpdateDate();

            if(Debugger.IsAttached)
            {
                restartButton.Visible = true;
                debugButton.Visible = true;
            }

            speedStep.Visible = true;
            restartButton.Visible = true;
            nextButton.Visible = true;
            playerStatusStrip.Visible = false;
        }
Example #8
0
        public MainForm()
        {
            InitializeComponent();

            this.Text = Application.ProductName;
            RefreshStatusBar();
            ApplyLocalizationToControls(this.Controls);
            ApplyLocalizationToMenu(menuStrip1.Items);

            this.ttipMainform.AutoPopDelay = 5000;
            this.ttipMainform.InitialDelay = 1000;
            this.ttipMainform.ReshowDelay  = 500;
            this.ttipMainform.ShowAlways   = true;

            backgroundWorker.WorkerReportsProgress      = true;
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.RunWorkerCompleted        += BackgroundWorker_RunWorkerCompleted;
            backgroundWorker.DoWork          += BackgroundWorker_DoWork;
            backgroundWorker.ProgressChanged += BackgroundWorker_ProgressChanged;

            tbl = new TextBoxLogger(this.txtLog);

            openRekordboxXML.InitialDirectory = ProgramSettings.OutputFolder;
        }
Example #9
0
 private void StartLocalDbButton_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to restart the SQL local DB instance?", "Restart local DB", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         var result = ProcessUtility.RunCommand("Start SQL LocalDB", @"sqllocaldb start MSSQLLocalDB", TextBoxLogger.Get());
         if (result.IsSuccess)
         {
             MessageBox.Show("SQL LocalDB started successfully.", "Success");
         }
         else
         {
             MessageBox.Show("Could not successfully start SQL Local DB.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }