internal static void GetAllMembers(Activity activity, IList<TrackingDataItem> items, TrackingAnnotationCollection annotations)
 {
     Type type = activity.GetType();
     foreach (FieldInfo info in type.GetFields(BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance))
     {
         if (!IsInternalVariable(info.Name))
         {
             TrackingDataItem item = new TrackingDataItem {
                 FieldName = info.Name,
                 Data = GetRuntimeValue(info.GetValue(activity), activity)
             };
             foreach (string str in annotations)
             {
                 item.Annotations.Add(str);
             }
             items.Add(item);
         }
     }
     foreach (PropertyInfo info2 in type.GetProperties(BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance))
     {
         if (!IsInternalVariable(info2.Name) && (info2.GetIndexParameters().Length <= 0))
         {
             TrackingDataItem item2 = new TrackingDataItem {
                 FieldName = info2.Name,
                 Data = GetRuntimeValue(info2.GetValue(activity, null), activity)
             };
             foreach (string str2 in annotations)
             {
                 item2.Annotations.Add(str2);
             }
             items.Add(item2);
         }
     }
 }
 public ActivityTrackingRecord()
 {
     this._body = new List<TrackingDataItem>();
     this._contextGuid = Guid.Empty;
     this._parentContextGuid = Guid.Empty;
     this._eventDateTime = DateTime.MinValue;
     this._eventOrder = -1;
     this._annotations = new TrackingAnnotationCollection();
 }
 public WorkflowTrackingRecord(System.Workflow.Runtime.Tracking.TrackingWorkflowEvent trackingWorkflowEvent, DateTime eventDateTime, int eventOrder, System.EventArgs eventArgs)
 {
     this._eventDateTime = DateTime.MinValue;
     this._eventOrder = -1;
     this._annotations = new TrackingAnnotationCollection();
     this._event = trackingWorkflowEvent;
     this._eventDateTime = eventDateTime;
     this._eventOrder = eventOrder;
     this._args = eventArgs;
 }
        internal static void GetProperty(string name, Activity activity, TrackingAnnotationCollection annotations, out TrackingDataItem item)
        {
            item = null;
            object tmp = PropertyHelper.GetProperty(name, activity);

            item = new TrackingDataItem();
            item.FieldName = name;
            item.Data = tmp;
            foreach (string s in annotations)
                item.Annotations.Add(s);
        }
 public ActivityTrackingRecord(Type activityType, string qualifiedName, Guid contextGuid, Guid parentContextGuid, ActivityExecutionStatus executionStatus, DateTime eventDateTime, int eventOrder, System.EventArgs eventArgs)
 {
     this._body = new List<TrackingDataItem>();
     this._contextGuid = Guid.Empty;
     this._parentContextGuid = Guid.Empty;
     this._eventDateTime = DateTime.MinValue;
     this._eventOrder = -1;
     this._annotations = new TrackingAnnotationCollection();
     this._activityType = activityType;
     this._qualifiedID = qualifiedName;
     this._status = executionStatus;
     this._eventDateTime = eventDateTime;
     this._contextGuid = contextGuid;
     this._parentContextGuid = parentContextGuid;
     this._eventOrder = eventOrder;
     this._args = eventArgs;
 }
 public UserTrackingRecord(Type activityType, string qualifiedName, Guid contextGuid, Guid parentContextGuid, DateTime eventDateTime, int eventOrder, string userDataKey, object userData)
 {
     this._body = new List<TrackingDataItem>();
     this._contextGuid = Guid.Empty;
     this._parentContextGuid = Guid.Empty;
     this._eventDateTime = DateTime.MinValue;
     this._eventOrder = -1;
     this._annotations = new TrackingAnnotationCollection();
     this._activityType = activityType;
     this._qualifiedID = qualifiedName;
     this._eventDateTime = eventDateTime;
     this._contextGuid = contextGuid;
     this._parentContextGuid = parentContextGuid;
     this._eventOrder = eventOrder;
     this._userData = userData;
     this._key = userDataKey;
 }
        private void CreateAnnotations(XmlReader reader, TrackingAnnotationCollection annotations)
        {
            if (null == reader)
                throw new ArgumentNullException("reader");

            if (null == annotations)
                throw new ArgumentNullException("annotations");

            if (0 != string.Compare(reader.Name, "Annotations", StringComparison.Ordinal))
                throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationInvalidPosition + "Annotations.");

            if (reader.IsEmptyElement)
                return;

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        if (0 == string.Compare(reader.Name, "Annotation", StringComparison.Ordinal))
                        {
                            //
                            // Preserve null and empty as distinct values
                            // null == <Annotation /> empty string = <Annotation></Annotation>
                            if (!reader.IsEmptyElement)
                                annotations.Add(reader.ReadString());
                            else
                                annotations.Add(null);
                        }
                        break;
                    case XmlNodeType.EndElement:
                        if (0 == string.Compare(reader.Name, "Annotations", StringComparison.Ordinal))
                            return;
                        break;
                }
            }
            //
            // Only valid exit is on an EndElement that matches the element that is passed in.
            throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationCloseElementNotFound + "Annotations.");
        }
        private void WriteAnnotations(TrackingAnnotationCollection annotations, XmlTextWriter writer)
        {
            if ((null == annotations) || (0 == annotations.Count))
                return;

            writer.WriteStartElement("Annotations");
            foreach (string s in annotations)
            {
                //
                // Preserve null and empty as distinct values
                // null == <Annotation /> empty string = <Annotation></Annotation>
                writer.WriteStartElement("Annotation");
                if ((null == s) || (s.Length > 0))
                {
                    writer.WriteValue(null == s ? String.Empty : s);
                    writer.WriteEndElement();
                }
                else
                    writer.WriteFullEndElement();
            }
            writer.WriteEndElement();
        }
 public WorkflowDataTrackingExtract(string member)
 {
     this._annotations = new TrackingAnnotationCollection();
     this._name = member;
 }
 public WorkflowDataTrackingExtract()
 {
     this._annotations = new TrackingAnnotationCollection();
 }
        private void CreateAnnotations(XmlReader reader, TrackingAnnotationCollection annotations)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (annotations == null)
            {
                throw new ArgumentNullException("annotations");
            }
            if (string.Compare(reader.Name, "Annotations", StringComparison.Ordinal) != 0)
            {
                throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationInvalidPosition + "Annotations.");
            }
            if (!reader.IsEmptyElement)
            {
                while (true)
                {
                    if (!reader.Read())
                    {
                        throw new TrackingProfileDeserializationException(ExecutionStringManager.TrackingDeserializationCloseElementNotFound + "Annotations.");
                    }
                    switch (reader.NodeType)
                    {
                        case XmlNodeType.Element:
                            if (string.Compare(reader.Name, "Annotation", StringComparison.Ordinal) == 0)
                            {
                                if (!reader.IsEmptyElement)
                                {
                                    annotations.Add(reader.ReadString());
                                }
                                else
                                {
                                    annotations.Add(null);
                                }
                            }
                            break;

                        case XmlNodeType.EndElement:
                            if (string.Compare(reader.Name, "Annotations", StringComparison.Ordinal) == 0)
                            {
                                return;
                            }
                            break;
                    }
                }
            }
        }
 private void WriteAnnotations(TrackingAnnotationCollection annotations, XmlTextWriter writer)
 {
     if ((annotations != null) && (annotations.Count != 0))
     {
         writer.WriteStartElement("Annotations");
         foreach (string str in annotations)
         {
             writer.WriteStartElement("Annotation");
             if ((str == null) || (str.Length > 0))
             {
                 writer.WriteValue((str == null) ? string.Empty : str);
                 writer.WriteEndElement();
             }
             else
             {
                 writer.WriteFullEndElement();
             }
         }
         writer.WriteEndElement();
     }
 }
        internal static void GetAllMembers(Activity activity, IList<TrackingDataItem> items, TrackingAnnotationCollection annotations)
        {
            Type t = activity.GetType();
            //
            // Get all fields
            FieldInfo[] fields = t.GetFields(BindingFlags.Public |
                                                BindingFlags.NonPublic |
                                                BindingFlags.Instance |
                                                BindingFlags.Static |
                                                BindingFlags.GetField);

            foreach (FieldInfo f in fields)
            {
                if (!PropertyHelper.IsInternalVariable(f.Name))
                {
                    TrackingDataItem data = new TrackingDataItem();
                    data.FieldName = f.Name;
                    data.Data = GetRuntimeValue(f.GetValue(activity), activity);
                    foreach (string s in annotations)
                        data.Annotations.Add(s);
                    items.Add(data);
                }
            }
            //
            // Get all properties (except indexers)
            PropertyInfo[] properties = t.GetProperties(BindingFlags.Public |
                                                            BindingFlags.NonPublic |
                                                            BindingFlags.Instance |
                                                            BindingFlags.Static |
                                                            BindingFlags.GetProperty);

            foreach (PropertyInfo p in properties)
            {
                if (!IsInternalVariable(p.Name))
                {
                    //
                    // Skip indexers, since private data members
                    // are exposed the data is still available.
                    if (p.GetIndexParameters().Length > 0)
                        continue;

                    TrackingDataItem data = new TrackingDataItem();
                    data.FieldName = p.Name;
                    data.Data = GetRuntimeValue(p.GetValue(activity, null), activity);
                    foreach (string s in annotations)
                        data.Annotations.Add(s);
                    items.Add(data);
                }
            }
        }
 public WorkflowTrackingRecord()
 {
     this._eventDateTime = DateTime.MinValue;
     this._eventOrder = -1;
     this._annotations = new TrackingAnnotationCollection();
 }
 public ActivityDataTrackingExtract()
 {
     this._annotations = new TrackingAnnotationCollection();
 }