Esempio n. 1
0
 public RequestElevationView(
     IApplicationLauncher applicationLauncher,
     IViewManager viewManager,
     ILogger <RequestElevationView> logger)
 {
     this.applicationLauncher = applicationLauncher.ThrowIfNull(nameof(applicationLauncher));
     this.viewManager         = viewManager.ThrowIfNull(nameof(viewManager));
     this.logger = logger.ThrowIfNull(nameof(logger));
     this.InitializeComponent();
 }
        /// <summary>
        /// Create a new instance of the <see cref="SingletonApplicationLauncher"/>.
        /// </summary>
        /// <param name="internalLancher">The <see cref="IApplicationLauncher"/>
        /// to use internally, when launching a new instance of the application.</param>
        /// <param name="applicationID">The unique string used to identify the single-instance application.
        /// Typically this value is a GUID, although any non-empty string is allowed.</param>
        /// <param name="global">Determines whether to limit the single instance Globally or Locally.
        /// 
        /// If true, the single instance of the application will be limited across all
        /// user accounts on the current machine.
        /// 
        /// If false, a single instance of the application will be allowed
        /// per user account on the machine.</param>
        public SingletonApplicationLauncher(IApplicationLauncher internalLancher, string applicationID, bool global = false)
        {
            if (internalLancher == null)
            {
                throw new ArgumentNullException("internalLauncher", "Internal Application Launcher cannot be null");
            }
            if (string.IsNullOrWhiteSpace(applicationID))
            {
                throw new ArgumentNullException("applicationID", "Application Identifier cannot be null or empty.");
            }

            _newInstanceLauncher = internalLancher;
            _applicationId = applicationID;
            _global = global;
        }
Esempio n. 3
0
 public ScreenChoiceView(
     IViewManager viewManager,
     IScreenManager screenManager,
     ILiveOptions <ApplicationConfiguration> liveOptions,
     IApplicationLauncher applicationLauncher)
 {
     this.viewManager         = viewManager.ThrowIfNull(nameof(viewManager));
     this.screenManager       = screenManager.ThrowIfNull(nameof(screenManager));
     this.liveOptions         = liveOptions.ThrowIfNull(nameof(liveOptions));
     this.applicationLauncher = applicationLauncher.ThrowIfNull(nameof(applicationLauncher));
     this.InitializeComponent();
     this.selectedId = this.liveOptions.Value.DesiredGuildwarsScreen;
     this.CanTest    = applicationLauncher.IsGuildwarsRunning;
     this.SetupView();
 }
Esempio n. 4
0
        void LaunchApplication()
        {
            IApplicationLauncher applicationLauncher = container.Resolve <IApplicationLauncher>();

            applicationLauncher.Execute();
        }