public PackageManagerEditorFactory(
     VsPackageManagerContext context,
     IUserInterfaceService ui)
 {
     _context = context;
     _ui = ui;
 }
        public PackageManagerControl(PackageManagerModel model, IUserInterfaceService ui)
        {
            UI = ui;
            Model = model;

            InitializeComponent();

            var factory = ServiceLocator.GetGlobalService<SVsWindowSearchHostFactory, IVsWindowSearchHostFactory>();
            _windowSearchHost = factory.CreateWindowSearchHost(_searchControlParent);
            _windowSearchHost.SetupSearch(this);
            _windowSearchHost.IsVisible = true;

            _filter.Items.Add(Resx.Resources.Filter_All);
            _filter.Items.Add(Resx.Resources.Filter_Installed);
            _filter.Items.Add(Resx.Resources.Filter_UpdateAvailable);

            // TODO: Relocate to v3 API.
            _packageRestoreManager = ServiceLocator.GetInstance<IPackageRestoreManager>();
            AddRestoreBar();

            _packageDetail.Control = this;

            var outputConsoleProvider = ServiceLocator.GetInstance<IOutputConsoleProvider>();
            _outputConsole = outputConsoleProvider.CreateOutputConsole(requirePowerShellHost: false);

            InitSourceRepoList();
            _initialized = true;

            Model.Sources.PackageSourcesChanged += Sources_PackageSourcesChanged;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UserInterfaceModule"/> class.
        /// </summary>
        /// <param name="ownerService">The owner service.</param>
        public UserInterfaceModule(IUserInterfaceService ownerService)
        {
            {
                Enforce.Argument(() => ownerService);
            }

            m_Owner = ownerService;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectHub"/> class.
        /// </summary>
        /// <param name="service">
        /// The user interface service that handles the communication with the rest of the system.
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="service"/> is <see langword="null" />.
        /// </exception>
        internal ProjectHub(IUserInterfaceService service)
        {
            {
                Enforce.Argument(() => service);
            }

            m_Service = service;
        }
        public MainViewModel(IRestService restService, ISettingsService settingsService, IUserInterfaceService userInterfaceService)
        {
            _restService = restService;
            _settingsService = settingsService;
            _userInterfaceService = userInterfaceService;

            Messenger.Default.Register<Exception>(this, UserInterfaceService.Commands.ShowFeedback, e => ShowFeedback(e));
            Messenger.Default.Register<string>(this, UserInterfaceService.Commands.ShowBusyIndicator, m => BusyIndicatorVisibility = Visibility.Visible);
            Messenger.Default.Register<string>(this, UserInterfaceService.Commands.HideBusyIndicator, m => BusyIndicatorVisibility = Visibility.Collapsed);
        }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationFacade"/> class.
        /// </summary>
        /// <param name="service">
        /// The user interface service that handles the communication with the rest of the system.
        /// </param>
        /// <param name="notificationNames">The object that defines the application level notification names.</param>
        /// <param name="diagnostics">The object that provides the diagnostics methods for the application.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="service"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="notificationNames"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="diagnostics"/> is <see langword="null" />.
        /// </exception>
        internal ApplicationFacade(IUserInterfaceService service, INotificationNameConstants notificationNames, SystemDiagnostics diagnostics)
        {
            {
                Enforce.Argument(() => service);
            }

            m_Service = service;
            m_Service.RegisterNotification(notificationNames.SystemShuttingDown, HandleApplicationShutdown);

            // Initialize the system information object.
            m_SystemInformation = new SystemInformation(
                () => DateTimeOffset.Now,
                () => new SystemInformationStorage() { StartupTime = DateTimeOffset.Now });

            m_Diagnostics = diagnostics;
        }
 public NetworkingViewModel(IRestService restService, IUserInterfaceService userInterfaceSerive)
 {
     _restService = restService;
     _userInterfaceService = userInterfaceSerive;
     Messenger.Default.Register<WifiAdapterModel.Interface>(this, UserInterfaceService.Commands.WifiAdapterSelectionChanged, async m =>
     {
         try
         {
             WifiNetworksModel = await _restService.GetAsync<WifiNetworksModel>(new Uri(String.Format("api/wifi/networks?interface={0}",
                 m.GUID.ToString("D")), UriKind.Relative));
         }
         catch (Exception ex)
         {
             await _userInterfaceService.ShowFeedbackAsync(ex);
         }
     });
 }
        public async void Run()
        {
            this.uiService = svcPvd.GetService<IUserInterfaceService>();
            this.uiService.OutputInfo("--* IoC Example App *--", InfoCategory.Title);

            var authService = svcPvd.GetService<IAuthenticationService>();

            var t = await authService.SignInTask();

            var msg = "";

            if (t == ServiceExecutionResult.Failure)
                msg = "It's not possible to proceed.";
            else
                msg = "You're in.";

            uiService.OutputInfo(msg, InfoCategory.Response);
            if (uiService.RequestAppStop != null) Stop(uiService.RequestAppStop);
        }
Example #9
0
        public SettingsViewModel(
            IMonitorsService monitorsService,
            IOptionsService optionsService,
            IDragDropService dragDropService,
            IUserInterfaceService userInterfaceService)
        {
            _monitorsService      = monitorsService;
            _optionsService       = optionsService;
            _userInterfaceService = userInterfaceService;

            dragDropService.EpubFileListChanged += HandleEpubFileListChanged;

            _monitors       = GetSystemMonitors().ToArray();
            _loggingLevels  = GetLoggingLevels().ToArray();
            _bibleEpubFiles = GetBibleEpubFiles().ToArray();
            _themeFiles     = GetThemeFiles().ToArray();

            Messenger.Default.Register <ShutDownMessage>(this, OnShutDown);
        }
Example #10
0
        static void Main(string[] args)
        {
            //setup our DI
            var serviceProvider = new ServiceCollection()
                                  .AddSingleton <ICardComparer, CardComparer>()
                                  .AddSingleton <ICardDescriptorComparisonRepository, CardDescriptorComparisonRepository>()
                                  .AddSingleton <IListLoaderSvc, ListLoaderSvc>()
                                  .AddSingleton <IManagementSvc, ManagementSvc>()
                                  .AddSingleton <IRandomCardPicker, RandomCardPicker>()
                                  .AddSingleton <IUserInterfaceService, UserInterfaceService>()
                                  .BuildServiceProvider();

            IManagementSvc        managementSvc        = (IManagementSvc)serviceProvider.GetService(typeof(IManagementSvc));
            IUserInterfaceService userInterfaceService = (IUserInterfaceService)serviceProvider.GetService(typeof(IUserInterfaceService));

            managementSvc.Start();

            userInterfaceService.PlayGame(managementSvc);

            Console.ReadKey();
        }
Example #11
0
        public SettingsViewModel(
            IMonitorsService monitorsService,
            IOptionsService optionsService,
            IDragDropService dragDropService,
            IUserInterfaceService userInterfaceService)
        {
            _monitorsService      = monitorsService;
            _optionsService       = optionsService;
            _userInterfaceService = userInterfaceService;

            dragDropService.EpubFileListChanged += HandleEpubFileListChanged;

            _monitors       = GetSystemMonitors();
            _languages      = GetSupportedLanguages();
            _loggingLevels  = GetLoggingLevels();
            _bibleEpubFiles = GetBibleEpubFiles();
            _themeFiles     = GetThemeFiles();

            SelectDestinationFolderCommand = new RelayCommand(SelectDestinationFolder);
            ResetTextScalingCommand        = new RelayCommand(ResetTextScaling, CanResetScaling);

            Messenger.Default.Register <ShutDownMessage>(this, OnShutDown);
        }
        public MainViewModel(IRestService restService, ISettingsService settingsService, IUserInterfaceService userInterfaceService)
        {
            _restService          = restService;
            _settingsService      = settingsService;
            _userInterfaceService = userInterfaceService;

            Messenger.Default.Register <Exception>(this, UserInterfaceService.Commands.ShowFeedback, e => ShowFeedback(e));
            Messenger.Default.Register <string>(this, UserInterfaceService.Commands.ShowBusyIndicator, m => BusyIndicatorVisibility = Visibility.Visible);
            Messenger.Default.Register <string>(this, UserInterfaceService.Commands.HideBusyIndicator, m => BusyIndicatorVisibility = Visibility.Collapsed);
        }
 public ProcessesViewModel(IRestService restService, IUserInterfaceService userInterfaceService)
 {
     _restService = restService;
     _userInterfaceService = userInterfaceService;
 }
Example #14
0
 public HomeViewModel(IRestService restService, IUserInterfaceService userInterfaceService)
 {
     _restService          = restService;
     _userInterfaceService = userInterfaceService;
 }
 /// <summary>
 /// Initializes a new instance of the EditorPane class.
 /// </summary>
 public PackageManagerWindowPane(PackageManagerModel myDoc, IUserInterfaceService ui)
     : base(null)
 {
     PackageManagerControl control = new PackageManagerControl(myDoc, ui);
     _content = control;
 }
 public ProcessesViewModel(IRestService restService, IUserInterfaceService userInterfaceService)
 {
     _restService          = restService;
     _userInterfaceService = userInterfaceService;
 }
 public DragAndDropServiceCustom(IUserInterfaceService userInterfaceService)
 {
     _userInterfaceService = userInterfaceService;
 }
 public HomeViewModel(IRestService restService, IUserInterfaceService userInterfaceService)
 {
     _restService = restService;
     _userInterfaceService = userInterfaceService;
 }
 public MainViewModel(GameViewModelFactory gameViewModelFactory, IUserInterfaceService userInterfaceService)
 {
     _gameViewModelFactory = gameViewModelFactory;
     _userInterfaceService = userInterfaceService;
 }