Пример #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="core">Target TFS</param>
 /// <param name="svc">Work item tracking service</param>
 /// <param name="updates">Updates to submit</param>
 private TfsBatchUpdateHelper(
     TfsCore core,
     ITfsWorkItemServer svc,
     XmlDocument[] updates)
 {
     m_core    = core;
     m_svc     = svc;
     m_updates = updates;
     m_results = new UpdateResult[updates.Length];
 }
Пример #2
0
        /// <summary>
        /// Submits updates into the work item store.
        /// </summary>
        /// <param name="core">Target TFS</param>
        /// <param name="svc">Work item tracking service</param>
        /// <param name="updates">Updates to submit</param>
        /// <returns>Results</returns>
        public static UpdateResult[] Submit(
            TfsCore core,
            ITfsWorkItemServer svc,
            XmlDocument[] updates)
        {
            TraceManager.EnterMethod(core, svc, updates);

            TfsBatchUpdateHelper helper = new TfsBatchUpdateHelper(core, svc, updates);

            helper.Submit(0, updates.Length - 1);
            return(helper.m_results);
        }
Пример #3
0
 /// <summary>
 /// Enumerable's constructor.
 /// </summary>
 /// <param name="core">TFS core object</param>
 /// <param name="store">Source work item store</param>
 /// <param name="condition">Query's condition for obtaining work items</param>
 public TfsMigrationWorkItems(
     TfsCore core,
     WorkItemStore store,
     string condition)
 {
     m_core  = core;
     m_store = store;
     m_firstItemIdInNextPage = 0;
     m_queryBase             = string.Format(
         CultureInfo.InvariantCulture,
         "SELECT [System.Id], [System.Rev] FROM WorkItems WHERE ({0})",
         condition);
     m_context = new Dictionary <string, object>();
     m_context.Add("project", m_core.Config.Project);
     Query();
     ShallowReset();
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="core">Shared TFS core</param>
        /// <param name="item">TFS work item</param>
        /// <param name="fieldForm">Tells what field name should be used</param>
        public TfsMigrationWorkItem(
            TfsCore core,
            WorkItem item)
        {
            m_core      = core;
            m_watermark = new Watermark(
                item.Id.ToString(),
                item.Rev);
            m_workItemType = (string)item.Fields[CoreField.WorkItemType].Value;
            if ((int)item[CoreField.AttachedFileCount] > 0)
            {
                m_flags |= MigrationWorkItemData.Attachments;
            }
            int linkCount = (int)item[CoreField.ExternalLinkCount] + (int)item[CoreField.RelatedLinkCount] + (int)item[CoreField.HyperLinkCount];

            if (linkCount > 0)
            {
                m_flags |= MigrationWorkItemData.Links;
            }
            m_workItem = item;
        }