Ejemplo n.º 1
0
        /// <summary>
        /// Creates the tracked data.
        /// </summary>
        /// <param name="targetObject">The target object.</param>
        /// <param name="trackedObjectBag">The tracked object bag.</param>
        /// <returns>Object tracked data</returns>
        public static TrackedObjectData CreateTrackedData(object targetObject, TrackedObjectBag trackedObjectBag)
        {
            TrackedObjectData result = null;

            if (targetObject != null && !(targetObject is IntermediateObject) && targetObject is ISessionProvider)
            {
                result = new TrackedObjectData(targetObject, trackedObjectBag);
            }
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Prevents a default instance of the <see cref="TrackedObjectData"/> class from being created.
        /// </summary>
        /// <param name="targetObject">The target object.</param>
        /// <param name="trackedObjectBag">The tracked object bag.</param>
        private TrackedObjectData(object targetObject, TrackedObjectBag trackedObjectBag)
        {
            if (targetObject == null) throw new ArgumentNullException("targetObject");

            OldValues = new Dictionary<string, object>();
            Collections = new Dictionary<XPBaseCollection, string>();
            TargetObject = targetObject;
            TrackedObjectBag = trackedObjectBag;
            subscribeToCollectionChanges();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionData"/> class.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="collector">The collector.</param>
 public SessionData(Session session, Collector collector)
 {
     if (session == null) throw new ArgumentNullException("session");
     Session = session;
     Collector = collector;
     SessionId = Guid.NewGuid();
     StartedOn = DateTime.UtcNow;
     trackedObjects = new TrackedObjectBag(this);
     subscribeToSessionEvents(session);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Prevents a default instance of the <see cref="TrackedObjectData"/> class from being created.
        /// </summary>
        /// <param name="targetObject">The target object.</param>
        /// <param name="trackedObjectBag">The tracked object bag.</param>
        private TrackedObjectData(object targetObject, TrackedObjectBag trackedObjectBag)
        {
            if (targetObject == null)
            {
                throw new ArgumentNullException("targetObject");
            }

            OldValues        = new Dictionary <string, object>();
            Collections      = new Dictionary <XPBaseCollection, string>();
            TargetObject     = targetObject;
            TrackedObjectBag = trackedObjectBag;
            subscribeToCollectionChanges();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionData"/> class.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="collector">The collector.</param>
 public SessionData(Session session, Collector collector)
 {
     if (session == null)
     {
         throw new ArgumentNullException("session");
     }
     Session        = session;
     Collector      = collector;
     SessionId      = Guid.NewGuid();
     StartedOn      = DateTime.UtcNow;
     trackedObjects = new TrackedObjectBag(this);
     subscribeToSessionEvents(session);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates the tracked data.
 /// </summary>
 /// <param name="targetObject">The target object.</param>
 /// <param name="trackedObjectBag">The tracked object bag.</param>
 /// <returns>Object tracked data</returns>
 public static TrackedObjectData CreateTrackedData(object targetObject, TrackedObjectBag trackedObjectBag)
 {
     TrackedObjectData result = null;
     if(targetObject != null && !(targetObject is IntermediateObject) && targetObject is ISessionProvider)
         result = new TrackedObjectData(targetObject, trackedObjectBag);
     return result;
 }