示例#1
0
        private readonly ELogicX01 _dataValue; // = ELogicX01.Uninitialized;

        #region Conversion & Conversion Routing
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <LogicValue>();
            //library.AddCustomDataType(new CustomDataRef(typeof(LogicValue), ValueConverter<LogicValue>.Router));
            ValueConverter <LogicValue> .AddConverterFrom(ValueConverter <IntegerValue> .Router, false,
                                                          delegate(object value) { return(new LogicValue(((IntegerValue)value).Value == 0 ? ELogicX01.False : ELogicX01.True)); });
        }
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <ComplexInfinitySymbol>(Instance);
            //library.AddCustomDataType(new CustomDataRef(typeof(ComplexInfinitySymbol), ValueConverter<ComplexInfinitySymbol>.Router, Instance));
            ValueConverter <ComplexInfinitySymbol> .AddConverterFrom <NegativeInfinitySymbol>(false, ConvertFrom);

            ValueConverter <ComplexInfinitySymbol> .AddConverterFrom <PositiveInfinitySymbol>(false, ConvertFrom);
        }
 public static void Register(ILibrary library)
 {
     library.AddCustomDataType<ToggleValue>();
     //library.AddCustomDataType(new CustomDataRef(typeof(ToggleValue), ValueConverter<ToggleValue>.Router));
     ValueConverter<ToggleValue>.AddConverterFrom(ValueConverter<IntegerValue>.Router, false,
         delegate(object value) { return ((IntegerValue)value).Value == 0 ? _toggleB : _toggleA; });
     ValueConverter<ToggleValue>.AddConverterTo(ValueConverter<IntegerValue>.Router, true,
         delegate(object value) { return ((ToggleValue)value)._dataValue ? IntegerValue.Zero : IntegerValue.One; });
 }
示例#4
0
        private readonly long _dataValue; // = 0;

        #region Conversion & Conversion Routing
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <TokenValue>();
            ValueConverter <TokenValue> .AddConverterFrom <IntegerValue>(true, ConvertFrom);

            ValueConverter <TokenValue> .AddConverterTo(ValueConverter <IntegerValue> .Router, true,
                                                        delegate(object value)
            {
                return(new IntegerValue(((TokenValue)value).Value));
            });
        }
示例#5
0
        private readonly long _dataValue; // = 0;

        #region Conversion & Conversion Routing
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <IntegerValue>();
            library.AddArbitraryType(typeof(long));
            ValueConverter <IntegerValue> .AddConverterFrom(ValueConverter <long> .Router, true,
                                                            delegate(object value) { return(new IntegerValue((long)value)); });

            ValueConverter <IntegerValue> .AddConverterTo(ValueConverter <long> .Router, true,
                                                          delegate(object value) { return(((IntegerValue)value).Value); });

            //library.AddCustomDataType(new CustomDataRef(typeof(IntegerValue), ValueConverter<IntegerValue>.Router));
        }
示例#6
0
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <RationalValue>();
            //library.AddCustomDataType(new CustomDataRef(typeof(RationalValue), ValueConverter<RationalValue>.Router));
            ValueConverter <RationalValue> .AddConverterFrom <IntegerValue>(true, ConvertFromInteger);

            ValueConverter <RationalValue> .AddConverterTo(ValueConverter <IntegerValue> .Router, false,
                                                           delegate(object value)
            {
                RationalValue rv = (RationalValue)value;
                return(new IntegerValue(rv._numeratorValue / rv._denominatorValue));
            });
        }
示例#7
0
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <ComplexValue>();
            //library.AddCustomDataType(new CustomDataRef(typeof(ComplexValue), ValueConverter<ComplexValue>.Router));
            ValueConverter <ComplexValue> .AddConverterFrom <IntegerValue>(true, ConvertFrom);

            ValueConverter <ComplexValue> .AddConverterFrom <RationalValue>(true, ConvertFrom);

            ValueConverter <ComplexValue> .AddConverterFrom <RealValue>(true, ConvertFrom);

            ValueConverter <ComplexValue> .AddConverterTo(ValueConverter <RealValue> .Router, false,
                                                          delegate(object value) { return(new RealValue(((ComplexValue)value).RealValue)); });
        }
示例#8
0
        private readonly double _dataValue; // = 0;

        #region Conversion & Conversion Routing
        public static void Register(ILibrary library)
        {
            library.AddCustomDataType <RealValue>();
            library.AddArbitraryType(typeof(double));
            //library.AddCustomDataType(new CustomDataRef(typeof(RealValue), ValueConverter<RealValue>.Router));
            ValueConverter <RealValue> .AddConverterFrom <IntegerValue>(true, ConvertFrom);

            ValueConverter <RealValue> .AddConverterFrom <RationalValue>(true, ConvertFrom);

            ValueConverter <RealValue> .AddConverterTo(ValueConverter <IntegerValue> .Router, false,
                                                       delegate(object value) { return(new IntegerValue((long)Math.Round(((RealValue)value).Value, 0))); });

            ValueConverter <IntegerValue> .AddConverterFrom(ValueConverter <double> .Router, true,
                                                            delegate(object value) { return(new RealValue((double)value)); });

            ValueConverter <IntegerValue> .AddConverterTo(ValueConverter <double> .Router, true,
                                                          delegate(object value) { return(((RealValue)value).Value); });
        }
 public static void Register(ILibrary library)
 {
     library.AddCustomDataType <UndefinedSymbol>(Instance);
     //library.AddCustomDataType(new CustomDataRef(typeof(UndefinedSymbol), ValueConverter<UndefinedSymbol>.Router, Instance));
 }
示例#10
0
 public static void Register(ILibrary library)
 {
     library.AddCustomDataType <LiteralValue>();
     //library.AddCustomDataType(new CustomDataRef(typeof(LiteralValue), ValueConverter<LiteralValue>.Router));
     ValueConverter <LiteralValue> .AddConverterFrom <IntegerValue>(true, ConvertFrom);
 }
 public static void Register(ILibrary library)
 {
     library.AddCustomDataType <PositiveInfinitySymbol>(Instance);
 }
示例#12
0
 public static void Register(ILibrary library)
 {
     library.AddCustomDataType <VectorValue <TScalar> >();
     //library.AddCustomDataType(new CustomDataRef(typeof(VectorValue<TScalar>), ValueConverter<VectorValue<TScalar>>.Router));
 }
 public static void Register(ILibrary library)
 {
     library.AddCustomDataType <NegativeInfinitySymbol>(Instance);
     //library.AddCustomDataType(new CustomDataRef(typeof(NegativeInfinitySymbol), ValueConverter<NegativeInfinitySymbol>.Router, Instance));
 }