示例#1
0
        public virtual IAttribute GetAttributeInherited(string name)
        {
            IAttribute a;

            if (TypeInherited == null)
            {
                return(null);
            }
            if (TypeInherited.attrs.TryGetValue(name, out a))
            {
                return(a);
            }
            if (TypeInherited.TypeInherited != null)
            {
                return(TypeInherited.GetAttributeInherited(name));
            }
            return(null);
        }
示例#2
0
        public virtual IMethod GetMethodInherited(string name)
        {
            IMethod m;

            if (TypeInherited == null)
            {
                return(null);
            }
            if (TypeInherited.methods.TryGetValue(name, out m))
            {
                return(m);
            }
            if (TypeInherited.TypeInherited != null)
            {
                return(TypeInherited.GetMethodInherited(name));
            }
            return(null);
        }
示例#3
0
 public bool IsInheritedClass(string type)
 {
     if (type == Name)
     {
         return(true);
     }
     if (TypeInherited != null)
     {
         if (TypeInherited.Name == type)
         {
             return(true);
         }
         else
         {
             return(TypeInherited.IsInheritedClass(type));
         }
     }
     else
     {
         return(false);
     }
 }
        public void AddItem_TypeWithInheritance_ItemAddedToStore()
        {
            var dataItem = new TypeInherited
             {
            FirstType = "string1",
            SecondType = "string2"
             };

             _tableStorageProvider.Add( _tableName, dataItem, "pk", "rk" );
             _tableStorageProvider.Save();

             var result = _tableStorageProvider.Get<TypeInherited>( _tableName, "pk", "rk" );
             Assert.AreEqual( "string2", result.SecondType );
        }