Ejemplo n.º 1
0
        public AtrHistoricalBytesAdapterBase(AtrHistoricalCharactersBase historicalCharacters, InterpretedAtrAdapter interpretedAtr)
        {
            this.interpretedAtr = interpretedAtr;
            this.historicalCharactersAdapter = this.CreatePropertyAdapter(
                nameof(this.HistoricalCharacters),
                () => historicalCharacters.HistoricalCharacters.ToHexString(" ")
                );
            this.historicalCharacterTypesAdapter = this.CreatePropertyAdapter(
                nameof(this.HistoricalCharacterTypes),
                () => AtrHistoricalBytesAdapterBase.GetHistoricalCharacterTypes(this.interpretedAtr.HistoricalCharacters)
                );
            this.PropertyChanged += this.AtrHistoricalBytesAdapterBase_PropertyChanged;


            this.setHistoricalCharacterTypeCommand = new DelegateCommand <EnumerationAdapter <HistoricalCharacterTypes> >(this.SetHistoricalCharacterType);
        }
Ejemplo n.º 2
0
        public static AtrHistoricalBytesAdapterBase CreateObject(ObjectCacheKey <AtrHistoricalCharactersBase, InterpretedAtrAdapter> objectCacheKey)
        {
            AtrHistoricalCharactersBase AtrHistoricalCharactersBase = objectCacheKey.Param1;
            var InterpretedAtr = objectCacheKey.Param2;

            if (AtrHistoricalCharactersBase == null)
            {
                return(null);
            }
            else if (AtrHistoricalCharactersBase is AtrCompactTlvHistoricalCharacters)
            {
                return(new AtrCompactTlvHistoricalBytesAdapter((AtrCompactTlvHistoricalCharacters)AtrHistoricalCharactersBase, InterpretedAtr));
            }
            else if (AtrHistoricalCharactersBase is AtrDirDataReferenceHistoricalCharacters)
            {
                return(new AtrDirDataReferenceHistoricalBytesAdapter((AtrDirDataReferenceHistoricalCharacters)AtrHistoricalCharactersBase, InterpretedAtr));
            }
            else if (AtrHistoricalCharactersBase is AtrInvalidHistoricalCharacters)
            {
                return(new AtrInvalidHistoricalBytesAdapter((AtrInvalidHistoricalCharacters)AtrHistoricalCharactersBase, InterpretedAtr));
            }
            else if (AtrHistoricalCharactersBase is AtrProprietaryHistoricalCharacters)
            {
                return(new AtrProprietaryHistoricalBytesAdapter((AtrProprietaryHistoricalCharacters)AtrHistoricalCharactersBase, InterpretedAtr));
            }
            else if (AtrHistoricalCharactersBase is AtrRfuHistoricalCharacters)
            {
                return(new AtrRfuHistoricalBytesAdapter((AtrRfuHistoricalCharacters)AtrHistoricalCharactersBase, InterpretedAtr));
            }
            else if (AtrHistoricalCharactersBase is AtrNoHistoricalCharacters)
            {
                return(new AtrNoHistoricalBytesAdapter((AtrNoHistoricalCharacters)AtrHistoricalCharactersBase, InterpretedAtr));
            }
            else
            {
                throw new ArgumentException();
            }
        }
Ejemplo n.º 3
0
 public static AtrHistoricalBytesAdapterBase GetObject(AtrHistoricalCharactersBase atrHistoricalCharactersBase, InterpretedAtrAdapter interpretedAtr)
 {
     return(AtrHistoricalBytesAdapterBase.objectCache.GetObject(new ObjectCacheKey <AtrHistoricalCharactersBase, InterpretedAtrAdapter>(atrHistoricalCharactersBase, interpretedAtr)));
 }