question regarding afdatabase.refresh method

Discussion created by ygalipeau on Mar 24, 2013
Latest reply on Mar 25, 2013 by RJKSolutions

good morning everyone


i am looking to use the refresh method of the AFDatabase object to get the changes that are made globally on AF and EF. Mainly, when an element is added, modified or an event frame template is created, etc. as i need to sync some information from AF and EF with another system. i made a sample program that is looking for changes against the DB (from the AF SDK help file). the event that is raised looks like the following:


Private Shared Sub myDB_Changed(ByVal sender As Object, ByVal e As AFChangedEventArgs) Handles myDB.Changed
        Console.WriteLine("Object Changed Event Raised")

    End Sub




after some testing i have a couple questions regarding what i receive for the AFChangedEventArgs:


1- for an element, as soon as i add an element in the pi system explorer, i receive a change notification and the change event arg is the following (although my changes are not checked in


e = {Action='SubObjectAdd', Identity='Element', UniqueID='af60adc2-6472-427a-8cd0-958edbb58897', ParentID='00000000-0000-0000-0000-000000000000'}


then after checking in my change, another notification is raised and my change arg is


e = {Action='SubObjectAdd', Identity='Element', UniqueID='af60adc2-6472-427a-8cd0-958edbb58897', ParentID='00000000-0000-0000-0000-000000000000'}


the exact same one. my question, how can i differentiate a commited change versus the initial addition in system explorer, which is not checked in?




2- for event frame, no matter which change i make to an event frame (start time, endtime change an attribute value) i always receive the same change argument


e = {Action='SubObjectRefresh', Identity='Event Frame', UniqueID='f1c23bf9-fd32-43c0-0000-000000004dbd', ParentID='00000000-0000-0000-0000-000000000000'}


how could i know if an attribute was change or the event frame starttime etc. is there a way to get more information as what was changed?