示例#1
0
            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;
            }
示例#2
0
 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));
示例#3
0
 public NnModule NnMainNonSC(ImmutableDictionary <string, string> options) =>
 new NnModule(
     "NN Main Non-SC",
     NnMainNonSCCanExecute,
     NnMainNonSCIsDone,
     NnMainNonSCExecute,
     NnMainNonSCGetResult,
     NnModule.GetDefaultOptions(ModuleType.NnMainNonSC),
     options);
示例#4
0
 public NnModule NnMain(ImmutableDictionary <string, string> options) =>
 new NnModule(
     "NN Main",
     () => true,
     NnMainIsDone,
     NnMainExecute,
     NnMainGetResult,
     NnModule.GetDefaultOptions(ModuleType.NnMain),
     options);
示例#5
0
            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();
            }