Exemple #1
0
 /// <summary>
 ///     Given a WSD description, produces a sequence diagram PNG.
 /// </summary>
 /// This method uses the WebSequenceDiagrams.com public API to query an image and stored in a local
 /// temporary directory on the file system.
 ///
 /// You can easily change it to return the stream to the image requested instead of a file.
 ///
 /// To invoke it:
 /// ..
 /// using System.Web;
 /// ...
 ///
 /// string fileName = grabSequenceDiagram("a->b: Hello", "qsd", "png");
 /// ..
 ///
 /// You need to add the assembly "System.Web" to your reference list (that by default is not
 /// added to new projects)
 ///
 /// Questions / suggestions: [email protected]
 /// <param name="wsd">The web sequence diagram description text</param>
 /// <param name="style">One of the valid styles for the diagram</param>
 /// <param name="fileFormat">The output format requested. Must be one of the valid format supported</param>
 /// <returns>The full path of the downloaded image</returns>
 /// <exception cref="Exception">If an error occurred during the request</exception>
 public static Task <byte[]> GrabSequenceDiagram(String wsd, Styles style, String fileFormat)
 {
     return(GrabSequenceDiagram(wsd, style.ApiString(), fileFormat));
 }