Exemplo n.º 1
0
 private static ModelNodeBaseAdapter CreateAdapters(ObjectCacheKey <IModelNodeAdapterParent, INodeBase> cacheKey, IModelNodeAdapterParent parent, INodeBase node)
 {
     if (node is IModelComplexNode)
     {
         return(new ModelComplexNodeAdapter(parent, (IModelComplexNode)node));
     }
     else if (node is IModelValueNode)
     {
         return(new ModelValueNodeAdapter(parent, (IModelValueNode)node));
     }
     else if (node is IModelEnumerableNode)
     {
         return(new ModelEnumerableNodeAdapter(parent, (IModelEnumerableNode)node));
     }
     else if (node is IPropertyNode)
     {
         return(new ModelPropertyNodeAdapter(parent, (IPropertyNode)node));
     }
     else if (node is IEnumerationItemNode)
     {
         return(new ModelEnumerationItemNodeAdapter(parent, (IEnumerationItemNode)node));
     }
     else
     {
         throw new ArgumentException();
     }
 }
Exemplo 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();
            }
        }