Exemple #1
0
        public void SetLoadedValues(IDictionary <XName, InstanceValue> values)
        {
            Fx.AssertAndThrow(this.expectedStage == Stage.Load, "SetLoadedValues called at the wrong time.");
            Fx.Assert(values != null, "Null values collection provided to SetLoadedValues.");

            this.values        = values;
            this.readOnlyView  = values as ReadOnlyDictionaryInternal <XName, InstanceValue> ?? new ReadOnlyDictionaryInternal <XName, InstanceValue>(values);
            this.readWriteView = new ValueDictionaryView(this.values, false);
        }
Exemple #2
0
        // Used for the save pipeline.
        public PersistencePipeline(IEnumerable <IPersistencePipelineModule> modules, Dictionary <XName, InstanceValue> initialValues)
        {
            Fx.Assert(modules != null, "Null modules collection provided to persistence pipeline.");

            this.expectedStage = Stage.Collect;
            this.modules       = modules;
            this.values        = initialValues;
            this.readOnlyView  = new ReadOnlyDictionaryInternal <XName, InstanceValue>(this.values);
            this.readWriteView = new ValueDictionaryView(this.values, false);
            this.writeOnlyView = new ValueDictionaryView(this.values, true);
        }