Exemple #1
0
        public Program(IEnvironmentConfigRepository environmentConfigRepository,
		               ILocalApplicationDataRepository localApplicationDataRepository)
        {
            // Remember our dependencies
            _environmentConfigRepository = environmentConfigRepository;
            _localApplicationDataRepository = localApplicationDataRepository;

            // Create a simple tray menu.
            trayMenu = new ContextMenu();

            // create new tray settings file for first run
            var testSettings = _localApplicationDataRepository.Get();
            if (testSettings == null)
                _localApplicationDataRepository.CreateNewSettingsFile();

            // Get our previously defined settings: environment.config location, list of environment and role names, etc.
            _localApplicationData = _localApplicationDataRepository.Get();

            BuildContextMenu();

            // Create a tray icon.
            trayIcon = new NotifyIcon();
            trayIcon.Text = "Application Environment File Configurator";
                // Runtime Exception is thrown when this value is > 63 characters long.
            trayIcon.Icon = new Icon(GetType(), "World.ico");

            // Add menu to tray icon and show it.
            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible = true;
        }
        public OptionsForm(ILocalApplicationDataRepository localApplicationDataRepository,
		                   IEnvironmentConfigRepository environmentConfigRepository)
        {
            _localApplicationDataRepository = localApplicationDataRepository;
            _environmentConfigRepository = environmentConfigRepository;

            InitializeComponent();
        }