File tree Expand file tree Collapse file tree
src/MediaConverters/MediaConverters.Tool Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// See https://aka.ms/new-console-template for more information
22
33using System ;
4+ using System . Collections . Generic ;
45using DotNetCampus . MediaConverters . Contexts ;
56using DotNetCampus . MediaConverters . Imaging . Optimizations ;
67using DotNetCampus . MediaConverters . Workers ;
@@ -20,6 +21,26 @@ class Program
2021{
2122 static async Task < int > Main ( string [ ] args )
2223 {
24+ var imageConvertContext = new ImageConvertContext ( )
25+ {
26+ MaxImageWidth = 100 ,
27+ ImageConvertTaskList = new List < IImageConvertTask > ( )
28+ {
29+ new ReplaceColorTask ( ) ,
30+ new SetDuotoneEffectTask ( ) ,
31+ }
32+ } ;
33+ var jsonText = imageConvertContext . ToJsonText ( ) ;
34+ if ( ! string . IsNullOrEmpty ( jsonText ) )
35+ {
36+ Console . WriteLine ( jsonText ) ;
37+
38+ var context = ImageConvertContext . FromJsonText ( jsonText ) ;
39+ Console . WriteLine ( $ "Context={ context } Task={ context ? . ImageConvertTaskList ? . Count } ") ;
40+
41+ return 0 ;
42+ }
43+
2344 var options = DotNetCampus . Cli . CommandLine . Parse ( args ) . As < Options > ( ) ;
2445
2546 return await RunAsync ( options ) ;
You can’t perform that action at this time.
0 commit comments