Пример #1
0
 public SelectFunc(IGraphRuntime runtime)
     : base(runtime)
 {
     this.inputPin  = AddInputPin("Input", PinDataTypeFactory.Create <ISequence>(), PropertyMode.Never);
     this.funcPin   = AddInputPin("Function", PinDataTypeFactory.Create <Delegate>(), PropertyMode.Allow);
     this.outputPin = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <object> >());
 }
Пример #2
0
        public Take(IGraphRuntime runtime)
            : base(runtime)
        {
            this.inputPin  = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.countPin  = AddInputPin("Count", PinDataTypeFactory.CreateInt32(5), PropertyMode.Default);
            this.outputPin = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(ISequence <>)));

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault();

                    if (genericType != null)
                    {
                        genericDelegate = new GenericDelegate <Func <object, object, object> >(this, EvaluateInternalAttribute.GetMethod(GetType()).MakeGenericMethod(genericType));
                    }
                    else
                    {
                        genericDelegate = null;
                    }

                    outputPin.ChangeType(pinDataType);
                });
            });
        }
Пример #3
0
 public UnaryOperation(IGraphRuntime runtime, string moduleType, Func <double, double> operation, string resultPinName = "Result", string operandPinName = "Operand")
     : base(runtime, ModuleKind.Module, DisplayMode.Expanded, moduleType)
 {
     this.operation  = operation;
     this.operandPin = this.AddInputPin(operandPinName, PinDataTypeFactory.CreateFloat64(), PropertyMode.Never);
     this.resultPin  = this.AddOutputPin(resultPinName, PinDataTypeFactory.CreateFloat64());
 }
Пример #4
0
 public ZipFunc(IGraphRuntime runtime)
     : base(runtime)
 {
     this.funcPin         = AddInputPin("Function", PinDataTypeFactory.Create <Delegate>(), PropertyMode.Allow);
     this.dynamicInputPin = new DynamicInputPin(runtime, inputs, "Input", PinDataTypeFactory.Create <ISequence>());
     this.outputPin       = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <object> >());
 }
Пример #5
0
        public Where(IGraphRuntime runtime)
            : base(runtime, false, PinDataTypeFactory.Create <bool>(), SUBGRAPH_SOURCE_PIN_ID)
        {
            this.inputPin  = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.outputPin = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <object> >());

            this.subGraphSource = ((GenericOutputPin)this.subGraphInputModule.Outputs[SUBGRAPH_SOURCE_PIN_ID]);
            this.subGraphResult = this.SubGraph.OutputModule.DefaultInputPin;

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? typeof(object);
                    subGraphSource.ChangeType(PinDataTypeFactory.FromType(genericType));

                    var outputType = PinDataTypeFactory.FromType(typeof(ISequence <>).MakeGenericType(genericType));
                    if (outputPin.DataType.UnderlyingType != outputType.UnderlyingType)
                    {
                        outputPin.ChangeType(outputType);
                    }

                    genericDelegate = new GenericDelegate <Func <object, object, object> >(this, EvaluateInternalAttribute.GetMethod(GetType()).MakeGenericMethod(genericType));
                });
            });
        }
Пример #6
0
 public ShaGenerator(IGraphRuntime runtime, HashAlgorithmType type)
     : base(runtime)
 {
     this.type     = type;
     this.inputPin = AddInputPin("Input", PinDataTypeFactory.Create <object>(), PropertyMode.Never);
     this.hashPin  = AddOutputPin("Hash", PinDataTypeFactory.Create <byte[]>());
 }
Пример #7
0
        public SequenceToArray(IGraphRuntime runtime)
            : base(runtime, ModuleKind.Module, DisplayMode.Collapsed)
        {
            this.inputPin  = AddInputPin("Sequence", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Allow);
            this.outputPin = AddOutputPin("Array", PinDataTypeFactory.FromType(typeof(object[])));

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var method = EvaluateInternalAttribute.GetMethod(GetType()).MakeGenericMethod(pinDataType.UnderlyingType);

                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? pinDataType.UnderlyingType;
                    if (genericType != null)
                    {
                        genericDelegate = new GenericDelegate <Func <object, object> >(this, EvaluateInternalAttribute.GetMethod(GetType()).MakeGenericMethod(genericType));
                    }
                    else
                    {
                        genericDelegate = null;
                    }

                    outputPin.ChangeType(PinDataTypeFactory.FromType(genericType.MakeArrayType()));
                });
            });
        }
Пример #8
0
        public Convert(IGraphRuntime runtime)
            : base(runtime)
        {
            this.inputPin      = AddInputPin("Input", PinDataTypeFactory.CreateFloat64(), PropertyMode.Never);
            this.targetTypePin = AddInputPin("TargetType", PinDataTypeFactory.CreateEnum <ConvertTypeCode>(ConvertTypeCode.Float64), PropertyMode.Always);
            this.outputPin     = AddOutputPin("Output", CreateTargetPinDataType(ConvertTypeCode.Float64));
            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, CreateTargetPinDataType(ConvertTypeCode.Float64), false, pinDataType =>
                {
                    var genericInputType = pinDataType.UnderlyingType;
                    BuildGenericDelegate(genericInputType, outputPin.DataType.UnderlyingType);
                });
            });


            this.properties[targetTypePin.Id].WhenNodeEvent.OfType <PropertyChangedEvent>().Subscribe(x =>
            {
                var targetTypeCode = (ConvertTypeCode)x.Value.Value;

                IPinDataType targetPinDataType = CreateTargetPinDataType(targetTypeCode);
                var errors = outputPin.ChangeType(targetPinDataType);
                if (errors.Any())
                {
                    throw new AggregateException("One or more connections could not be reestablished after a data type change.", errors);
                }
                BuildGenericDelegate(inputPin.DataType.UnderlyingType, outputPin.DataType.UnderlyingType);
            });
        }
Пример #9
0
 public Range(IGraphRuntime runtime)
     : base(runtime)
 {
     this.startPin  = AddInputPin("Start", PinDataTypeFactory.CreateInt32(0), PropertyMode.Default);
     this.countPin  = AddInputPin("Count", PinDataTypeFactory.CreateInt32(10), PropertyMode.Default);
     this.outputPin = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <int> >());
 }
Пример #10
0
        public Aggregate(IGraphRuntime runtime)
            : base(runtime, false, SUBGRAPH_SOURCE_PIN_ID, SUBGRAPH_ACCUMULATE_PIN_ID)
        {
            this.sourceInput = AddInputPin("Source", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.seedInput   = AddInputPin("Seed", PinDataTypeFactory.CreateAny(), PropertyMode.Allow);
            this.output      = AddOutputPin("Output", PinDataTypeFactory.CreateAny());

            this.subGraphInput      = ((GenericOutputPin)this.subGraphInputModule.Outputs[SUBGRAPH_SOURCE_PIN_ID]);
            this.subGraphAccumulate = (GenericOutputPin)this.subGraphInputModule.Outputs[SUBGRAPH_ACCUMULATE_PIN_ID];
            this.subGraphOutput     = subGraph.OutputModule.DefaultInputPin;

            this.sourceInput.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? typeof(object);
                    subGraphInput.ChangeType(PinDataTypeFactory.FromType(genericType));

                    BuildGenericDelegate();
                });
            });

            this.seedInput.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.CreateAny(), false, pinDataType =>
                {
                    subGraphAccumulate.ChangeType(pinDataType);
                    output.ChangeType(pinDataType);
                    subGraphOutput.ChangeType(pinDataType);

                    BuildGenericDelegate();
                });
            });
        }
Пример #11
0
        public SelectMany(IGraphRuntime runtime)
            : base(runtime, false, PinDataTypeFactory.FromType(typeof(ISequence <>)), SUBGRAPH_SOURCE_PIN_ID)
        {
            this.inputPin          = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.sequentialPin     = AddInputPin("Sequential", PinDataTypeFactory.Create <bool>(true), PropertyMode.Default);
            this.outputPin         = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <object> >());
            this.maxConcurrencyPin = AddInputPin("MaxConcurrency", PinDataTypeFactory.Create <int>(8), PropertyMode.Default);

            this.subGraphSource = ((GenericOutputPin)this.subGraphInputModule.Outputs[SUBGRAPH_SOURCE_PIN_ID]);
            this.subGraphResult = this.SubGraph.OutputModule.DefaultInputPin;

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? typeof(object);
                    subGraphSource.ChangeType(PinDataTypeFactory.FromType(genericType));

                    BuildGenericDelegate();
                });
            });

            this.subGraphResult.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    outputPin.ChangeType(pinDataType);

                    BuildGenericDelegate();
                });
            });
        }
Пример #12
0
 public SelectManyFunc(IGraphRuntime runtime)
     : base(runtime)
 {
     inputPin      = AddInputPin("Input", PinDataTypeFactory.Create <ISequence>(), PropertyMode.Never);
     funcPin       = AddInputPin("Function", PinDataTypeFactory.Create <Delegate>(), PropertyMode.Allow);
     sequentialPin = AddInputPin("Sequential", PinDataTypeFactory.Create <bool>(true), PropertyMode.Default);
     outputPin     = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <object> >());
 }
Пример #13
0
 public GaussianRandomSequence(IGraphRuntime runtime)
     : base(runtime)
 {
     this.seedPin   = AddInputPin("Seed", PinDataTypeFactory.Create <int?>(null, WellKnownEditors.IntNumber), PropertyMode.Default);
     this.muPin     = AddInputPin("µ", PinDataTypeFactory.Create <double>(0, WellKnownEditors.FloatNumber), PropertyMode.Default);
     this.sigmaPin  = AddInputPin("σ", PinDataTypeFactory.Create <double>(1, WellKnownEditors.FloatNumber), PropertyMode.Default);
     this.outputPin = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <double> >());
 }
Пример #14
0
 public Merge(IGraphRuntime runtime)
     : base(runtime)
 {
     this.dynamicInputPin = new DynamicInputPin(runtime, inputs, "Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), OnDynamicInputAdd)
     {
         Renameable = true
     };
     this.outputPin = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(ISequence <>)));
 }
Пример #15
0
 public CreateArray(IGraphRuntime runtime)
     : base(runtime)
 {
     this.dynamicInputPin = new DynamicInputPin(runtime, inputs, "Input", PinDataTypeFactory.CreateAny(), OnDynamicInputAdd)
     {
         ForceAutoId = true
     };
     this.output = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(Array)));
 }
Пример #16
0
        public SequenceEqual(IGraphRuntime runtime)
            : base(runtime)
        {
            this.firstInputPin  = AddInputPin("First", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.secondInputPin = AddInputPin("Second", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.outputPin      = AddOutputPin("Result", PinDataTypeFactory.CreateBoolean());

            this.firstInputPin.WhenNodeEvent.Subscribe(HandleInputPinEvent);
            this.secondInputPin.WhenNodeEvent.Subscribe(HandleInputPinEvent);
        }
Пример #17
0
        public Count(IGraphRuntime runtime)
            : base(runtime)
        {
            this.inputPin  = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.outputPin = AddOutputPin("Output", PinDataTypeFactory.CreateInt32());

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true);
            });
        }
Пример #18
0
        public Join(IGraphRuntime runtime)
            : base(runtime)
        {
            this.flowMode = FlowMode.WaitAllOrFirstException;

            this.flowInputs = new DynamicInputPin(runtime, inputs, "Flow", PinDataTypeFactory.CreateFlow())
            {
                MaxConnections = null,
                ForceAutoId    = true
            };
            this.flowOut = this.AddOutputPin("flowOut", PinDataTypeFactory.CreateFlow(), 1);
        }
Пример #19
0
        public If(IGraphRuntime runtime)
            : base(runtime)
        {
            this.flowMode = FlowMode.WaitAny;
            this.AddInputPin("flowIn", PinDataTypeFactory.CreateFlow(), PropertyMode.Never);
            this.condition = this.AddInputPin("condition", PinDataTypeFactory.CreateString("x > 0"), PropertyMode.Default);
            this.arguments = new DynamicInputPin(runtime, base.inputs, "x", PinDataTypeFactory.CreateAny(), OnDynamicInputAdd)
            {
                Renameable = true
            };
            this.AddInterfacePin("x");
            this.trueOut  = this.AddOutputPin("true", PinDataTypeFactory.CreateFlow(), 1);
            this.falseOut = this.AddOutputPin("false", PinDataTypeFactory.CreateFlow(), 1);

            this.DynamicDisplayName = new DynamicDisplayNameFunc(FormatDisplayName);
        }
Пример #20
0
        public ToSequence(IGraphRuntime runtime)
            : base(runtime)
        {
            this.inputPin  = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(IEnumerable <>)), PropertyMode.Never);
            this.outputPin = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(ISequence <>)));

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(IEnumerable <>)), false, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? typeof(object);

                    outputPin.ChangeType(PinDataTypeFactory.FromType(typeof(ISequence <>).MakeGenericType(genericType)));
                });
            });
        }
Пример #21
0
        public ForEach(IGraphRuntime runtime)
            : base(runtime, false, (IPinDataType)null, SUBGRAPH_SOURCE_PIN_ID)
        {
            this.inputPin = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);

            this.subGraphSource = ((GenericOutputPin)this.subGraphInputModule.Outputs[SUBGRAPH_SOURCE_PIN_ID]);

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? typeof(object);
                    subGraphSource.ChangeType(PinDataTypeFactory.FromType(genericType));
                });
            });
        }
Пример #22
0
        public Return(IGraphRuntime runtime)
            : base(runtime)
        {
            this.inputPin  = AddInputPin("Value", PinDataTypeFactory.CreateAny(), PropertyMode.Allow);
            this.outputPin = AddOutputPin("Sequence", PinDataTypeFactory.Create <ISequence <object> >());

            this.inputPin.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.CreateAny(), false, pinDataType =>
                {
                    var method      = EvaluateInternalAttribute.GetMethod(GetType()).MakeGenericMethod(pinDataType.UnderlyingType);
                    genericDelegate = new GenericDelegate <Func <object, object> >(this, method);

                    outputPin.ChangeType(PinDataTypeFactory.FromType(typeof(ISequence <>).MakeGenericType(pinDataType.UnderlyingType)));
                });
            });
        }
Пример #23
0
 public ForceType(IGraphRuntime runtime)
     : base(runtime)
 {
     this.input  = AddInputPin("Input", PinDataTypeFactory.CreateAny(), PropertyMode.Never);
     this.output = AddOutputPin("Output", PinDataTypeFactory.CreateAny());
     this.type   = AddInputPin("Type", PinDataTypeFactory.CreateString("System.Object"), PropertyMode.Always);
     this.properties[this.type.Id].WhenNodeEvent.OfType <PropertyChangedEvent>().Subscribe(x =>
     {
         var genericInputType = Type.GetType((string)x.Value.Value, false, true) ?? typeof(object);
         var dataType         = PinDataTypeFactory.FromType(genericInputType);
         var errors           = input.ChangeType(dataType).Concat(output.ChangeType(dataType));
         if (errors.Any())
         {
             throw new AggregateException("One or more connections could not be reestablished after a data type change.", errors);
         }
     });
 }
Пример #24
0
        public ConverterModule(IGraphRuntime runtime)
            : base(runtime)
        {
            converterByName.Add("None", null);

            foreach (var c in runtime.TypeConverters)
            {
                string sourceTypeName      = GetShortTypeName(c.SourceType);
                string destinationTypeName = GetShortTypeName(c.DestinationType);

                var converterName = string.Concat(sourceTypeName, " -> ", destinationTypeName);
                if (!converterByName.ContainsKey(converterName))
                {
                    converterByName.Add(converterName, c);
                }
            }

            this.inputPin     = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(object)), PropertyMode.Never);
            this.converterPin = AddInputPin("Converter", PinDataTypeFactory.CreateDynamicEnum(converterByName.Keys.ToArray(), "None"), PropertyMode.Always);
            this.outputPin    = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(object)));

            this.properties[converterPin.Id].WhenNodeEvent.OfType <PropertyChangedEvent>().Subscribe(x =>
            {
                var converterName = (string)x.Value.Value;
                converterByName.TryGetValue(converterName, out typeConverter);

                IPinDataType sourceType, destinationType;
                if (typeConverter == null)
                {
                    sourceType      = PinDataTypeFactory.CreateAny();
                    destinationType = PinDataTypeFactory.CreateAny();
                }
                else
                {
                    sourceType      = typeConverter.SourceType != null ? PinDataTypeFactory.FromType(typeConverter.SourceType) : PinDataTypeFactory.CreateAny();
                    destinationType = typeConverter.DestinationType != null ? PinDataTypeFactory.FromType(typeConverter.DestinationType) : PinDataTypeFactory.CreateAny();
                }

                var errors = inputPin.ChangeType(sourceType).Concat(outputPin.ChangeType(destinationType));
                if (errors.Any())
                {
                    throw new AggregateException("One or more connections could not be reestablished after a data type change.", errors);
                }
            });
        }
Пример #25
0
        public Any(IGraphRuntime runtime)
            : base(runtime, false, PinDataTypeFactory.Create <bool>(), SUBGRAPH_SOURCE_PIN_ID)
        {
            this.input  = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(ISequence <>)), PropertyMode.Never);
            this.output = AddOutputPin("Output", PinDataTypeFactory.CreateBoolean());

            this.subGraphInput = ((GenericOutputPin)this.subGraphInputModule.Outputs[SUBGRAPH_SOURCE_PIN_ID]);

            this.input.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.FromType(typeof(ISequence <>)), true, pinDataType =>
                {
                    var genericType = pinDataType.UnderlyingType.GenericTypeArguments.FirstOrDefault() ?? typeof(object);
                    subGraphInput.ChangeType(PinDataTypeFactory.FromType(genericType));

                    BuildGenericDelegate();
                });
            });
        }
Пример #26
0
        public ReadableToV(IGraphRuntime runtime)
            : base(runtime)
        {
            this.targetTypePin = AddInputPin("TargetType", PinDataTypeFactory.CreateEnum <ConvertTypeCode>(ConvertTypeCode.Float64), PropertyMode.Always);
            this.outputPin     = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(V <>)));
            this.outputPin.ChangeType(CreateTargetPinDataType(ConvertTypeCode.Float64));
            this.data = AddInputPin("Input", PinDataTypeFactory.FromType(typeof(IReadable)), PropertyMode.Allow);

            this.delimiter = AddInputPin("Delimiter", PinDataTypeFactory.FromType(typeof(char), ','), PropertyMode.Default);

            this.properties[targetTypePin.Id].WhenNodeEvent.OfType <PropertyChangedEvent>().Subscribe(x =>
            {
                var targetTypeCode = (ConvertTypeCode)x.Value.Value;

                IPinDataType targetPinDataType = CreateTargetPinDataType(targetTypeCode);
                var errors = outputPin.ChangeType(targetPinDataType);
                if (errors.Any())
                {
                    throw new AggregateException("One or more connections could not be reestablished after a data type change.", errors);
                }
            });

            var del = (char)this.Properties.GetValue("Delimiter");
        }
Пример #27
0
        public Zip(IGraphRuntime runtime)
            : base(runtime, true)
        {
            this.dynamicInputPin = new DynamicInputPin(
                runtime,
                inputs,
                "Input",
                PinDataTypeFactory.FromType(typeof(ISequence <>)),
                OnDynamicInputAdd,
                id => SubGraph.InputModule.RemoveModulePin(id)
                );
            this.outputPin = AddOutputPin("Output", PinDataTypeFactory.FromType(typeof(ISequence <object>)));

            this.subGraphResult = this.SubGraph.OutputModule.DefaultInputPin;
            this.subGraphResult.WhenNodeEvent.Subscribe(evt =>
            {
                PinConnectionChangeEventHandler.ConnectionSensitivePinDataType(evt, PinDataTypeFactory.CreateAny(), false, pinDataType =>
                {
                    this.genericDelegate = new GenericDelegate <Func <object, object, object> >(this, EvaluateInternalAttribute.GetMethod(GetType()).MakeGenericMethod(pinDataType.UnderlyingType));

                    this.outputPin.ChangeType(PinDataTypeFactory.FromType(typeof(ISequence <>).MakeGenericType(pinDataType.UnderlyingType)));
                });
            });
        }
Пример #28
0
 public ReadableToString(IGraphRuntime runtime)
     : base(runtime)
 {
     this.readablePin = AddInputPin("Readable", PinDataTypeFactory.Create <IReadable>(), PropertyMode.Allow);
     this.stringPin   = AddOutputPin("String", PinDataTypeFactory.Create <string>());
 }
Пример #29
0
 public ImageDecoderBase(IGraphRuntime runtime)
     : base(runtime)
 {
     this.readablePin = this.AddInputPin("Readable", PinDataTypeFactory.Create <IReadable>(), PropertyMode.Never);
     this.imagePin    = this.AddOutputPin("Image", PinDataTypeFactory.Create <IImageBuffer>());
 }
Пример #30
0
 public Empty(IGraphRuntime runtime)
     : base(runtime)
 {
     this.outputPin = AddOutputPin("Output", PinDataTypeFactory.Create <ISequence <object> >());
 }