public static void Main(string[] args) { string pathInput = null; string pathOutput = null; var result = Parser.Default.ParseArguments <Options>(args) .WithParsed(options => { pathInput = options.InputFile; pathOutput = options.OutputFile; }); using (var istream = null == pathInput ? // If the standard input is used, make a temporary copy of this stream inside the memory. // This should be done because the input stream to PresentationDocument should be seekable. (Stream) new SeekableTempStream(Console.OpenStandardInput()) : File.Open(pathInput, FileMode.Open)) using (var ppt = PresentationDocument.Open(istream, false)) using (var ostream = null == pathOutput ? Console.OpenStandardOutput() : File.Open(pathOutput, FileMode.Create)) using (var sw = new StreamWriter(ostream)) using (var writer = new JsonTextWriter(sw)) using (var repoIndex = File.Open("services.json", FileMode.Open, FileAccess.Read)) using (var generator = new NodeRedFlowGenerator(writer)) { // Load service index from the service repository. SlideServiceMap.LoadRepoFrom(repoIndex); var prez = new Presentation(ppt); generator.Add(prez.Activities); generator.Generate(); } }
public Activity(SlidePart slidePart) { _slidePart = slidePart; Behavior = new ActivityBehavior(slidePart); ServiceMap = new SlideServiceMap(slidePart); }