public NnModuleForm( NnModuleRecord record ) { this.Type = record.Type; var options = new List <Variable>(); var defaultOptions = NnModule.GetDefaultOptions(record.Type); foreach (var item in defaultOptions) { options.Add( new Variable( item.Key, item.Value, record.Options != null ? (record.Options.ContainsKey(item.Key) ? record.Options[item.Key] : null) : null ) ); } this.Options = options.ToImmutableList(); this.Result = record.Result; }
public NnModule Dummy(ImmutableDictionary <string, string> options) => new NnModule( "(Module not implemented)", () => true, () => true, (CancellationToken ct, ImmutableDictionary <string, string> options) => true, () => "(none)", NnModule.GetDefaultOptions(ModuleType.Dummy));
public NnModule NnMainNonSC(ImmutableDictionary <string, string> options) => new NnModule( "NN Main Non-SC", NnMainNonSCCanExecute, NnMainNonSCIsDone, NnMainNonSCExecute, NnMainNonSCGetResult, NnModule.GetDefaultOptions(ModuleType.NnMainNonSC), options);
public NnModule NnMain(ImmutableDictionary <string, string> options) => new NnModule( "NN Main", () => true, NnMainIsDone, NnMainExecute, NnMainGetResult, NnModule.GetDefaultOptions(ModuleType.NnMain), options);
public NnModuleForm( ModuleType type ) { this.Type = type; var options = new List <Variable>(); foreach (var item in NnModule.GetDefaultOptions(type)) { options.Add( new Variable( item.Key, item.Value, null)); } this.Options = options.ToImmutableList(); }