コード例 #1
0
            public ObjectDataAccessManager(Stratabase stratabase, Guid id)
            {
                this.SB = stratabase;
                this.Id = id;

                this.SB.OnObjectDataAccessManagerAdded(this);
            }
コード例 #2
0
            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);
                }
            }
コード例 #3
0
        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();
        }
コード例 #4
0
            // 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);
            }
コード例 #5
0
 public StrataPropertyAdapter(Stratabase sb, Guid itemId, string propertyName, ConvertAccessToOutput factory)
     : this(sb.GeneratePropertyAccess <TStrataValue>(itemId, propertyName), factory)
 {
 }
コード例 #6
0
 public PseudoPropertyBag(Stratabase stratabase, Dictionary <string, object> storage)
 {
     m_stratabase = stratabase;
     m_storage    = storage;
 }
コード例 #7
0
ファイル: StratabaseBackedModel.cs プロジェクト: ajbadaj/AJut
 public StratabaseBackedModel(Guid id, Stratabase sb)
 {
     this.Id = id;
     this.SB = sb;
 }