Exemple #1
0
        protected override void HandleAspectChangedNow(ChangeAspect changedAspect, PersistableObject changedObject)
        {
            base.HandleAspectChangedNow(changedAspect, changedObject);

            // detect name and value change, keep in mind you want the ORIGINAL NAME (so upon creation it might be null which is fine)
            string aspectName = changedAspect.Name;
            string objName    = changedObject.DisplayedName;
            string objValue   = changedObject.GetAttributeValue("Value") as string;

            if (aspectName == "Buffer.Value")   // Change value of buffer
            {
                Helper.UpdateBufferValue(objName, objValue);
            }
            else if (aspectName == "NamedObject.Name")   // changeAspect.Name
            {
                if (!Helper.BufferExists(objName))
                {
                    Helper.SaveNewBuffer(objName, objValue);
                }
                else
                {
                    Helper.UpdateBufferValue(objName, objValue);
                }
            }
            else if (aspectName == "PersistableObject.Deleting")   // Delete buffers from xml
            {
                Helper.DeleteBuffer(objName);
            }
        }