Ejemplo n.º 1
0
 public CR1NPRef(CEntityObject aParentEntityObject, CR1NPRefMetaInfo aRefMetaInfo, CSkalarRefMetaInfo aFkRefMetaInfo)
     : base(aParentEntityObject, aRefMetaInfo)
 {
     this.FkRefMetaInfo       = aFkRefMetaInfo;
     this.FkRef               = aFkRefMetaInfo.GetRef(aParentEntityObject);
     this.FkRef.ValueChanged += this.OnFkRefValueChanged;
 }
Ejemplo n.º 2
0
 public CR11PRef(CEntityObject aParentEntityObject, CR11PRefMetaInfo aRefMetaInfo, CSkalarRefMetaInfo aFkRefMetaInfo)
     : base(aParentEntityObject, aRefMetaInfo)
 {
     this.FkRefMetaInfo       = aFkRefMetaInfo;
     this.FkRef               = (CSkalarRef <TChild, Guid>)aFkRefMetaInfo.GetRef(aParentEntityObject);
     this.FkRef.ValueChanged += this.OnFkRefValueChanged;
     this.Load(this.FkRef.Value);
 }
Ejemplo n.º 3
0
        internal void VisitLoad(CEntityObject aEntityObject)
        {
            var aTyp      = aEntityObject.Typ;
            var aSchema   = this.Schema;
            var aHirarchy = aSchema.GetHirarchy(aTyp);

            foreach (var aAspect in aHirarchy)
            {
                this.Load(aEntityObject, aAspect);
            }
        }
Ejemplo n.º 4
0
        protected override void Save(CEntityObject aEntityObject, CTyp aAspect)
        {
            var aFileInfo = this.GetObjectFileInfo(aAspect, aEntityObject.Guid.Value);

            if (aEntityObject.IsLocallyDeleted)
            {
                aFileInfo.Delete();
            }
            else
            {
                var aPersistentProperties = this.Schema.GetPersistentProperties(aAspect);
                var aXmlDocument          = aEntityObject.NewXmlDocument(aPersistentProperties);
                aXmlDocument.Save(aFileInfo.FullName);
            }
        }
Ejemplo n.º 5
0
        protected override void Load(CEntityObject aEntityObject, CTyp aAspect)
        {
            var aStorage     = this;
            var aObjectId    = aEntityObject.Guid.Value;
            var aFileInfo    = this.GetObjectFileInfo(aAspect, aObjectId);
            var aXmlDocument = new XmlDocument();
            var aSchema      = aStorage.Schema;
            var aProperties  = aSchema.GetPersistentProperties(aAspect);

            aXmlDocument.Load(aFileInfo.FullName);
            var aXmlElement = aXmlDocument.SelectNodes(CRefMetaInfo.ObjectElementName).OfType <XmlElement>().Single();

            foreach (var aProperty in aProperties)
            {
                aProperty.LoadXml(aEntityObject, aXmlElement);
            }
        }
Ejemplo n.º 6
0
 public CRx1PRef(CEntityObject aParentEntityObject, CRefMetaInfo aRefMetaInfo) : base(aParentEntityObject, aRefMetaInfo, new CAccessKey())
 {
 }
Ejemplo n.º 7
0
 public CR11WRef(CEntityObject aParentEntityObject, CR11WRefMetaInfo aRefMetaInfo, CAccessKey aWriteKeyNullable = null) : base(aParentEntityObject, aRefMetaInfo, aWriteKeyNullable)
 {
 }
Ejemplo n.º 8
0
 public CR11CRef(CEntityObject aParentEntityObject, CR11CRefMetaInfo aSkalarRefMetaInfoNullable, CR11PRefMetaInfo aReverseNaviRefNullable = null) : base(aParentEntityObject, aSkalarRefMetaInfoNullable)
 {
     this.ReverseNaviRefMetaInfoNullable = aReverseNaviRefNullable;
 }
Ejemplo n.º 9
0
 public CRx1Ref(CEntityObject aParentEntityObject, CRefMetaInfo aRefMetaInfo, CAccessKey aWriteKeyNullable = null) : base(aParentEntityObject, aRefMetaInfo, aWriteKeyNullable)
 {
     this.ObjectProxy = new CObjectProxy <TTarget>(aParentEntityObject.Storage, default(Guid));
 }
Ejemplo n.º 10
0
 public CR1NWRef(CEntityObject aParentEntityObject, CR1NWRefMetaInfo aSkalarRefMetaInfo) : base(aParentEntityObject, aSkalarRefMetaInfo)
 {
 }
Ejemplo n.º 11
0
 public CSkalarRef(CEntityObject aParentEntityObject, CSkalarRefMetaInfo aSkalarRefMetaInfo, CAccessKey aWriteKeyNullable = null) : base(aParentEntityObject, aSkalarRefMetaInfo, aWriteKeyNullable)
 {
 }
Ejemplo n.º 12
0
 protected CNRef(CEntityObject aParentEntityObject, CRefMetaInfo aRefMetaInfo) : base(aParentEntityObject, aRefMetaInfo, new CAccessKey())
 {
     this.Collection = aRefMetaInfo.NewCollection <TRef>(aParentEntityObject.Storage);
     this.ChangeValue(this.Collection, this.WriteKeyNullable, false);
 }
Ejemplo n.º 13
0
 protected CRef(CEntityObject aParentEntityObject, CRefMetaInfo aRefMetaInfo, CAccessKey aWriteKeyNullable)
 {
     this.ParentEntityObject = aParentEntityObject;
     this.RefMetaInfo        = aRefMetaInfo;
     this.WriteKeyNullable   = aWriteKeyNullable;
 }
Ejemplo n.º 14
0
 protected abstract void Load(CEntityObject aEntityObject, CTyp aAspect);
Ejemplo n.º 15
0
 protected override void Save(CEntityObject aEntityObject, CTyp aAspect)
 => throw new InvalidOperationException();
Ejemplo n.º 16
0
 protected abstract void Save(CEntityObject aEntityObject, CTyp aAspect);