Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Soooo.....</p> <p>Not many people need the transitions for WorkItemTypes. </p> <p>Well, I needed it so I wrote a method to do it. Here it is in case someone else ever needs this:</p> <pre><code>// Hold a list of all the transistions we have done. This will help us not have run them again If we already have. private static Dictionary&lt;WorkItemType, List&lt;Transition&gt;&gt; _allTransistions = new Dictionary&lt;WorkItemType, List&lt;Transition&gt;&gt;(); /// &lt;summary&gt; /// Get the transitions for this &lt;see cref="WorkItemType"/&gt; /// &lt;/summary&gt; /// &lt;param name="workItemType"&gt;&lt;/param&gt; /// &lt;returns&gt;&lt;/returns&gt; private static List&lt;Transition&gt; GetTransistions(this WorkItemType workItemType) { List&lt;Transition&gt; currentTransistions; // See if this WorkItemType has already had it's transistions figured out. _allTransistions.TryGetValue(workItemType, out currentTransistions); if (currentTransistions != null) return currentTransistions; // Get this worktype type as xml XmlDocument workItemTypeXml = workItemType.Export(false); // Create a dictionary to allow us to look up the "to" state using a "from" state. var newTransistions = new List&lt;Transition&gt;(); // get the transistions node. XmlNodeList transitionsList = workItemTypeXml.GetElementsByTagName("TRANSITIONS"); // As there is only one transistions item we can just get the first XmlNode transitions = transitionsList[0]; // Iterate all the transitions foreach (XmlNode transition in transitions) { // save off the transistion newTransistions.Add(new Transition { From = transition.Attributes["from"].Value, To = transition.Attributes["to"].Value }); } // Save off this transition so we don't do it again if it is needed. _allTransistions.Add(workItemType, newTransistions); return newTransistions; } public class Transition { public string To { get; set; } public string From { get; set; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload