Combines multiple IStores as a composite. Adds memory caching for IStore.Contains(ManifestDigest).

When adding new Implementations the last child IStore that doesn't throw an UnauthorizedAccessException is used.

When when retrieving existing Implementations the first child IStore that returns true for IStore.Contains(ZeroInstall.Store.Model.ManifestDigest) is used.

Inheritance: System.MarshalByRefObject, IStore
コード例 #1
0
        public override void SetUp()
        {
            base.SetUp();

            _handler = new MockTaskHandler();

            // Prepare mock objects that will be injected with methods in the tests
            _mockStore1 = MockRepository.Create<IStore>();
            _mockStore2 = MockRepository.Create<IStore>();

            _testStore = new CompositeStore(new[] {_mockStore1.Object, _mockStore2.Object});
        }
コード例 #2
0
        public override void SetUp()
        {
            base.SetUp();

            _handler = new MockTaskHandler();

            // Prepare mock objects that will be injected with methods in the tests
            _mockStore1 = MockRepository.Create <IStore>();
            _mockStore2 = MockRepository.Create <IStore>();

            _testStore = new CompositeStore(new[] { _mockStore1.Object, _mockStore2.Object });
        }
コード例 #3
0
ファイル: Selection.cs プロジェクト: modulexcite/0install-win
        /// <inheritdoc/>
        public Selection([NotNull] ICommandHandler handler)
            : base(handler)
        {
            Requirements = new Requirements();
            Options.Add("customize", () => Resources.OptionCustomize, _ => CustomizeSelections = true);

            Options.Add("o|offline", () => Resources.OptionOffline, _ => Config.NetworkUse = NetworkLevel.Offline);
            Options.Add("r|refresh", () => Resources.OptionRefresh, _ => FeedManager.Refresh = true);

            Options.Add("with-store=", () => Resources.OptionWithStore, delegate(string path)
            {
                if (string.IsNullOrEmpty(path)) throw new OptionException(string.Format(Resources.MissingOptionValue, "--with-store"), "with-store");
                Store = new CompositeStore(new[] {new DirectoryStore(path), Store});
            });

            Options.Add("command=", () => Resources.OptionCommand,
                command => Requirements.Command = command);
            Options.Add("before=", () => Resources.OptionBefore,
                (ImplementationVersion version) => _before = version);
            Options.Add("not-before=", () => Resources.OptionNotBefore,
                (ImplementationVersion version) => _notBefore = version);
            Options.Add("version=", () => Resources.OptionVersionRange,
                (VersionRange range) => _version = range);
            Options.Add("version-for==", () => Resources.OptionVersionRangeFor,
                (FeedUri interfaceUri, VersionRange range) => Requirements.ExtraRestrictions[interfaceUri] = range);
            Options.Add("s|source", () => Resources.OptionSource,
                _ => Requirements.Source = true);
            Options.Add("os=", () => Resources.OptionOS + "\n" + SupportedValues(Architecture.KnownOS),
                (OS os) => Requirements.Architecture = new Architecture(os, Requirements.Architecture.Cpu));
            Options.Add("cpu=", () => Resources.OptionCpu + "\n" + SupportedValues(Architecture.KnownCpu),
                (Cpu cpu) => Requirements.Architecture = new Architecture(Requirements.Architecture.OS, cpu));
            Options.Add("language=", () => Resources.OptionLanguage,
                (CultureInfo lang) => Requirements.Languages.Add(lang));

            Options.Add("xml", () => Resources.OptionXml, _ => ShowXml = true);
        }