コード例 #1
0
        }                                    // Needed to serialize;

        public StackHashEventPackage(StackHashEventInfoCollection eventInfoList, StackHashCabPackageCollection cabs,
                                     StackHashEvent eventData, int productId)
        {
            m_EventInfoList    = eventInfoList;
            m_Cabs             = cabs;
            m_EventData        = eventData;
            m_ProductId        = productId;
            m_CriteriaMatchMap = 0;
        }
コード例 #2
0
 public StackHashBugReportData(StackHashProduct product, StackHashFile file, StackHashEvent theEvent, StackHashCab cab,
                               String scriptName, StackHashReportOptions options)
 {
     m_Product    = product;
     m_File       = file;
     m_Event      = theEvent;
     m_Cab        = cab;
     m_ScriptName = scriptName;
     m_Options    = options;
 }
コード例 #3
0
        public void SetWinQualFields(StackHashEvent newEvent)
        {
            if (newEvent == null)
            {
                throw new ArgumentNullException("newEvent");
            }

            // Don't set the fields that are set by the user - e.g. bugid.
            DateCreatedLocal  = newEvent.DateCreatedLocal;
            DateModifiedLocal = newEvent.DateModifiedLocal;
            EventTypeName     = newEvent.EventTypeName;
            Id             = newEvent.Id;
            EventSignature = newEvent.EventSignature;
            TotalHits      = newEvent.TotalHits;
            FileId         = newEvent.FileId;
        }
コード例 #4
0
        /// <summary>
        /// Clone a copy of the event.
        /// </summary>
        /// <returns>Cloned copy of the event.</returns>
        public object Clone()
        {
            StackHashEventSignature eventSignatureClone;

            if (m_EventSignature != null)
            {
                eventSignatureClone = m_EventSignature.Clone() as StackHashEventSignature;
            }
            else
            {
                eventSignatureClone = new StackHashEventSignature();
            }

            StackHashEvent theEvent = new StackHashEvent(m_DateCreatedLocal, m_DateModifiedLocal,
                                                         m_EventTypeName, m_Id, eventSignatureClone, m_TotalHits, m_FileId, m_BugId);

            return(theEvent);
        }
コード例 #5
0
        /// <summary>
        /// Compares this object to the specified one.
        /// </summary>
        /// <param name="theEvent">Object to compare to.</param>
        /// <param name="onlyWinQualFields">Only compare the WinQual fields.</param>
        /// <returns>0 for equal, or -1 if not.</returns>
        public int CompareTo(StackHashEvent theEvent, bool onlyWinQualFields)
        {
            if (theEvent == null)
            {
                throw new ArgumentNullException("theEvent");
            }

            if ((theEvent.DateCreatedLocal == m_DateCreatedLocal) &&
                (theEvent.DateModifiedLocal == m_DateModifiedLocal) &&
                (theEvent.EventSignature.CompareTo(m_EventSignature) == 0) &&
                (theEvent.EventTypeName == m_EventTypeName) &&
                (theEvent.Id == m_Id))
            {
                if (!onlyWinQualFields)
                {
                    if ((theEvent.TotalHits == m_TotalHits) &&
                        (theEvent.FileId == m_FileId) &&
                        (theEvent.BugId == m_BugId) &&
                        (theEvent.PlugInBugId == m_PlugInBugId) &&
                        (theEvent.WorkFlowStatus == m_WorkFlowStatus))
                    //(theEvent.WorkFlowStatusName == m_WorkFlowStatusName)) - name is a transient field and may change.
                    {
                        return(0);
                    }
                    else
                    {
                        return(-1);
                    }
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(-1);
            }
        }
コード例 #6
0
        /// <summary>
        /// Determines if a change in the event data should be reported to bug tracking plugins.
        /// </summary>
        /// <param name="newEvent">The new event data.</param>
        /// <param name="checkNonWinQualFields">True - the non-winqual fields are compared too.</param>
        /// <returns>True - significant changes so report it, False - nothing to report.</returns>
        public bool ShouldReportToBugTrackPlugIn(StackHashEvent newEvent, bool checkNonWinQualFields)
        {
            if (newEvent == null)
            {
                throw new ArgumentNullException("newEvent");
            }

            if (this.Id != newEvent.Id)
            {
                return(true);
            }
            if (this.EventTypeName != newEvent.EventTypeName)
            {
                return(true);
            }
            if (this.EventSignature.CompareTo(newEvent.EventSignature) != 0)
            {
                return(true);
            }

            if (checkNonWinQualFields)
            {
                if (this.TotalHits != newEvent.TotalHits)
                {
                    return(true);
                }
                if (this.BugId != newEvent.BugId)
                {
                    return(true);
                }

                // Don't check the file ID as an event may be associated with several files.
                // Also don't check the m_PlugInBugId because this is set by the plug-in.
            }

            return(false);
        }