Ejemplo n.º 1
0
        public ShellView(
            IDialogService dialogService,
            IProgressService progressService,
            IChocolateyConfigurationProvider chocolateyConfigurationProvider,
            IConfigService configService,
            IFileSystem fileSystem,
            IImageService imageService)
        {
            InitializeComponent();

            dialogService.ShellView   = this;
            progressService.ShellView = this;

            _progressService = progressService;
            _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
            _configService = configService;
            _fileSystem    = fileSystem;
            _imageService  = imageService;

            this.Icon = BitmapFrame.Create(_imageService.ToolbarIconUri);

            CheckOperatingSystemCompatibility();

            // Certain things like Cef (our markdown browser engine) get unhappy when GUI is started from a different cwd.
            // If we're in a different one, reset it to our app files directory.
            if (_fileSystem.get_directory_name(Environment.CurrentDirectory) != Bootstrapper.ApplicationFilesPath)
            {
                Environment.CurrentDirectory = Bootstrapper.ApplicationFilesPath;
            }
        }
Ejemplo n.º 2
0
        public ShellView(
            IProgressService progressService,
            IChocolateyConfigurationProvider chocolateyConfigurationProvider,
            IConfigService configService)
        {
            InitializeComponent();

            var service = progressService as ProgressService;

            if (service != null)
            {
                service.ShellView = this;
            }

            _progressService = progressService;
            _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
            _configService = configService;

            CheckOperatingSystemCompatibility();

            // Certain things like Cef (our markdown browser engine) get unhappy when GUI is started from a different cwd.
            // If we're in a different one, reset it to our app files directory.
            if (Path.GetDirectoryName(Environment.CurrentDirectory) != Bootstrapper.ApplicationFilesPath)
            {
                Environment.CurrentDirectory = Bootstrapper.ApplicationFilesPath;
            }
        }
Ejemplo n.º 3
0
 public PackageArgumentsService(
     IEncryptionUtility encryptionUtility,
     IFileSystem fileSystem,
     IChocolateyConfigurationProvider chocolateyConfigurationProvider,
     IDialogService dialogService)
 {
     _encryptionUtility = encryptionUtility;
     _fileSystem        = fileSystem;
     _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
     _dialogService = dialogService;
 }
Ejemplo n.º 4
0
        protected BasePackageService(IProgressService progressService, Func <Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
        {
            if (logServiceFunc == null)
            {
                throw new ArgumentNullException("logServiceFunc");
            }

            this.GetInstalledLock = new AsyncLock();
            this.progressService  = progressService;
            this.logService       = logServiceFunc(typeof(IChocolateyPackageService));
            this.chocolateyConfigurationProvider = chocolateyConfigurationProvider;

            this.PackagesJsonPath = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                "ChocolateyGUI",
                "packages.json");
        }
Ejemplo n.º 5
0
        protected BasePackageService(IProgressService progressService, Func<Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
        {
            if (logServiceFunc == null)
            {
                throw new ArgumentNullException("logServiceFunc");
            }

            this.GetInstalledLock = new AsyncLock();
            this.progressService = progressService;
            this.logService = logServiceFunc(typeof(IChocolateyPackageService));
            this.chocolateyConfigurationProvider = chocolateyConfigurationProvider;

            this.PackagesJsonPath = Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                "ChocolateyGUI",
                "packages.json");
        }
Ejemplo n.º 6
0
        public ShellView(
            IProgressService progressService,
            IChocolateyConfigurationProvider chocolateyConfigurationProvider,
            IConfigService configService)
        {
            InitializeComponent();

            var service = progressService as ProgressService;

            if (service != null)
            {
                service.ShellView = this;
            }

            _progressService = progressService;
            _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
            _configService = configService;

            CheckOperatingSystemCompatibility();

            // Certain things like Cef (our markdown browser engine) get unhappy when GUI is started from a different cwd.
            // If we're in a different one, reset it to our app files directory.
            if (Path.GetDirectoryName(Environment.CurrentDirectory) != Bootstrapper.ApplicationFilesPath)
            {
                Environment.CurrentDirectory = Bootstrapper.ApplicationFilesPath;
            }

            var settings = new CefSettings();

            settings.RegisterScheme(new CefCustomScheme {
                SchemeName = ChocolateyCustomSchemeProvider.SchemeName, SchemeHandlerFactory = new ChocolateyCustomSchemeProvider()
            });
            settings.CefCommandLineArgs.Add("no-proxy-server", "1");
            settings.CachePath = Path.Combine(Bootstrapper.LocalAppDataPath, "CefCache");
            if (!Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null))
            {
                return;
            }
        }
Ejemplo n.º 7
0
        public ShellView(
            IDialogService dialogService,
            IProgressService progressService,
            IChocolateyConfigurationProvider chocolateyConfigurationProvider,
            IConfigService configService,
            IFileSystem fileSystem,
            IImageService imageService)
        {
            InitializeComponent();

            dialogService.ShellView   = this;
            progressService.ShellView = this;

            _progressService = progressService;
            _chocolateyConfigurationProvider = chocolateyConfigurationProvider;
            _configService = configService;
            _fileSystem    = fileSystem;
            _imageService  = imageService;

            this.Icon = BitmapFrame.Create(_imageService.ToolbarIconUri);

            CheckOperatingSystemCompatibility();

            // Certain things like Cef (our markdown browser engine) get unhappy when GUI is started from a different cwd.
            // If we're in a different one, reset it to our app files directory.
            if (_fileSystem.get_directory_name(Environment.CurrentDirectory) != Bootstrapper.ApplicationFilesPath)
            {
                Environment.CurrentDirectory = Bootstrapper.ApplicationFilesPath;
            }

            dialogService.ChildWindowOpened += (sender, o) => IsAnyDialogOpen = true;
            dialogService.ChildWindowClosed += (sender, o) => IsAnyDialogOpen = false;

            SetLanguage(TranslationSource.Instance.CurrentCulture);

            TranslationSource.Instance.PropertyChanged += TranslationLanguageChanged;
        }
Ejemplo n.º 8
0
 public CSharpChocolateyPackageService(IProgressService progressService, Func <Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
     : base(progressService, logServiceFunc, chocolateyConfigurationProvider)
 {
     this.chocoExePath = Path.Combine(this.ChocolateyConfigurationProvider.ChocolateyInstall, "choco.exe");
 }
 public CSharpChocolateyPackageService(IProgressService progressService, Func<Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
     : base(progressService, logServiceFunc, chocolateyConfigurationProvider)
 {
     this.chocoExePath = Path.Combine(this.ChocolateyConfigurationProvider.ChocolateyInstall, "choco.exe");
 }
 public PowerShellChocolateyPackageService(IProgressService progressService, Func<Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
     : base(progressService, logServiceFunc, chocolateyConfigurationProvider)
 {
     this._runspace = RunspaceFactory.CreateRunspace(new ChocolateyHost(this.ProgressService));
     this._runspace.Open();
 }
Ejemplo n.º 11
0
 public PowerShellChocolateyPackageService(IProgressService progressService, Func <Type, ILogService> logServiceFunc, IChocolateyConfigurationProvider chocolateyConfigurationProvider)
     : base(progressService, logServiceFunc, chocolateyConfigurationProvider)
 {
     this._runspace = RunspaceFactory.CreateRunspace(new ChocolateyHost(this.ProgressService));
     this._runspace.Open();
 }