public ObjectDataAccessManager(Stratabase stratabase, Guid id) { this.SB = stratabase; this.Id = id; this.SB.OnObjectDataAccessManagerAdded(this); }
public StratabaseDataModel(Stratabase sb, bool includeBaseline, int[] layersToInclude) { this.BaselineData = includeBaseline ? _StratumToSaveData(sb.m_baselineStorageLayer) : null; bool includeAllOverrideLayers = layersToInclude.Length == 1 && layersToInclude[0] == -1; this.OverrideLayers = new Dictionary <Guid, Dictionary <string, object> > [sb.OverrideLayerCount]; for (int stratumIndex = 0; stratumIndex < sb.OverrideLayerCount; ++stratumIndex) { this.OverrideLayers[stratumIndex] = (includeAllOverrideLayers || layersToInclude.Contains(stratumIndex)) ? _StratumToSaveData(sb.m_overrideStorageLayers[stratumIndex]) : null; } sb.m_overrideStorageLayers.Select(_StratumToSaveData).ToArray(); Dictionary <Guid, Dictionary <string, object> > _StratumToSaveData(Stratum _s) { var output = new Dictionary <Guid, Dictionary <string, object> >(); foreach (KeyValuePair <Guid, PseudoPropertyBag> data in _s) { output.Add(data.Key, data.Value.m_storage); } return(output); } }
public StrataListPropertyAdapter(StrataPropertyListAccess <TStrataElementValue> referenceAccess, ConvertAccessToOutput factory) { this.Access = referenceAccess; m_referenceElements = referenceAccess.Elements; ((INotifyCollectionChanged)m_referenceElements).CollectionChanged += this.ListAccessElementsCache_OnCollectionChanged; m_sb = referenceAccess.ODAM.SB; m_factory = factory; this.Elements = new ReadOnlyObservableCollection <TAdaptedElementValue>(m_elements); this.Reset(); }
// This doesn't **need** to be here, but I like having it next to it's opposite above public static Stratum FromStratumData(Stratabase sb, Dictionary <Guid, Dictionary <string, object> > stratumData) { var output = new Stratum(); if (stratumData != null) { foreach (KeyValuePair <Guid, Dictionary <string, object> > data in stratumData) { output.Add(data.Key, new PseudoPropertyBag(sb, data.Value)); } } return(output); }
public StrataPropertyAdapter(Stratabase sb, Guid itemId, string propertyName, ConvertAccessToOutput factory) : this(sb.GeneratePropertyAccess <TStrataValue>(itemId, propertyName), factory) { }
public PseudoPropertyBag(Stratabase stratabase, Dictionary <string, object> storage) { m_stratabase = stratabase; m_storage = storage; }
public StratabaseBackedModel(Guid id, Stratabase sb) { this.Id = id; this.SB = sb; }