Exemple #1
0
        /// <summary>
        /// Set WorkItem ID and Revision field
        /// </summary>
        /// <param name="id">Id</param>
        /// <param name="rev">Revision</param>
        internal void SetWorkItemAndRevision(int id, int rev)
        {
            // only for Update case
            WSUpdateWorkItem wsUpdate = m_pkg.WorkItemOperations[0] as WSUpdateWorkItem;

            Debug.Assert(wsUpdate != null, "Web service helper not initialized for Update call");
            wsUpdate.Revision   = rev;
            wsUpdate.WorkItemID = id;
        }
Exemple #2
0
        /// <summary>
        /// Handles Date time out of range exception and returns default date time value in UTC.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="outOfRangeEx"></param>
        private DateTime HandleCorruptFileTime(string fileName, ArgumentOutOfRangeException outOfRangeEx)
        {
            // The .Net minimum time is too low and may cause problems in some C++ programs that deal with UTC times.
            // Setting it to the highest may be problematic too – file creation time being higher than the current time.
            DateTime         defaultDate = new DateTime(1970, 1, 1);
            WSUpdateWorkItem wsUpdate    = m_pkg.WorkItemOperations[0] as WSUpdateWorkItem;

            Logger.Write(LogSource.WorkItemTracking, TraceLevel.Warning, CommonResource.CorruptFileDateTime,
                         wsUpdate.WorkItemID, fileName, defaultDate);
            Logger.WriteException(LogSource.Common, outOfRangeEx);
            return(defaultDate.ToUniversalTime());
        }